| [ < ] | [ > ] | [ << ] | [ 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.
+R5RS arithmetic procedure +. See section Arithmetics.
+=Gauche inc! macro. See section Assignments.
-R5RS arithmetic procedure -. See section Arithmetics.
-=Gauche dec! macro. See section Assignments.
->Gauche slot-ref is something close to this. See section Accessing instance.
* (binary)R5RS arithmetic procedure *. See section Arithmetics.
* (unary)No equivalent procedure. Scheme doesn't have explicit notation of pointers.
*=No equivalent procedure.
/R5RS arithmetic procedure /. See section Arithmetics.
/=No equivalent procedure.
& (binary)Gauche logand. See section Bitwise operations.
& (unary)No equivalent procedure. Scheme doesn't have explicit notation of pointers.
&&R5RS syntax and. See section Conditionals.
&=No equivalent procedure.
|Gauche logior. See section Bitwise operations.
||R5RS syntax or. See section Conditionals.
|=No equivalent procedure.
^Gauche logxor. See section Bitwise operations.
=R5RS syntax set!. See section Assignments.
==R5RS equivalence procedure, eq?, eqv? and equal?.
See section Equivalence.
<<=R5RS arithmetic procedure < and <=.
See section Numerical comparison. Unlike C operator, Scheme version
is transitive.
<<Gauche ash. See section Bitwise operations.
<<=No equivalent procedure.
>>=R5RS arithmetic procedure > and >=.
See section Numerical comparison. Unlike C operator, Scheme version
is transitive.
>>Gauche ash. See section Bitwise operations.
>>=No equivalent procedure.
%R5RS operator modulo and remainder. See section Arithmetics.
%=No equivalent procedure.
[]R5RS vector-ref (See section Vectors) is something close.
Or you can use Gauche's generic function ref (See section gauche.sequence - Sequence framework)
for arbitrary sequences.
.Gauche slot-ref is something close to this. See section Accessing instance.
~Gauche lognot. See section Bitwise operations.
~=No equivalent procedure.
!R5RS procedure not. See section Booleans.
!=No equivalent procedure.
abortGauche sys-abort. See section Program termination.
absR5RS abs. See section Arithmetics.
accessGauche sys-access. See section File stats.
acosR5RS acos. See section Arithmetics.
alarmGauche sys-alarm. See section Miscellaneous system calls.
asctimeGauche sys-asctime. See section Time.
asinR5RS asin. See section Arithmetics.
assertNo equivalent function in Gauche.
atanatan2R5RS atan. See section Arithmetics.
atexitNo equivalent function in Gauche, but the "after" thunk of active
dynamic handlers are called when exit is called.
See section Program termination, and See section Continuation.
atofatoiatolYou can use string->number. See section Numerical conversions.
bsearchYou can use SRFI-43's vector-binary-search.
See section srfi-43 - Vector library.
callocAllocation is handled automatically in Scheme.
ceilR5RS ceiling. See section Arithmetics.
cfgetispeedcfgetospeedcfsetispeedcfsetospeedGauche's sys-cfgetispeed, sys-cfgetospeed,
sys-cfsetispeed, sys-cfsetospeed. See section gauche.termios - Termios.
chdirGauche's sys-chdir. See section Other file operations.
chmodGauche's sys-chmod. See section File stats.
chownGauche's sys-chown. See section File stats.
clearerrNot supported yet.
clockNo equivalent function in Gauche. You can use sys-times
to get information about CPU time.
closeYou can't directly close the file descriptor, but when you use
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 Common port operations.
closedirNo equivalent function in Gauche. You can use
sys-readdir to read the directory entries at once.
See section Directories.
coscoshcos and cosh. See section Arithmetics.
creatA file is implictly created by default when you open it for writing. See File ports for more control over the creation of files.
ctermidGauche sys-ctermid. See section System inquiry.
ctimeGauche sys-ctime. See section Time.
cuseridNo equivalent function. This is removed from the newer POSIX.
You can use alternative functions, such as sys-getlogin or
sys-getpwuid with sys-getuid.
difftimeGauche sys-difftime. See section Time.
divYou can use R5RS quotient and remainder.
See section Arithmetics.
dupdup2Not directly supported, but you can use port-fd-dup!.
execlexecleexeclpexecvexecveexecvpGauche sys-exec. See section Unix process management.
For higher level interface, gauche.process - High Level Process Interface.
exit_exitUse exit or sys-exit, depends on what you need.
See section Program termination.
expR5RS exp. See section Arithmetics.
fabsR5RS abs. See section Arithmetics.
fcloseYou can't directly close the file stream, but when you use
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.
fcntlImplemented as sys-fcntl in gauche.fcntl module.
See section gauche.fcntl - Low-level file operations.
fdopenGauche's open-input-fd-port or open-output-fd-port.
See section File ports.
feofNot supported yet.
ferrorNot supported yet.
fflushGauche's flush. See section Output.
fgetcUse read-char or read-byte. See section Input.
fgetposUse Gauche's port-tell (See section Common port operations)
fgetsUse read-line or read-block. See section Input.
filenoport-file-numer. See section Common port operations.
floorR5RS floor. See section Arithmetics.
fmodGauche's fmod.
fopenR5RS open-input-file or open-output-file
corresponds to this operation. See section File ports.
forkGauche's sys-fork. See section Unix process management.
forkptyUse sys-forkpty. See section gauche.termios - Termios.
fpathconfNot supported.
fprintfNot directly supported, but Gauche's format
provides similar functionality. See section Output.
SLIB has printf implementation.
fputcUse write-char or write-byte. See section Output.
fputsUse display. See section Output.
freadNot directly supported.
To read binary numbers, see binary.io - Binary I/O.
If you want to read a chunk of bytes, you may be
able to use read-block!.
See section Uvector block I/O.
freeYou don't need this in Scheme.
freopenNot supported.
frexpGauche's frexp
fscanfNot supported. For general case, you have to write a parser.
If you can keep the data in S-exp, you can use read.
If the syntax is very simple, you may be able to utilize
string-tokenize in srfi-14 (srfi-13 - String library),
and/or regular expression stuff (Regular expression).
fseekUse Gauche's port-seek (See section Common port operations)
fsetposUse Gauche's port-seek (See section Common port operations)
fstatGauche's sys-stat. See section File stats.
ftellUse Gauche's port-tell (See section Common port operations)
fwriteNot directly supported.
To write binary numbers, see binary.io - Binary I/O.
If you want to write a chunk of bytes,
you can simply use display or write-block
(See section Uvector block I/O).
getcgetcharUse read-char or read-byte. See section Input.
getcwdGauche's sys-getcwd. See section System inquiry.
getdomainnameGauche's sys-getdomainname. See section System inquiry.
getegidGauche's sys-getegid. See section System inquiry.
getenvGauche's sys-getenv. See section Environment Inquiry.
geteuidGauche's sys-geteuid. See section System inquiry.
gethostnameGauche's sys-gethostname. See section System inquiry.
getgidGauche's sys-getgid. See section System inquiry.
getgrgidgetgrnamGauche's sys-getgrgid and sys-getgrnam. See section Unix groups and users.
getgroupsGauche's sys-getgroups. See section System inquiry.
getloginGauche's sys-getlogin. See section System inquiry.
getpgrpGauche's sys-getpgrp. See section System inquiry.
getpidgetppidGauche's sys-getpid. See section System inquiry.
getpwnamgetpwuidGauche's sys-getpwnam and sys-getpwuid. See section Unix groups and users.
getsUse read-line or read-block. See section Input.
gettimeofdayGauche's sys-gettimeofday. See section Time.
getuidGauche's sys-getuid. See section System inquiry.
gmtimeGauche's sys-gmtime. See section Time.
isalnumNot directly supported, but you can use R5RS char-alphabetic? and
char-numeric?. See section Characters. You can also use
character set. See section Character Set, also srfi-14 - Character-set library.
isalphaR5RS char-alphabetic?. See section Characters. See also
Character Set and srfi-14 - Character-set library.
isattyGauche's sys-isatty. See section Other file operations.
iscntrlNot directly supported, but you can use
(char-set-contains? char-set:iso-control c) with srfi-14.
See section srfi-14 - Character-set library.
isdigitR5RS char-numeric?. See section Characters.
You can also use (char-set-contains? char-set:digit c)
with srfi-14. See section srfi-14 - Character-set library.
isgraphNot directly supported, but you can use
(char-set-contains? char-set:graphic c) with srfi-14.
See section srfi-14 - Character-set library.
islowerR5RS char-lower-case?. See section Characters.
You can also use (char-set-contains? char-set:lower-case c)
with srfi-14. See section srfi-14 - Character-set library.
isprintNot directly supported, but you can use
(char-set-contains? char-set:printing c) with srfi-14.
See section srfi-14 - Character-set library.
ispunctNot directly supported, but you can use
(char-set-contains? char-set:punctuation c) with srfi-14.
See section srfi-14 - Character-set library.
isspaceR5RS char-whitespace?. See section Characters.
You can also use (char-set-contains? char-set:whitespace c)
with srfi-14. See section srfi-14 - Character-set library.
isupperR5RS char-upper-case?. See section Characters.
You can also use (char-set-contains? char-set:upper-case c)
with srfi-14. See section srfi-14 - Character-set library.
isxdigitNot directly supported, but you can use
(char-set-contains? char-set:hex-digit c) with srfi-14.
See section srfi-14 - Character-set library.
killGauche's sys-kill. See section Signal.
labsR5RS abs. See section Arithmetics.
ldexpGauche's ldexp.
ldivUse R5RS quotient and remainder.
See section Arithmetics.
linkGauche's sys-link. See section Directory manipulation.
localeconvGauche's sys-localeconv. See section Locale.
localtimeGauche's sys-localtime. See section Time.
logR5RS log. See section Arithmetics.
log10Not directly supported. log10(z) ≡ (/ (log z) (log 10)).
longjmpR5RS call/cc provides similar (superior) mechanism.
See section Continuation.
lseekUse Gauche's port-seek (See section Common port operations)
mallocNot necessary in Scheme.
mblenmbstowcsmbtowcGauche handles multibyte strings internally, so generally you don't
need to care about multibyte-ness of the string. string-length
always returns a number of characters for a string in supported
encoding. If you want to convert the character encoding,
see gauche.charconv - Character Code Conversion.
memcmpmemcpymemmovememsetNo equivalent functions.
mkdirGauche's sys-mkdir. See section Directory manipulation.
mkfifoGauche's sys-mkfifo.
mkstempGauche's sys-mkstemp. See section Directory manipulation.
Use this instead of tmpnam.
mktimeGauche's sys-mktime. See section Time.
modfGauche's modf.
openNot directly supported.
R5RS open-input-file or open-output-file
corresponds to this operation. See section File ports.
opendirNot directly supported.
You can use sys-readdir to read the directory entries at once.
See section Directories.
openptyUse sys-openpty. See section gauche.termios - Termios.
pathconfNot supported.
pauseGauche's sys-pause. See section Miscellaneous system calls.
perrorNo equivalent function in Gauche. System calls generally throws an
error (<system-error>), including the description of the reason
of failure.
pipeGauche's sys-pipe. See section Other file operations.
powR5RS expt. See section Arithmetics.
printfNot directly supported, but Gauche's format
provides similar functionality. See section Output.
SLIB has printf implementation.
putcputcharUse write-char or write-byte. See section Output.
putsUse display. See section Output.
qsortGauche's sort and sort! provides a convenient way to sort
list of items. See section Comparison and sorting.
raiseNo equivalent function in Gauche. Scheme function 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.
randNot supported directly, but on most platforms a better RNG is available
as sys-random. See section Miscellaneous system calls.
readNot supported directly, but you may be able to use
read-block (See section Input) or
read-block! (See section Uvector block I/O).
readdirNot supported directly. Gauche's sys-readdir reads
the directory at once. See section Directories.
readlinkGauche's sys-readlink. See section Directory manipulation.
This function is available on systems that support symbolink links.
reallocNot necessary in Scheme.
realpathGauche's sys-normalize-pathname or sys-realpath.
See section Pathnames.
removeGauche's sys-remove. See section Directory manipulation.
renameGauche's sys-rename. See section Directory manipulation.
rewindNot directly supported, but you can use port-seek instead.
See section Common port operations.
rewinddirNot supported directly.
You can use sys-readdir to read the directory entries at once.
See section Directories.
rmdirGauche's sys-rmdir. See section Directory manipulation.
scanfNot supported. For general case, you have to write a parser.
If you can keep the data in S-exp, you can use read.
If the syntax is very simple, you may be able to utilize
string-tokenize in srfi-14 (srfi-13 - String library),
and/or regular expression stuff (Regular expression).
selectGauche's sys-select. See section I/O multiplexing.
setbufNot necessary.
setgidGauche's sys-setgid.
setjmpR5RS call/cc provides similar (superior) mechanism.
See section Continuation.
setlocaleGauche's sys-setlocale. See section Locale.
setpgidGauche's sys-setpgid. See section System inquiry.
setsidGauche's sys-setsid. See section System inquiry.
setuidGauche's sys-setuid. See section System inquiry.
setvbufNot necessary.
sigactionYou can use set-signal-handler! to install signal handlers.
See section Handling signals.
sigaddsetsigdelsetsigemptysetsigfillsetGauche's sys-sigset-add! and sys-sigset-delete!.
See section Signals and signal sets.
sigismemberNot supported yet.
siglongjmpR5RS call/cc provides similar (superior) mechanism.
See section Continuation.
signalYou can use with-signal-handlers to install signal handlers.
See section Handling signals.
sigpendingNot supported yet.
sigprocmaskSignal mask is handled internally. See section Handling signals.
sigsetjmpR5RS call/cc provides similar (superior) mechanism.
See section Continuation.
sigsuspendGauche's sys-sigsuspend. See section Masking and waiting signals.
sigwaitGauche's sys-sigwait. See section Masking and waiting signals.
sinsinhUse sin and sinh. See section Arithmetics.
sleepGauche's sys-sleep. See section Miscellaneous system calls.
sprintfNot directly supported, but Gauche's format
provides similar functionality. See section Output.
SLIB has printf implementation.
sqrtR5RS sqrt. See section Arithmetics.
srandNot supported directly, but on most platforms a better RNG is available
as sys-srandom (See section Miscellaneous system calls).
The math.mt-random module provides much superior RNG
(See section math.mt-random - Mersenne Twister Random number generator).
sscanfNot supported. For general case, you have to write a parser.
If you can keep the data in S-exp, you can use read.
If the syntax is very simple, you may be able to utilize
string-tokenize in srfi-14 (srfi-13 - String library),
and/or regular expression stuff (Regular expression).
statGauche's sys-stat. See section File stats.
strcasecmpR5RS string-ci=? and other comparison functions.
See section String Comparison.
strcatR5RS string-append. See section String utilities.
strchrSRFI-13 string-index. See section String searching.
strcmpR5RS string=? and other comparison functions.
See section String Comparison.
strcollNot supported yet.
strcpyR5RS string-copy. See section String utilities.
strcspnNot directly supported, but you can use SRFI-13 string-skip
with a character set. See section String searching.
strerrorGauche's sys-strerror. See section System inquiry.
strftimeGauche's sys-strftime. See section Time.
strlenR5RS string-length. See section String Accessors & Modifiers.
strncatNot directly supported, but you can use string-append and
substring.
strncasecmpSRFI-13 string-compare-ci provides the most flexible
(but a bit difficult to use) functionality.
See section 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?.
strncmpSRFI-13 string-compare provides the most flexible
(but a bit difficult to use) functionality.
See section 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 String Prefixes & Suffixes.
strncpySRFI-13 substring. See section String utilities.
strpbrkNot directly supported, but you can use SRFI-13 string-skip
with a character set. See section String searching.
strrchrSRFI-13 string-index-right. See section String searching.
strspnNot directly supported, but you can use SRFI-13 string-index
with a character set. See section String searching.
strstrSRFI-13 string-contains. See section String searching.
strtodYou can use R5RS string->number. See section Numerical conversions.
strtokSRFI-13 string-tokenize. See section Other string operations.
strtolstrtoulYou can use R5RS string->number. See section Numerical conversions.
strxfrmNot supported yet.
symlinkGauche's sys-symlink. See section Directory manipulation.
This function is available on systems that support symbolink links.
sysconfNot supported yet.
systemGauche's sys-system. See section Unix process management.
It is generally recommended to use the process library
(gauche.process - High Level Process Interface).
tantanhR5RS tan and Gauche tanh. See section Arithmetics.
tcdraintcflowtcflushtcgetattrtcgetpgrptcsendbreaktcsetattrtcsetpgrpCorresponding functions are: sys-tcdrain, sys-tcflow,
sys-tcflush, sys-tcgetattr, sys-tcgetpgrp,
sys-tcsendbreak, sys-tcsetattr, sys-tcsetpgrp.
See section gauche.termios - Termios
timeGauche's sys-time. See section Time.
timesGauche's sys-times. See section System inquiry.
tmpfileNot exactly supported.
tmpnamGauche's 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 Directory manipulation.
tolowertoupperR5RS char-upcase and char-downcase. See section Characters.
ttynameGauche's sys-ttyname. See section Other file operations.
tzsetNot supported yet.
umaskGauche's sys-umask. See section Directory manipulation.
unameGauche's sys-uname. See section System inquiry.
ungetcNot directly supported. You can use peek-char to look
one character ahead, instead of pushing back.
unlinkGauche's sys-unlink. See section Directory manipulation.
utimeGauche's sys-utime. See section File stats.
va_argva_endva_startNot necessary, for Scheme handles variable number of arguments naturally.
vfprintfvprintfvsprintfNot directly supported, but Gauche's format
provides similar functionality. See section Output.
SLIB has printf implementation.
waitGauche's sys-wait. See section Unix process management.
waitpidGauche's sys-waitpid. See section Unix process management.
wcstombswctombGauche handles multibyte strings internally, so generally you don't
need to care about multibyte-ness of the string. string-length
always returns a number of characters for a string in supported
encoding. If you want to convert the character encoding,
see gauche.charconv - Character Code Conversion.
writeR5RS display (See section Output).
Or write-block (See section Uvector block I/O).
| [ < ] | [ > ] | [ << ] | [ Up ] | [ >> ] |
This document was generated by Shiro Kawai on October, 7 2008 using texi2html 1.78.