6 /* Copyright (C) 1995,1996,1998,1999,2000,2001,2002,2003,2004,2008,2009
7 * Free Software Foundation, Inc.
9 * This library is free software; you can redistribute it and/or
10 * modify it under the terms of the GNU Lesser General Public License
11 * as published by the Free Software Foundation; either version 3 of
12 * the License, or (at your option) any later version.
14 * This library is distributed in the hope that it will be useful, but
15 * WITHOUT ANY WARRANTY; without even the implied warranty of
16 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
17 * Lesser General Public License for more details.
19 * You should have received a copy of the GNU Lesser General Public
20 * License along with this library; if not, write to the Free Software
21 * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA
27 #include "libguile/__scm.h"
29 #include "libguile/struct.h"
30 #include "libguile/memoize.h"
42 * Ilocs are relative pointers into local environment structures.
45 #define SCM_ILOCP(n) (SCM_ITAG8(n)==scm_tc8_iloc)
52 typedef SCM (*scm_t_trampoline_0
) (SCM proc
);
53 typedef SCM (*scm_t_trampoline_1
) (SCM proc
, SCM arg1
);
54 typedef SCM (*scm_t_trampoline_2
) (SCM proc
, SCM arg1
, SCM arg2
);
58 #define SCM_EXTEND_ENV scm_acons
60 /*fixme* This should probably be removed throught the code. */
62 #define SCM_TOP_LEVEL_LOOKUP_CLOSURE (scm_current_module_lookup_closure())
66 SCM_API
int scm_badargsp (SCM formals
, SCM args
);
67 SCM_API SCM
scm_call_0 (SCM proc
);
68 SCM_API SCM
scm_call_1 (SCM proc
, SCM arg1
);
69 SCM_API SCM
scm_call_2 (SCM proc
, SCM arg1
, SCM arg2
);
70 SCM_API SCM
scm_call_3 (SCM proc
, SCM arg1
, SCM arg2
, SCM arg3
);
71 SCM_API SCM
scm_call_4 (SCM proc
, SCM arg1
, SCM arg2
, SCM arg3
, SCM arg4
);
72 SCM_API SCM
scm_call_n (SCM proc
, SCM
*argv
, size_t nargs
);
73 SCM_API SCM
scm_apply_0 (SCM proc
, SCM args
);
74 SCM_API SCM
scm_apply_1 (SCM proc
, SCM arg1
, SCM args
);
75 SCM_API SCM
scm_apply_2 (SCM proc
, SCM arg1
, SCM arg2
, SCM args
);
76 SCM_API SCM
scm_apply_3 (SCM proc
, SCM arg1
, SCM arg2
, SCM arg3
, SCM args
);
77 SCM_API SCM
scm_nconc2last (SCM lst
);
78 SCM_API SCM
scm_apply (SCM proc
, SCM arg1
, SCM args
);
79 #define scm_dapply(proc,arg1,args) scm_apply (proc, arg1, args)
80 SCM_API SCM
scm_map (SCM proc
, SCM arg1
, SCM args
);
81 SCM_API SCM
scm_for_each (SCM proc
, SCM arg1
, SCM args
);
82 SCM_API SCM
scm_primitive_eval (SCM exp
);
83 #define scm_primitive_eval_x(exp) scm_primitive_eval (exp)
84 SCM_API SCM
scm_eval (SCM exp
, SCM module
);
85 #define scm_eval_x(exp, module) scm_eval (exp, module)
87 SCM_INTERNAL
void scm_init_eval (void);
90 #endif /* SCM_EVAL_H */