builtins.tab

/*
 * builtins.tab -- Table containing builtin functions
 *
 * (C) m.b (Matthias Blume); HUB, 1992; Jan 1993 PU/CS
 *         Humboldt-University of Berlin
 *         Princeton University, Dept. of Computer Science
 *
 * $Id: builtins.tab,v 2.17 1994/11/12 22:04:27 blume Exp $
 *
 * Note: BUILTIN lists the (f)unction, the (n)ame and the (a)rity of
 *  a built-in function.  BUILTIN_CONT, in addition, lists the (c)on-
 *  tinuation function.  By properly defining BUILTIN and BUITLIN_CONT
 *  you can use this information in different ways as exercised in
 *  Primitive.c.
 */

# ifndef BUILTIN
# define BUILTIN(f,n,a,d) extern unsigned f (unsigned);
# define BUILTIN_CONT(f,c,n,a,d) \
	extern unsigned f (unsigned); \
	extern unsigned c (void);
# define BUILTINS_TAB__BLTN_DF_MSLF_
# endif

# define SPECCONT_BUILTIN
# include "speccont.h"
# undef SPECCONT_BUILTIN

# define BI_(f,n,a,d)   \
	BUILTIN (ScmPrimitive ## f, n, a, d)
# define BIC(f,c,n,a,d) \
	BUILTIN_CONT (ScmPrimitive ## f, ScmPrimitive ## c, n, a, d)

BI_ (Read,		"read",				-1,	r4rs)
BI_ (Write,		"write",			-1,	r4rs)
BI_ (Display,		"display",			-1,	r4rs)
BI_ (Newline,		"newline",			-1,	r4rs)
BI_ (Flush,		"flush",			-1,	user)
BI_ (Append,		"append",			-1,	r4rs)
BI_ (PairP,		"pair?",			1,	r4rs)
BI_ (Cons,		"cons",				2,	r4rs)
BI_ (Car,		"car",				1,	r4rs)
BI_ (Cdr,		"cdr",				1,	r4rs)
BI_ (SetCar,		"set-car!",			2,	r4rs)
BI_ (SetCdr,		"set-cdr!",			2,	r4rs)
BI_ (NullP,		"null?",			1,	r4rs)
BI_ (List,		"list",				-1,	r4rs)
BI_ (Reverse,		"reverse",			1,	r4rs)
BI_ (Quit,		"quit",				-1,	user)
BI_ (Dump,		"dump",				1,	user)
BI_ (Not,		"not",				1,	r4rs)
BI_ (BooleanP,		"boolean?",			1,	r4rs)
BI_ (EqvP,		"eqv?",				2,	r4rs)
BI_ (EqualP,		"equal?",			2,	r4rs)
BI_ (EqP,		"eq?",				2,	r4rs)
BI_ (ListTail,		"list-tail",			2,	r4rs)
BI_ (ListRef,		"list-ref",			2,	r4rs)
BI_ (Memq,		"memq",				2,	r4rs)
BI_ (Memv,		"memv",				2,	r4rs)
BI_ (Member,		"member",			2,	r4rs)
BI_ (Assq,		"assq",				2,	r4rs)
BI_ (Assv,		"assv",				2,	r4rs)
BI_ (Assoc,		"assoc",			2,	r4rs)
BI_ (Length,		"length",			1,	r4rs)
BI_ (SymbolP,		"symbol?",			1,	r4rs)
BI_ (StringToSymbol,	"string->symbol",		1,	r4rs)
BI_ (SymbolToString,	"symbol->string",		1,	r4rs)
BI_ (NumberP,		"number?",			1,	r4rs)
BI_ (ComplexP,		"complex?",			1,	r4rs)
BI_ (RealP,		"real?",			1,	r4rs)
BI_ (RationalP,		"rational?",			1,	r4rs)
BI_ (IntegerP,		"integer?",			1,	r4rs)
BI_ (ExactP,		"exact?",			1,	r4rs)
BI_ (InexactP,		"inexact?",			1,	r4rs)
BI_ (ZeroP,		"zero?",			1,	r4rs)
BI_ (PositiveP,		"positive?",			1,	r4rs)
BI_ (NegativeP,		"negative?",			1,	r4rs)
BI_ (OddP,		"odd?",				1,	r4rs)
BI_ (EvenP,		"even?",			1,	r4rs)
BI_ (NumEqual,		"=",				-1,	r4rs)
BI_ (Less,		"<",				-1,	r4rs)
BI_ (Greater,		">",				-1,	r4rs)
BI_ (NotGreater,	"<=",				-1,	r4rs)
BI_ (NotLess,		">=",				-1,	r4rs)
BI_ (Max,		"max",				-1,	r4rs)
BI_ (Min,		"min",				-1,	r4rs)
BI_ (Add,		"+",				-1,	r4rs)
BI_ (Multiply,		"*",				-1,	r4rs)
BI_ (Subtract,		"-",				-1,	r4rs)
BI_ (Div,		"/",				-1,	r4rs)
BI_ (EofObjectP,	"eof-object?",			1,	r4rs)
BIC (WithInputFromPort,	WPortC,
			"with-input-from-port",		2,	user)
BIC (WithOutputToPort,	WPortC,
			"with-output-to-port",		2,	user)
BI_ (ListToVector,	"list->vector",			1,	r4rs)
BI_ (InputPortP,	"input-port?",			1,	r4rs)
BI_ (OutputPortP,	"output-port?",			1,	r4rs)
BI_ (CurrentInputPort,	"current-input-port",		0,	r4rs)
BI_ (CurrentOutputPort,	"current-output-port",		0,	r4rs)
BI_ (OpenInputFile,	"open-input-file",		-1,	r4rs)
BI_ (OpenOutputFile,	"open-output-file",		-1,	r4rs)
BI_ (OpenAppendFile,	"open-append-file",		-1,	user)
BI_ (OpenTemporaryFile,	"open-temporary-file",		0,	user)
BI_ (OpenInputGeneric,	"open-input-generic",		5,	user)
BI_ (OpenOutputGeneric,	"open-output-generic",		6,	user)
BI_ (ClosePort,		"close-port",			1,	user)
BI_ (RemoveFile,	"remove-file",			1,	user)
BI_ (RenameFile,	"rename-file",			2,	user)
BI_ (SeekAndTell,	"seek-and-tell",		3,	user)
BI_ (VectorP,		"vector?",			1,	r4rs)
BI_ (MakeVector,	"make-vector",			-1,	r4rs)
BI_ (Vector,		"vector",			-1,	r4rs)
BI_ (VectorLength,	"vector-length",		1,	r4rs)
BI_ (VectorRef,		"vector-ref",			2,	r4rs)
BI_ (VectorSet,		"vector-set!",			3,	r4rs)
BI_ (VectorToList,	"vector->list",			1,	r4rs)
BI_ (VectorFill,	"vector-fill!",			2,	r4rs)
BI_ (ProcedureP,	"procedure?",			1,	r4rs)
BI_ (Apply,		"apply",			-1,	r4rs)
BIC (Map,     MapC,	"map",				-1,	r4rs)
BIC (ForEach, ForEachC,	"for-each",			-1,	r4rs)
BIC (Force, ForceC,	"force",			1,	r4rs)
BI_ (CallCC,		"call-with-current-continuation", 1,	r4rs)
BI_ (System,		"system",			1,	user)
BIC (WithErrorHandler, WithSomethingC,
			"with-error-handler",		2,	user)
BIC (WithGCStrategy, WithSomethingC,
			"with-gc-strategy",		2,	user)
BIC (WithIntHandler, WithSomethingC,
			"with-interrupt-handler",	2,	user)
BI_ (CharP,		"char?",			1,	r4rs)
BI_ (CharEqP,		"char=?",			-1,	r4rs)
BI_ (CharLtP,		"char<?",			-1,	r4rs)
BI_ (CharGtP,		"char>?",			-1,	r4rs)
BI_ (CharLeP,		"char<=?",			-1,	r4rs)
BI_ (CharGeP,		"char>=?",			-1,	r4rs)
BI_ (CharCiEqP,		"char-ci=?",			-1,	r4rs)
BI_ (CharCiLtP,		"char-ci<?",			-1,	r4rs)
BI_ (CharCiGtP,		"char-ci>?",			-1,	r4rs)
BI_ (CharCiLeP,		"char-ci<=?",			-1,	r4rs)
BI_ (CharCiGeP,		"char-ci>=?",			-1,	r4rs)
BI_ (CharAlphabeticP,	"char-alphabetic?",		1,	r4rs)
BI_ (CharNumericP,	"char-numeric?",		1,	r4rs)
BI_ (CharWhitespaceP,	"char-whitespace?",		1,	r4rs)
BI_ (CharUpperCaseP,	"char-upper-case?",		1,	r4rs)
BI_ (CharLowerCaseP,	"char-lower-case?",		1,	r4rs)
BI_ (CharToInteger,	"char->integer",		1,	r4rs)
BI_ (IntegerToChar,	"integer->char",		1,	r4rs)
BI_ (CharUpcase,	"char-upcase",			1,	r4rs)
BI_ (CharDowncase,	"char-downcase",		1,	r4rs)
BI_ (StringP,		"string?",			1,	r4rs)
BI_ (MakeString,	"make-string",			-1,	r4rs)
BI_ (String,		"string",			-1,	r4rs)
BI_ (StringLength,	"string-length",		1,	r4rs)
BI_ (StringRef,		"string-ref",			2,	r4rs)
BI_ (StringSet,		"string-set!",			3,	r4rs)
BI_ (StringEqP,		"string=?",			-1,	r4rs)
BI_ (StringLtP,		"string<?",			-1,	r4rs)
BI_ (StringGtP,		"string>?",			-1,	r4rs)
BI_ (StringLeP,		"string<=?",			-1,	r4rs)
BI_ (StringGeP,		"string>=?",			-1,	r4rs)
BI_ (StringCiEqP,	"string-ci=?",			-1,	r4rs)
BI_ (StringCiLtP,	"string-ci<?",			-1,	r4rs)
BI_ (StringCiGtP,	"string-ci>?",			-1,	r4rs)
BI_ (StringCiLeP,	"string-ci<=?",			-1,	r4rs)
BI_ (StringCiGeP,	"string-ci>=?",			-1,	r4rs)
BI_ (Substring,		"substring",			3,	r4rs)
BI_ (StringAppend,	"string-append",		-1,	r4rs)
BI_ (StringToList,	"string->list",			1,	r4rs)
BI_ (ListToString,	"list->string",			1,	r4rs)
BI_ (StringCopy,	"string-copy",			1,	r4rs)
BI_ (StringFill,	"string-fill!",			2,	r4rs)
BI_ (ReadChar,		"read-char",			-1,	r4rs)
BI_ (PeekChar,		"peek-char",			-1,	r4rs)
BI_ (CharReadyP,	"char-ready?",			-1,	r4rs)
BI_ (WriteChar,		"write-char",			-1,	r4rs)
BI_ (ListP,		"list?",			1,	r4rs)
BI_ (Inspect,		"inspect",			2,	system)
BI_ (StandardPort,	"standard-port",		1,	user)
BI_ (Quotient,		"quotient",			2,	r4rs)
BI_ (Remainder,		"remainder",			2,	r4rs)
BI_ (Divide,		"divide",			2,	user)
BI_ (Error,		"error",			1,	user)
BI_ (Clock,		"clock",			0,	user)
BI_ (GcClock,		"gc-clock",			0,	user)
BI_ (StringToNumber,	"string->number",		-1,	r4rs)
BI_ (NumberToString,	"number->string",		-1,	r4rs)
BI_ (Abs,		"abs",				1,	r4rs)
BI_ (Numerator,		"numerator",			1,	r4rs)
BI_ (Denominator,	"denominator",			1,	r4rs)
BI_ (Floor,		"floor",			1,	r4rs)
BI_ (Ceiling,		"ceiling",			1,	r4rs)
BI_ (Truncate,		"truncate",			1,	r4rs)
BI_ (Round,		"round",			1,	r4rs)
BI_ (Exp,		"exp",				1,	r4rs)
BI_ (Log,		"log",				1,	r4rs)
BI_ (Sin,		"sin",				1,	r4rs)
BI_ (Cos,		"cos",				1,	r4rs)
BI_ (Tan,		"tan",				1,	r4rs)
BI_ (Asin,		"asin",				1,	r4rs)
BI_ (Acos,		"acos",				1,	r4rs)
BI_ (Atan,		"atan",				-1,	r4rs)
BI_ (Sqrt,		"sqrt",				1,	r4rs)
BI_ (Magnitude,		"magnitude",			1,	r4rs)
BI_ (Angle,		"angle",			1,	r4rs)
BI_ (RealPart,		"real-part",			1,	r4rs)
BI_ (ImagPart,		"imag-part",			1,	r4rs)
BI_ (ExactToInexact,	"exact->inexact",		1,	r4rs)
BI_ (InexactToExact,	"inexact->exact",		1,	r4rs)
BI_ (MakeRectangular,	"make-rectangular",		2,	r4rs)
BI_ (MakePolar,		"make-polar",			2,	r4rs)
BI_ (Disassemble,	"disassemble",			2,	system)
BI_ (Getenv,		"getenv",			1,	user)
BI_ (CrCreate,		"cr-create",			1,	user)
BI_ (CrTransfer,	"cr-transfer",			2,	user)
BI_ (CrSelf,		"cr-self",			0,	user)
BI_ (Timer,		"timer",			-1,	user)
BIC (WithTimerExpHandler, WithSomethingC,
		 "with-timer-expiration-handler",	2,	user)
BI_ (Values,		"values",			-1,	user)
BI_ (StringWrite,	"string-write",			1,	user)
BI_ (StringDisplay,	"string-display",		1,	user)
BI_ (StringRead,	"string-read",			1,	user)
BI_ (ReRaiseError,	"re-raise-error",		2,	system)
BI_ (NullPointerP,	"null-pointer?",		1,	system)
BI_ (SetSystemMainLoop,	"set-system-main-loop!",	1,	system)

BI_ (RunAsm,		"run-asm",			1,	system)

BI_ (PosixReadDir,	"read-dir",			1,	posix)
BI_ (PosixChangeDir,	"change-dir",			1,	posix)
BI_ (PosixGetWorkingDir,"get-working-dir",		0,	posix)

# ifdef BUILTINS_TAB__BLTN_DF_MSLF_
# undef BUILTINS_TAB__BLTN_DF_MSLF_
# undef BUILTIN
# undef BUILTIN_CONT
# endif