15 static LISP sym_lambda =
NIL;
16 static LISP sym_progn =
NIL;
20 if NSYMBOLP(var)
err(
"wrong type of argument(non-symbol) to setvar",var);
23 return(
CAR(tmp)=val);}
25 static LISP leval_setq(LISP args,LISP env)
28 static LISP syntax_define(LISP args)
44 static LISP leval_define(LISP args,LISP env)
46 tmp = syntax_define(args);
48 if NSYMBOLP(var)
err(
"wrong type of argument(non-symbol) to define",var);
58 static LISP leval_if(LISP *pform,LISP *penv)
66 static LISP arglchk(LISP x)
68 #if (!ENVLOOKUP_TRICK) 72 if NNULLP(l)
err(
"improper formal argument list",x);
76 static LISP leval_lambda(LISP args,LISP env)
80 else body =
cons(sym_progn,
cdr(args));
83 static LISP leval_progn(LISP *pform,LISP *penv)
99 static LISP leval_or(LISP *pform,LISP *penv)
100 {LISP env,l,next,
val;
107 l=next;next=
cdr(next);}
111 static LISP leval_and(LISP *pform,LISP *penv)
119 l=next;next=
cdr(next);}
123 static LISP leval_catch(LISP args,LISP env)
140 static LISP lthrow(LISP
tag,LISP value)
144 {(*l).retval = value;
145 longjmp((*l).cframe,2);}
146 err(
"no *catch found with this tag",
tag);
149 static LISP leval_let(LISP *pform,LISP *penv)
157 static LISP leval_quote(LISP args,LISP env)
161 static LISP leval_tenv(LISP args,LISP env)
165 static LISP leval_while(LISP args,LISP env)
172 static LISP siod_typeof(LISP exp)
200 char ttkbuffer[1024];
219 static LISP symbolp(LISP x)
238 static LISP l_unwind_protect(LISP args, LISP env)
243 volatile long local_errjmp_ok =
errjmp_ok;
246 volatile LISP previous_open_files =
open_files;
257 err(
"forwarded through unwind-protect",
NIL);
271 static LISP oblistfn(
void)
295 Return data (unevaluated).");
297 "(set! SYMBOL VAL)\n\ 298 Set SYMBOL to have value VAL, returns VAL.");
300 "(define (FUNCNAME ARG1 ARG2 ...) . BODY)\n\ 301 Define a new function call FUNCNAME with arguments ARG1, ARG2 ... and\n\ 304 "(lambda (ARG1 ARG2 ...) . BODY)\n\ 305 Create closure (anonymous function) with arguments ARG1, ARG2 ... and \n\ 308 "(if COND TRUEPART FALSEPART)\n\ 309 If COND evaluates to non-nil evaluate TRUEPART and return result,\n\ 310 otherwise evaluate and return FALSEPART. If COND is nil and FALSEPART\n\ 311 is nil, nil is returned.");
313 "(while COND . BODY)\n\ 314 While COND evaluates to non-nil evaluate BODY.");
317 Evaluate s-expressions in BODY returning value of from last expression.");
319 "(*catch TAG . BODY)\n\ 320 Evaluate BODY, if a *throw occurs with TAG then return value specified\n\ 323 "(*throw TAG VALUE)\n\ 324 Jump to *catch with TAG, causing *catch to return VALUE.");
326 "(let-internal STUFF)\n\ 327 Internal function used to implement let.");
329 "(or DISJ1 DISJ2 ...)\n\ 330 Evaluate each disjunction DISJn in turn until one evaluates to non-nil.\n\ 331 Otherwise return nil.");
333 "(and CONJ1 CONJ2 ... CONJN)\n\ 334 Evaluate each conjunction CONJn in turn until one evaluates to nil.\n\ 335 Otherwise return value of CONJN.");
338 Returns typeof of given object.");
341 Returns t if DATA is a symbol, nil otherwise.");
343 "(symbol-bound? VARNAME)\n\ 344 Return t is VARNAME has a value, nil otherwise.");
346 "(symbol-value SYMBOLNAME)\n\ 347 Returns the value of SYMBOLNAME, an error is given SYMBOLNAME is not a\n\ 350 "(the-environment)\n\ 351 Returns the current (SIOD) environment.");
353 "(unwind-protect NORMALFORM ERRORFORM)\n\ 354 If an error is found while evaluating NORMALFORM catch it and evaluate\n\ 355 ERRORFORM and continue. If an error occurs while evaluating NORMALFORM\n\ 356 all file open evaluating NORMALFORM up to the error while be automatically\n\ 357 closed. Note interrupts (ctrl-c) is not caught by this function.");
362 "(let ((VAR1 VAL1) (VAR2 VAL2) ...) . BODY)\n\ 363 Evaluate BODY in an environment where VAR1 is set to VAL1, VAR2 is set\n\ 366 "(set-symbol-value! SYMBOLNAME VALUE)\n\ 367 Set SYMBOLNAME's value to VALUE, this is much faster than set! but use\n\ LISP envlookup(LISP var, LISP env)
#define walloc(TYPE, SIZE)
void init_msubr(const char *name, LISP(*fcn)(LISP *, LISP *), const char *doc)
LISP extend_env(LISP actuals, LISP formals, LISP env)
void close_open_files_upto(LISP end)
void init_subr_2(const char *name, LISP(*fcn)(LISP, LISP), const char *doc)
void gc_unprotect(LISP *location)
struct catch_frame * next
void init_fsubr(const char *name, LISP(*fcn)(LISP, LISP), const char *doc)
LISP symbol_value(LISP x, LISP env)
LISP setcdr(LISP cell, LISP value)
void(* print_string)(LISP, char *)
void err(const char *message, LISP x) EST_NORETURN
void gc_protect_sym(LISP *location, const char *st)
LISP cintern(const char *name)
LISP cons(LISP x, LISP y)
LISP symbol_boundp(LISP x, LISP env)
void siod_reset_prompt(void)
void init_subr_1(const char *name, LISP(*fcn)(LISP), const char *doc)
LISP setcar(LISP cell, LISP value)
LISP leval_args(LISP l, LISP env)
LISP setvar(LISP var, LISP val, LISP env)
void init_subr_3(const char *name, LISP(*fcn)(LISP, LISP, LISP), const char *doc)
LISP rintern(const char *name)
LISP leval(LISP x, LISP env)
LISP closure(LISP env, LISP code)
struct user_type_hooks * get_user_type_hooks(long type)
void init_subr_0(const char *name, LISP(*fcn)(void), const char *doc)
void gc_protect(LISP *location)
LISP let_macro(LISP form)
void init_subrs_core(void)
EST_String after(int pos, int len=1) const
Part after pos+len.
EST_String before(int pos, int len=0) const
Part before position.
void reverse(EST_Wave &sig)
struct catch_frame * catch_framep