Remove deprecated semi-public memoizers.
[bpt/guile.git] / libguile / eval.h
1 /* classes: h_files */
2
3 #ifndef SCM_EVAL_H
4 #define SCM_EVAL_H
5
6 /* Copyright (C) 1995,1996,1998,1999,2000,2001,2002,2003,2004,2008,2009
7 * Free Software Foundation, Inc.
8 *
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.
13 *
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.
18 *
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
22 * 02110-1301 USA
23 */
24
25 \f
26
27 #include "libguile/__scm.h"
28
29 #include "libguile/struct.h"
30
31 \f
32
33 /* {Options}
34 */
35
36
37 \f
38
39 /* {Ilocs}
40 *
41 * Ilocs are relative pointers into local environment structures.
42 *
43 */
44 #define SCM_ILOCP(n) (SCM_ITAG8(n)==scm_tc8_iloc)
45
46 \f
47
48 /* {Promises}
49 */
50
51 #define SCM_F_PROMISE_COMPUTED (1L << 0)
52 #define SCM_PROMISE_COMPUTED_P(promise) \
53 (SCM_F_PROMISE_COMPUTED & SCM_SMOB_FLAGS (promise))
54 #define SCM_SET_PROMISE_COMPUTED(promise) \
55 SCM_SET_SMOB_FLAGS ((promise), SCM_F_PROMISE_COMPUTED)
56 #define SCM_PROMISE_MUTEX SCM_SMOB_OBJECT_2
57 #define SCM_PROMISE_DATA SCM_SMOB_OBJECT
58 #define SCM_SET_PROMISE_DATA SCM_SET_SMOB_OBJECT
59
60
61 SCM_API scm_t_bits scm_tc16_promise;
62
63 \f
64
65 /* {Evaluator}
66 */
67
68 typedef SCM (*scm_t_trampoline_0) (SCM proc);
69 typedef SCM (*scm_t_trampoline_1) (SCM proc, SCM arg1);
70 typedef SCM (*scm_t_trampoline_2) (SCM proc, SCM arg1, SCM arg2);
71
72 \f
73
74 #define SCM_EXTEND_ENV scm_acons
75
76 /*fixme* This should probably be removed throught the code. */
77
78 #define SCM_TOP_LEVEL_LOOKUP_CLOSURE (scm_current_module_lookup_closure())
79
80 \f
81
82 SCM_API SCM scm_sym_and;
83 SCM_API SCM scm_sym_begin;
84 SCM_API SCM scm_sym_case;
85 SCM_API SCM scm_sym_cond;
86 SCM_API SCM scm_sym_define;
87 SCM_API SCM scm_sym_do;
88 SCM_API SCM scm_sym_if;
89 SCM_API SCM scm_sym_lambda;
90 SCM_API SCM scm_sym_let;
91 SCM_API SCM scm_sym_letstar;
92 SCM_API SCM scm_sym_letrec;
93 SCM_API SCM scm_sym_quote;
94 SCM_API SCM scm_sym_quasiquote;
95 SCM_API SCM scm_sym_unquote;
96 SCM_API SCM scm_sym_uq_splicing;
97
98 SCM_API SCM scm_sym_at;
99 SCM_API SCM scm_sym_atat;
100 SCM_API SCM scm_sym_atapply;
101 SCM_API SCM scm_sym_atcall_cc;
102 SCM_API SCM scm_sym_at_call_with_values;
103 SCM_API SCM scm_sym_delay;
104 SCM_API SCM scm_sym_eval_when;
105 SCM_API SCM scm_sym_arrow;
106 SCM_API SCM scm_sym_else;
107 SCM_API SCM scm_sym_apply;
108 SCM_API SCM scm_sym_set_x;
109 SCM_API SCM scm_sym_args;
110
111 \f
112
113 SCM_API SCM * scm_ilookup (SCM iloc, SCM env);
114 SCM_API SCM * scm_lookupcar (SCM vloc, SCM genv, int check);
115 SCM_API SCM scm_eval_car (SCM pair, SCM env);
116 SCM_API SCM scm_eval_body (SCM code, SCM env);
117 SCM_API SCM scm_eval_args (SCM i, SCM env, SCM proc);
118 SCM_API int scm_badargsp (SCM formals, SCM args);
119 SCM_API SCM scm_call_0 (SCM proc);
120 SCM_API SCM scm_call_1 (SCM proc, SCM arg1);
121 SCM_API SCM scm_call_2 (SCM proc, SCM arg1, SCM arg2);
122 SCM_API SCM scm_call_3 (SCM proc, SCM arg1, SCM arg2, SCM arg3);
123 SCM_API SCM scm_call_4 (SCM proc, SCM arg1, SCM arg2, SCM arg3, SCM arg4);
124 SCM_API SCM scm_apply_0 (SCM proc, SCM args);
125 SCM_API SCM scm_apply_1 (SCM proc, SCM arg1, SCM args);
126 SCM_API SCM scm_apply_2 (SCM proc, SCM arg1, SCM arg2, SCM args);
127 SCM_API SCM scm_apply_3 (SCM proc, SCM arg1, SCM arg2, SCM arg3, SCM args);
128 SCM_INTERNAL SCM scm_i_call_closure_0 (SCM proc);
129 SCM_API scm_t_trampoline_0 scm_trampoline_0 (SCM proc);
130 SCM_API scm_t_trampoline_1 scm_trampoline_1 (SCM proc);
131 SCM_API scm_t_trampoline_2 scm_trampoline_2 (SCM proc);
132 SCM_API SCM scm_nconc2last (SCM lst);
133 SCM_API SCM scm_apply (SCM proc, SCM arg1, SCM args);
134 SCM_API SCM scm_dapply (SCM proc, SCM arg1, SCM args);
135 SCM_API SCM scm_map (SCM proc, SCM arg1, SCM args);
136 SCM_API SCM scm_for_each (SCM proc, SCM arg1, SCM args);
137 SCM_API SCM scm_closure (SCM code, SCM env);
138 SCM_API SCM scm_make_promise (SCM thunk);
139 SCM_API SCM scm_force (SCM x);
140 SCM_API SCM scm_promise_p (SCM x);
141 SCM_API SCM scm_cons_source (SCM xorig, SCM x, SCM y);
142 SCM_API SCM scm_copy_tree (SCM obj);
143 SCM_API SCM scm_i_eval_x (SCM exp, SCM env) /* not internal */;
144 SCM_INTERNAL SCM scm_i_eval (SCM exp, SCM env);
145 SCM_API SCM scm_primitive_eval (SCM exp);
146 SCM_API SCM scm_primitive_eval_x (SCM exp);
147 SCM_API SCM scm_eval (SCM exp, SCM module);
148 SCM_API SCM scm_eval_x (SCM exp, SCM module);
149
150 SCM_INTERNAL void scm_i_print_iloc (SCM /*iloc*/, SCM /*port*/);
151 SCM_INTERNAL void scm_i_print_isym (SCM /*isym*/, SCM /*port*/);
152 SCM_INTERNAL SCM scm_i_unmemocopy_expr (SCM expr, SCM env);
153 SCM_INTERNAL SCM scm_i_unmemocopy_body (SCM forms, SCM env);
154 SCM_INTERNAL void scm_init_eval (void);
155
156
157 #if (SCM_ENABLE_DEPRECATED == 1)
158
159 /* Deprecated in guile 1.7.0 on 2004-03-29. */
160 SCM_API SCM scm_ceval (SCM x, SCM env);
161 SCM_API SCM scm_deval (SCM x, SCM env);
162 SCM_API SCM (*scm_ceval_ptr) (SCM x, SCM env);
163
164 #endif
165
166
167 #endif /* SCM_EVAL_H */
168
169 /*
170 Local Variables:
171 c-file-style: "gnu"
172 End:
173 */