| [ < ] | [ > ] | [ << ] | [ Up ] | [ >> ] | [Top] | [Contents] | [Index] | [ ? ] |
For the convenience of the programmers familiar to C, I composed a simple table of C operators and library functions with the corresponding Scheme functions.
+
+. See section 6.2.4 Arithmetics.
+=
inc! macro. See section 4.4 Assignments.
-
-. See section 6.2.4 Arithmetics.
-=
dec! macro. See section 4.4 Assignments.
->
slot-ref is something close to this. See section 7.5 Accessing Instance.
* (binary)
*. See section 6.2.4 Arithmetics.
* (unary)
*=
/
/. See section 6.2.4 Arithmetics.
/=
& (binary)
logand. See section 6.2.6 Bitwise operations.
& (unary)
&&
and. See section 4.5 Conditionals.
&=
|
logior. See section 6.2.6 Bitwise operations.
||
or. See section 4.5 Conditionals.
|=
^
logxor. See section 6.2.6 Bitwise operations.
=
set!. See section 4.4 Assignments.
==
eq?, eqv? and equal?.
See section 6.1 Equivalence.
<
<=
< and <=.
See section 6.2.3 Numerical comparison. Unlike C operator, Scheme version
is transitive.
<<
ash. See section 6.2.6 Bitwise operations.
<<=
>
>=
> and >=.
See section 6.2.3 Numerical comparison. Unlike C operator, Scheme version
is transitive.
>>
ash. See section 6.2.6 Bitwise operations.
>>=
%
modulo and remainder. See section 6.2.4 Arithmetics.
%=
[]
vector-ref (See section 6.12 Vectors) is something close.
Or you can use Gauche's generic function ref (See section 9.18 gauche.sequence - Sequence framework)
for arbitrary sequences.
.
slot-ref is something close to this. See section 7.5 Accessing Instance.
~
lognot. See section 6.2.6 Bitwise operations.
~=
!
not. See section 6.3 Booleans.
!=
abort
sys-abort. See section 6.21.1 Program termination
abs
abs. See section 6.2.4 Arithmetics.
access
sys-access. See section 6.21.3.4 File stats.
acos
acos. See section 6.2.4 Arithmetics.
alarm
sys-alarm. See section 6.21.11 Miscellaneous system calls.
asctime
sys-asctime. See section 6.21.8 Time.
asin
asin. See section 6.2.4 Arithmetics.
assert
atan
atan2
atan. See section 6.2.4 Arithmetics.
atexit
exit is called.
See section 6.21.1 Program termination, and See section 6.15.3 Continuation.
atof
atoi
atol
string->number. See section 6.2.5 Numerical conversions.
bsearch
calloc
ceil
ceiling. See section 6.2.4 Arithmetics.
cfgetispeed
cfgetospeed
cfsetispeed
cfsetospeed
sys-cfgetispeed, sys-cfgetospeed,
sys-cfsetispeed, sys-cfsetospeed. See section 9.20 gauche.termios - Termios.
chdir
sys-chdir. See section 6.21.3.5 Other file operations.
chmod
sys-chmod. See section 6.21.3.4 File stats.
chown
sys-chown. See section 6.21.3.4 File stats
clearerr
clock
sys-times
to get information about CPU time.
close
close-input-port or close-output-port, underlying
file is closed. Some port-related functions, such as
call-with-output-file, automatically closes the file
when operation is finished. The file is also closed when
its governing port is garbage collected.
See section 6.18.2 Common port operations.
closedir
sys-readdir to read the directory entries at once.
See section 6.21.3.1 Directories.
cos
cosh
cos and cosh. See section 6.2.4 Arithmetics.
creat
ctermid
sys-ctermid. See section 6.21.7 System Inquiry.
ctime
sys-ctime. See section 6.21.8 Time.
cuserid
sys-getlogin or
sys-getpwuid with sys-getuid.
difftime
sys-difftime. See section 6.21.8 Time.
div
quotient and remainder.
See section 6.2.4 Arithmetics.
dup
dup2
sys-exec. See section 6.21.9.1 Fork and exec.
execl
execle
execlp
execv
execve
execvp
sys-exec. See section 6.21.9.1 Fork and exec.
For higher level interface, 9.14 gauche.process - High Level Process Interface.
exit
_exit
exit or sys-exit, depends on what you need.
See section 6.21.1 Program termination.
exp
exp. See section 6.2.4 Arithmetics.
fabs
abs. See section 6.2.4 Arithmetics.
fclose
close-input-port or close-output-port, underlying
file is closed. Some port-related functions, such as
call-with-output-file, automatically closes the file
when operation is finished. The file is also closed when
its governing port is garbage collected.
fcntl
sys-fcntl in gauche.fcntl module.
See section 9.5 gauche.fcntl - Low-level file operations.
fdopen
open-input-fd-port or open-output-fd-port.
See section 6.18.3 File ports.
feof
ferror
fflush
flush. See section 6.18.7 Output.
fgetc
read-char or read-byte. See section 6.18.6 Input.
fgetpos
fgets
read-line or read-block. See section 6.18.6 Input.
fileno
port-file-numer. See section 6.18.2 Common port operations.
floor
floor. See section 6.2.4 Arithmetics.
fmod
fmod.
fopen
open-input-file or open-output-file
corresponds to this operation. See section 6.18.3 File ports.
fork
sys-fork. See section 6.21.9.1 Fork and exec.
forkpty
sys-forkpty. See section 9.20 gauche.termios - Termios.
fpathconf
fprintf
format
provides similar functionality. See section 6.18.7 Output.
SLIB has printf implementation.
fputc
write-char or write-byte. See section 6.18.7 Output.
fputs
display. See section 6.18.7 Output.
fread
read-block.
free
freopen
frexp
frexp
fscanf
read.
If the syntax is very simple, you may be able to utilize
string-tokenize in srfi-14 (10.7 srfi-13 - String library),
and/or regular expression stuff (6.11 Regular expression,
also 9.15 gauche.regexp - Regular expression utilities.
fseek
fsetpos
fstat
sys-stat. See section 6.21.3.4 File stats.
ftell
fwrite
display. See section 6.18.7 Output.
getc
getchar
read-char or read-byte. See section 6.18.6 Input.
getcwd
sys-getcwd. See section 6.21.7 System Inquiry.
getdomainname
sys-getdomainname. See section 6.21.7 System Inquiry.
getegid
sys-getegid. See section 6.21.7 System Inquiry.
getenv
sys-getenv. See section 6.21.2 Environment Inquiry.
geteuid
sys-geteuid. See section 6.21.7 System Inquiry.
gethostname
sys-gethostname. See section 6.21.7 System Inquiry.
getgid
sys-getgid. See section 6.21.7 System Inquiry.
getgrgid
getgrnam
sys-getgrgid and sys-getgrnam. See section 6.21.4.1 Unix Group.
getgroups
sys-getgroups. See section 6.21.7 System Inquiry.
getlogin
sys-getlogin. See section 6.21.7 System Inquiry.
getpgrp
sys-getpgrp. See section 6.21.7 System Inquiry.
getpid
getppid
sys-getpid. See section 6.21.7 System Inquiry.
getpwnam
getpwuid
sys-getpwnam and sys-getpwuid. See section 6.21.4.2 Unix users.
gets
read-line or read-block. See section 6.18.6 Input.
gettimeofday
sys-gettimeofday. See section 6.21.8 Time.
getuid
sys-getuid. See section 6.21.7 System Inquiry.
gmtime
sys-gmtime. See section 6.21.8 Time.
isalnum
char-alphabetic? and
char-numeric?. See section 6.8 Characters. You can also use
character set. See section 6.9 Character Set, also 10.8 srfi-14 - Character-set library.
isalpha
char-alphabetic?. See section 6.8 Characters. See also
6.9 Character Set and 10.8 srfi-14 - Character-set library.
isatty
sys-isatty. See section 6.21.3.5 Other file operations.
iscntrl
(char-set-contains? char-set:iso-control c) with srfi-14.
See section 10.8 srfi-14 - Character-set library.
isdigit
char-numeric?. See section 6.8 Characters.
You can also use (char-set-contains? char-set:digit c)
with srfi-14. See section 10.8 srfi-14 - Character-set library.
isgraph
(char-set-contains? char-set:graphic c) with srfi-14.
See section 10.8 srfi-14 - Character-set library.
islower
char-lower-case?. See section 6.8 Characters.
You can also use (char-set-contains? char-set:lower-case c)
with srfi-14. See section 10.8 srfi-14 - Character-set library.
isprint
(char-set-contains? char-set:printing c) with srfi-14.
See section 10.8 srfi-14 - Character-set library.
ispunct
(char-set-contains? char-set:punctuation c) with srfi-14.
See section 10.8 srfi-14 - Character-set library.
isspace
char-whitespace?. See section 6.8 Characters.
You can also use (char-set-contains? char-set:whitespace c)
with srfi-14. See section 10.8 srfi-14 - Character-set library.
isupper
char-upper-case?. See section 6.8 Characters.
You can also use (char-set-contains? char-set:upper-case c)
with srfi-14. See section 10.8 srfi-14 - Character-set library.
isxdigit
(char-set-contains? char-set:hex-digit c) with srfi-14.
See section 10.8 srfi-14 - Character-set library.
kill
sys-kill. See section 6.21.6 Signal.
labs
abs. See section 6.2.4 Arithmetics.
ldexp
ldexp.
ldiv
quotient and remainder.
See section 6.2.4 Arithmetics.
link
sys-link. See section 6.21.3.2 Directory manipulation.
localeconv
sys-localeconv. See section 6.21.5 Locale.
localtime
sys-localtime. See section 6.21.8 Time.
log
log. See section 6.2.4 Arithmetics.
log10
log10(z) == (/ (log z) (log 10)).
longjmp
call/cc provides similar (superior) mechanism.
See section 6.15.3 Continuation.
lseek
malloc
mblen
mbstowcs
mbtowc
string-length
always returns a number of characters for a string in supported
encoding. If you want to convert the character encoding,
see 9.2 gauche.charconv - Character Code Conversion.
memcmp
memcpy
memmove
memset
mkdir
sys-mkdir. See section 6.21.3.2 Directory manipulation.
mkfifo
sys-mkfifo.
mkstemp
sys-mkstemp. See section 6.21.3.2 Directory manipulation.
Use this instead of tmpnam.
mktime
sys-mktime. See section 6.21.8 Time.
modf
modf.
open
open-input-file or open-output-file
corresponds to this operation. See section 6.18.3 File ports.
opendir
sys-readdir to read the directory entries at once.
See section 6.21.3.1 Directories.
openpty
sys-openpty. See section 9.20 gauche.termios - Termios.
pathconf
pause
sys-pause. See section 6.21.11 Miscellaneous system calls.
perror
<system-error>), including the description of the reason
of failure.
pipe
sys-pipe. See section 6.21.3.5 Other file operations.
pow
expt. See section 6.2.4 Arithmetics.
printf
format
provides similar functionality. See section 6.18.7 Output.
SLIB has printf implementation.
putc
putchar
write-char or write-byte. See section 6.18.7 Output.
puts
display. See section 6.18.7 Output.
qsort
sort and sort! provides a convenient way to sort
list of items. See section 6.20 Comparison and sorting.
raise
raise (SRFI-18)
is to raise an exception. You can use (sys-kill (sys-getpid) SIG)
to send a signal SIG to the current process.
rand
sys-random. See section 6.21.11 Miscellaneous system calls.
read
read-block (See section 6.18.6 Input) or
read-block! (See section 9.24.4 Uvector block I/O).
readdir
sys-readdir reads
the directly at once. See section 6.21.3.1 Directories.
readlink
sys-readlink. See section 6.21.3.2 Directory manipulation.
This function is available on systems that support symbolink links.
realloc
remove
sys-remove. See section 6.21.3.2 Directory manipulation.
rename
sys-rename. See section 6.21.3.2 Directory manipulation.
rewind
rewinddir
sys-readdir to read the directory entries at once.
See section 6.21.3.1 Directories.
rmdir
sys-rmdir. See section 6.21.3.2 Directory manipulation.
scanf
read.
If the syntax is very simple, you may be able to utilize
string-tokenize in srfi-14 (10.7 srfi-13 - String library),
and/or regular expression stuff (6.11 Regular expression,
also 9.15 gauche.regexp - Regular expression utilities.
select
sys-select. See section 6.21.10 I/O multiplexing.
setbuf
setgid
sys-setgid.
setjmp
call/cc provides similar (superior) mechanism.
See section 6.15.3 Continuation.
setlocale
sys-setlocale. See section 6.21.5 Locale.
setpgid
sys-setpgid. See section 6.21.7 System Inquiry.
setsid
sys-setsid. See section 6.21.7 System Inquiry.
setuid
sys-setuid. See section 6.21.7 System Inquiry.
setvbuf
sigaction
with-signal-handlers to install signal handlers.
See section 6.21.6.3 Handling signals.
sigaddset
sigdelset
sigemptyset
sigfillset
sys-sigset-add! and sys-sigset-delete!.
See section 6.21.6.1 Signals and signal sets.
sigismember
siglongjmp
call/cc provides similar (superior) mechanism.
See section 6.15.3 Continuation.
signal
with-signal-handlers to install signal handlers.
See section 6.21.6.3 Handling signals.
sigpending
sigprocmask
sigsetjmp
call/cc provides similar (superior) mechanism.
See section 6.15.3 Continuation.
sigsuspend
sin
sinh
sin and sinh. See section 6.2.4 Arithmetics.
sleep
sys-sleep. See section 6.21.11 Miscellaneous system calls.
sprintf
format
provides similar functionality. See section 6.18.7 Output.
SLIB has printf implementation.
sqrt
sqrt. See section 6.2.4 Arithmetics.
srand
sys-srandom. See section 6.21.11 Miscellaneous system calls.
sscanf
read.
If the syntax is very simple, you may be able to utilize
string-tokenize in srfi-14 (10.7 srfi-13 - String library),
and/or regular expression stuff (6.11 Regular expression,
also 9.15 gauche.regexp - Regular expression utilities.
stat
sys-stat. See section 6.21.3.4 File stats.
strcasecmp
string-ci=? and other comparison functions.
See section 6.10.6 String Comparison.
strcat
string-append. See section 6.10.7 String utilities.
strchr
string-index. See section 10.7.7 String searching.
strcmp
string=? and other comparison functions.
See section 6.10.6 String Comparison.
strcoll
strcpy
string-copy. See section 6.10.7 String utilities.
strcspn
string-skip
with a character set. See section 10.7.7 String searching.
strerror
strftime
sys-strftime. See section 6.21.8 Time.
strlen
string-length. See section 6.10.5 String Accessors & Modifiers.
strncat
string-append and
substring.
strncasecmp
string-compare-ci provides the most flexible
(but a bit difficult to use) functionality.
See section 10.7.5 String comparison.
If what you want is just to check the fixed-length prefixes of two
string matches, you can use SRFI-13 string-prefix-ci?.
strncmp
string-compare provides the most flexible
(but a bit difficult to use) functionality.
See section 10.7.5 String comparison.
If what you want is just to check the fixed-length prefixes of two
string matches, you can use SRFI-13 string-prefix?.
See section 10.7.6 String Prefixes & Suffixes.
strncpy
substring. See section 6.10.7 String utilities.
strpbrk
string-skip
with a character set. See section 10.7.7 String searching.
strrchr
string-index-right. See section 10.7.7 String searching.
strspn
string-index
with a character set. See section 10.7.7 String searching.
strstr
string-contains. See section 10.7.7 String searching.
strtod
string->number. See section 6.2.5 Numerical conversions.
strtok
string-tokenize. See section 10.7.12 Other string operations.
strtol
strtoul
string->number. See section 6.2.5 Numerical conversions.
strxfrm
symlink
sys-symlink. See section 6.21.3.2 Directory manipulation.
This function is available on systems that support symbolink links.
sysconf
system
sys-system. See section 6.21.9.1 Fork and exec.
It is generally recommended to use the process library
(9.14 gauche.process - High Level Process Interface).
tan
tanh
tan and Gauche tanh. See section 6.2.4 Arithmetics.
tcdrain
tcflow
tcflush
tcgetattr
tcgetpgrp
tcsendbreak
tcsetattr
tcsetpgrp
sys-tcdrain, sys-tcflow,
sys-tcflush, sys-tcgetattr, sys-tcgetpgrp,
sys-tcsendbreak, sys-tcsetattr, sys-tcsetpgrp.
See section 9.20 gauche.termios - Termios
time
sys-time. See section 6.21.8 Time.
times
sys-times. See section 6.21.7 System Inquiry.
tmpfile
tmpnam
sys-tmpnam.
This function is provided since it is in POSIX, but its use is
discouraged for the potential security risk. Use sys-mkstemp
instead. See section 6.21.3.2 Directory manipulation.
tolower
toupper
char-upcase and char-downcase. See section 6.8 Characters.
ttyname
sys-ttyname. See section 6.21.3.5 Other file operations.
tzset
umask
sys-umask. See section 6.21.3.2 Directory manipulation.
uname
sys-uname. See section 6.21.7 System Inquiry.
ungetc
peek-char to look
one character ahead, instead of pushing back.
unlink
sys-unlink. See section 6.21.3.2 Directory manipulation.
utime
va_arg
va_end
va_start
vfprintf
vprintf
vsprintf
format
provides similar functionality. See section 6.18.7 Output.
SLIB has printf implementation.
wait
sys-wait. See section 6.21.9.2 Wait.
waitpid
sys-waitpid. See section 6.21.9.2 Wait.
wcstombs
wctomb
string-length
always returns a number of characters for a string in supported
encoding. If you want to convert the character encoding,
see 9.2 gauche.charconv - Character Code Conversion.
write
display (See section 6.18.7 Output).
Or write-block (See section 9.24.4 Uvector block I/O).
| [ < ] | [ > ] | [ << ] | [ Up ] | [ >> ] | [Top] | [Contents] | [Index] | [ ? ] |