Commit | Line | Data |
---|---|---|
a0e07ba4 NJ |
1 | |
2 | @c module (guile) | |
3 | ||
8f85c0c6 NJ |
4 | @deffn {Scheme Procedure} environment? obj |
5 | @deffnx {C Function} scm_environment_p (obj) | |
a0e07ba4 NJ |
6 | Return @code{#t} if @var{obj} is an environment, or @code{#f} |
7 | otherwise. | |
8 | @end deffn | |
9 | ||
8f85c0c6 NJ |
10 | @deffn {Scheme Procedure} environment-bound? env sym |
11 | @deffnx {C Function} scm_environment_bound_p (env, sym) | |
a0e07ba4 NJ |
12 | Return @code{#t} if @var{sym} is bound in @var{env}, or |
13 | @code{#f} otherwise. | |
14 | @end deffn | |
15 | ||
8f85c0c6 NJ |
16 | @deffn {Scheme Procedure} environment-ref env sym |
17 | @deffnx {C Function} scm_environment_ref (env, sym) | |
a0e07ba4 NJ |
18 | Return the value of the location bound to @var{sym} in |
19 | @var{env}. If @var{sym} is unbound in @var{env}, signal an | |
20 | @code{environment:unbound} error. | |
21 | @end deffn | |
22 | ||
8f85c0c6 NJ |
23 | @deffn {Scheme Procedure} environment-fold env proc init |
24 | @deffnx {C Function} scm_environment_fold (env, proc, init) | |
a0e07ba4 NJ |
25 | Iterate over all the bindings in @var{env}, accumulating some |
26 | value. | |
27 | For each binding in @var{env}, apply @var{proc} to the symbol | |
28 | bound, its value, and the result from the previous application | |
29 | of @var{proc}. | |
30 | Use @var{init} as @var{proc}'s third argument the first time | |
31 | @var{proc} is applied. | |
32 | If @var{env} contains no bindings, this function simply returns | |
33 | @var{init}. | |
34 | If @var{env} binds the symbol sym1 to the value val1, sym2 to | |
35 | val2, and so on, then this procedure computes: | |
36 | @lisp | |
37 | (proc sym1 val1 | |
38 | (proc sym2 val2 | |
39 | ... | |
40 | (proc symn valn | |
41 | init))) | |
42 | @end lisp | |
43 | Each binding in @var{env} will be processed exactly once. | |
44 | @code{environment-fold} makes no guarantees about the order in | |
45 | which the bindings are processed. | |
46 | Here is a function which, given an environment, constructs an | |
47 | association list representing that environment's bindings, | |
48 | using environment-fold: | |
49 | @lisp | |
50 | (define (environment->alist env) | |
51 | (environment-fold env | |
52 | (lambda (sym val tail) | |
53 | (cons (cons sym val) tail)) | |
54 | '())) | |
55 | @end lisp | |
56 | @end deffn | |
57 | ||
8f85c0c6 NJ |
58 | @deffn {Scheme Procedure} environment-define env sym val |
59 | @deffnx {C Function} scm_environment_define (env, sym, val) | |
a0e07ba4 NJ |
60 | Bind @var{sym} to a new location containing @var{val} in |
61 | @var{env}. If @var{sym} is already bound to another location | |
62 | in @var{env} and the binding is mutable, that binding is | |
63 | replaced. The new binding and location are both mutable. The | |
64 | return value is unspecified. | |
65 | If @var{sym} is already bound in @var{env}, and the binding is | |
66 | immutable, signal an @code{environment:immutable-binding} error. | |
67 | @end deffn | |
68 | ||
8f85c0c6 NJ |
69 | @deffn {Scheme Procedure} environment-undefine env sym |
70 | @deffnx {C Function} scm_environment_undefine (env, sym) | |
a0e07ba4 NJ |
71 | Remove any binding for @var{sym} from @var{env}. If @var{sym} |
72 | is unbound in @var{env}, do nothing. The return value is | |
73 | unspecified. | |
74 | If @var{sym} is already bound in @var{env}, and the binding is | |
75 | immutable, signal an @code{environment:immutable-binding} error. | |
76 | @end deffn | |
77 | ||
8f85c0c6 NJ |
78 | @deffn {Scheme Procedure} environment-set! env sym val |
79 | @deffnx {C Function} scm_environment_set_x (env, sym, val) | |
a0e07ba4 NJ |
80 | If @var{env} binds @var{sym} to some location, change that |
81 | location's value to @var{val}. The return value is | |
82 | unspecified. | |
83 | If @var{sym} is not bound in @var{env}, signal an | |
84 | @code{environment:unbound} error. If @var{env} binds @var{sym} | |
85 | to an immutable location, signal an | |
86 | @code{environment:immutable-location} error. | |
87 | @end deffn | |
88 | ||
8f85c0c6 NJ |
89 | @deffn {Scheme Procedure} environment-cell env sym for_write |
90 | @deffnx {C Function} scm_environment_cell (env, sym, for_write) | |
a0e07ba4 NJ |
91 | Return the value cell which @var{env} binds to @var{sym}, or |
92 | @code{#f} if the binding does not live in a value cell. | |
93 | The argument @var{for-write} indicates whether the caller | |
94 | intends to modify the variable's value by mutating the value | |
95 | cell. If the variable is immutable, then | |
96 | @code{environment-cell} signals an | |
97 | @code{environment:immutable-location} error. | |
98 | If @var{sym} is unbound in @var{env}, signal an | |
99 | @code{environment:unbound} error. | |
100 | If you use this function, you should consider using | |
101 | @code{environment-observe}, to be notified when @var{sym} gets | |
102 | re-bound to a new value cell, or becomes undefined. | |
103 | @end deffn | |
104 | ||
8f85c0c6 NJ |
105 | @deffn {Scheme Procedure} environment-observe env proc |
106 | @deffnx {C Function} scm_environment_observe (env, proc) | |
a0e07ba4 NJ |
107 | Whenever @var{env}'s bindings change, apply @var{proc} to |
108 | @var{env}. | |
109 | This function returns an object, token, which you can pass to | |
110 | @code{environment-unobserve} to remove @var{proc} from the set | |
111 | of procedures observing @var{env}. The type and value of | |
112 | token is unspecified. | |
113 | @end deffn | |
114 | ||
8f85c0c6 NJ |
115 | @deffn {Scheme Procedure} environment-observe-weak env proc |
116 | @deffnx {C Function} scm_environment_observe_weak (env, proc) | |
a0e07ba4 NJ |
117 | This function is the same as environment-observe, except that |
118 | the reference @var{env} retains to @var{proc} is a weak | |
119 | reference. This means that, if there are no other live, | |
120 | non-weak references to @var{proc}, it will be | |
121 | garbage-collected, and dropped from @var{env}'s | |
122 | list of observing procedures. | |
123 | @end deffn | |
124 | ||
8f85c0c6 NJ |
125 | @deffn {Scheme Procedure} environment-unobserve token |
126 | @deffnx {C Function} scm_environment_unobserve (token) | |
a0e07ba4 NJ |
127 | Cancel the observation request which returned the value |
128 | @var{token}. The return value is unspecified. | |
129 | If a call @code{(environment-observe env proc)} returns | |
130 | @var{token}, then the call @code{(environment-unobserve token)} | |
131 | will cause @var{proc} to no longer be called when @var{env}'s | |
132 | bindings change. | |
133 | @end deffn | |
134 | ||
8f85c0c6 NJ |
135 | @deffn {Scheme Procedure} make-leaf-environment |
136 | @deffnx {C Function} scm_make_leaf_environment () | |
a0e07ba4 NJ |
137 | Create a new leaf environment, containing no bindings. |
138 | All bindings and locations created in the new environment | |
139 | will be mutable. | |
140 | @end deffn | |
141 | ||
8f85c0c6 NJ |
142 | @deffn {Scheme Procedure} leaf-environment? object |
143 | @deffnx {C Function} scm_leaf_environment_p (object) | |
a0e07ba4 NJ |
144 | Return @code{#t} if object is a leaf environment, or @code{#f} |
145 | otherwise. | |
146 | @end deffn | |
147 | ||
8f85c0c6 NJ |
148 | @deffn {Scheme Procedure} make-eval-environment local imported |
149 | @deffnx {C Function} scm_make_eval_environment (local, imported) | |
a0e07ba4 NJ |
150 | Return a new environment object eval whose bindings are the |
151 | union of the bindings in the environments @var{local} and | |
152 | @var{imported}, with bindings from @var{local} taking | |
153 | precedence. Definitions made in eval are placed in @var{local}. | |
154 | Applying @code{environment-define} or | |
155 | @code{environment-undefine} to eval has the same effect as | |
156 | applying the procedure to @var{local}. | |
157 | Note that eval incorporates @var{local} and @var{imported} by | |
158 | reference: | |
159 | If, after creating eval, the program changes the bindings of | |
160 | @var{local} or @var{imported}, those changes will be visible | |
161 | in eval. | |
162 | Since most Scheme evaluation takes place in eval environments, | |
163 | they transparently cache the bindings received from @var{local} | |
164 | and @var{imported}. Thus, the first time the program looks up | |
165 | a symbol in eval, eval may make calls to @var{local} or | |
166 | @var{imported} to find their bindings, but subsequent | |
167 | references to that symbol will be as fast as references to | |
168 | bindings in finite environments. | |
169 | In typical use, @var{local} will be a finite environment, and | |
170 | @var{imported} will be an import environment | |
171 | @end deffn | |
172 | ||
8f85c0c6 NJ |
173 | @deffn {Scheme Procedure} eval-environment? object |
174 | @deffnx {C Function} scm_eval_environment_p (object) | |
a0e07ba4 NJ |
175 | Return @code{#t} if object is an eval environment, or @code{#f} |
176 | otherwise. | |
177 | @end deffn | |
178 | ||
8f85c0c6 NJ |
179 | @deffn {Scheme Procedure} eval-environment-local env |
180 | @deffnx {C Function} scm_eval_environment_local (env) | |
a0e07ba4 NJ |
181 | Return the local environment of eval environment @var{env}. |
182 | @end deffn | |
183 | ||
8f85c0c6 NJ |
184 | @deffn {Scheme Procedure} eval-environment-set-local! env local |
185 | @deffnx {C Function} scm_eval_environment_set_local_x (env, local) | |
a0e07ba4 NJ |
186 | Change @var{env}'s local environment to @var{local}. |
187 | @end deffn | |
188 | ||
8f85c0c6 NJ |
189 | @deffn {Scheme Procedure} eval-environment-imported env |
190 | @deffnx {C Function} scm_eval_environment_imported (env) | |
a0e07ba4 NJ |
191 | Return the imported environment of eval environment @var{env}. |
192 | @end deffn | |
193 | ||
8f85c0c6 NJ |
194 | @deffn {Scheme Procedure} eval-environment-set-imported! env imported |
195 | @deffnx {C Function} scm_eval_environment_set_imported_x (env, imported) | |
a0e07ba4 NJ |
196 | Change @var{env}'s imported environment to @var{imported}. |
197 | @end deffn | |
198 | ||
8f85c0c6 NJ |
199 | @deffn {Scheme Procedure} make-import-environment imports conflict_proc |
200 | @deffnx {C Function} scm_make_import_environment (imports, conflict_proc) | |
a0e07ba4 NJ |
201 | Return a new environment @var{imp} whose bindings are the union |
202 | of the bindings from the environments in @var{imports}; | |
203 | @var{imports} must be a list of environments. That is, | |
204 | @var{imp} binds a symbol to a location when some element of | |
205 | @var{imports} does. | |
206 | If two different elements of @var{imports} have a binding for | |
207 | the same symbol, the @var{conflict-proc} is called with the | |
208 | following parameters: the import environment, the symbol and | |
209 | the list of the imported environments that bind the symbol. | |
210 | If the @var{conflict-proc} returns an environment @var{env}, | |
211 | the conflict is considered as resolved and the binding from | |
212 | @var{env} is used. If the @var{conflict-proc} returns some | |
213 | non-environment object, the conflict is considered unresolved | |
214 | and the symbol is treated as unspecified in the import | |
215 | environment. | |
216 | The checking for conflicts may be performed lazily, i. e. at | |
217 | the moment when a value or binding for a certain symbol is | |
218 | requested instead of the moment when the environment is | |
219 | created or the bindings of the imports change. | |
220 | All bindings in @var{imp} are immutable. If you apply | |
221 | @code{environment-define} or @code{environment-undefine} to | |
222 | @var{imp}, Guile will signal an | |
223 | @code{environment:immutable-binding} error. However, | |
224 | notice that the set of bindings in @var{imp} may still change, | |
225 | if one of its imported environments changes. | |
226 | @end deffn | |
227 | ||
8f85c0c6 NJ |
228 | @deffn {Scheme Procedure} import-environment? object |
229 | @deffnx {C Function} scm_import_environment_p (object) | |
a0e07ba4 NJ |
230 | Return @code{#t} if object is an import environment, or |
231 | @code{#f} otherwise. | |
232 | @end deffn | |
233 | ||
8f85c0c6 NJ |
234 | @deffn {Scheme Procedure} import-environment-imports env |
235 | @deffnx {C Function} scm_import_environment_imports (env) | |
a0e07ba4 NJ |
236 | Return the list of environments imported by the import |
237 | environment @var{env}. | |
238 | @end deffn | |
239 | ||
8f85c0c6 NJ |
240 | @deffn {Scheme Procedure} import-environment-set-imports! env imports |
241 | @deffnx {C Function} scm_import_environment_set_imports_x (env, imports) | |
a0e07ba4 NJ |
242 | Change @var{env}'s list of imported environments to |
243 | @var{imports}, and check for conflicts. | |
244 | @end deffn | |
245 | ||
8f85c0c6 NJ |
246 | @deffn {Scheme Procedure} make-export-environment private signature |
247 | @deffnx {C Function} scm_make_export_environment (private, signature) | |
a0e07ba4 NJ |
248 | Return a new environment @var{exp} containing only those |
249 | bindings in private whose symbols are present in | |
250 | @var{signature}. The @var{private} argument must be an | |
251 | environment. | |
252 | ||
253 | The environment @var{exp} binds symbol to location when | |
254 | @var{env} does, and symbol is exported by @var{signature}. | |
255 | ||
256 | @var{signature} is a list specifying which of the bindings in | |
257 | @var{private} should be visible in @var{exp}. Each element of | |
258 | @var{signature} should be a list of the form: | |
259 | (symbol attribute ...) | |
260 | where each attribute is one of the following: | |
261 | @table @asis | |
262 | @item the symbol @code{mutable-location} | |
263 | @var{exp} should treat the | |
264 | location bound to symbol as mutable. That is, @var{exp} | |
265 | will pass calls to @code{environment-set!} or | |
266 | @code{environment-cell} directly through to private. | |
267 | @item the symbol @code{immutable-location} | |
268 | @var{exp} should treat | |
269 | the location bound to symbol as immutable. If the program | |
270 | applies @code{environment-set!} to @var{exp} and symbol, or | |
271 | calls @code{environment-cell} to obtain a writable value | |
272 | cell, @code{environment-set!} will signal an | |
273 | @code{environment:immutable-location} error. Note that, even | |
274 | if an export environment treats a location as immutable, the | |
275 | underlying environment may treat it as mutable, so its | |
276 | value may change. | |
277 | @end table | |
278 | It is an error for an element of signature to specify both | |
279 | @code{mutable-location} and @code{immutable-location}. If | |
280 | neither is specified, @code{immutable-location} is assumed. | |
281 | ||
282 | As a special case, if an element of signature is a lone | |
283 | symbol @var{sym}, it is equivalent to an element of the form | |
284 | @code{(sym)}. | |
285 | ||
286 | All bindings in @var{exp} are immutable. If you apply | |
287 | @code{environment-define} or @code{environment-undefine} to | |
288 | @var{exp}, Guile will signal an | |
289 | @code{environment:immutable-binding} error. However, | |
290 | notice that the set of bindings in @var{exp} may still change, | |
291 | if the bindings in private change. | |
292 | @end deffn | |
293 | ||
8f85c0c6 NJ |
294 | @deffn {Scheme Procedure} export-environment? object |
295 | @deffnx {C Function} scm_export_environment_p (object) | |
a0e07ba4 NJ |
296 | Return @code{#t} if object is an export environment, or |
297 | @code{#f} otherwise. | |
298 | @end deffn | |
299 | ||
8f85c0c6 NJ |
300 | @deffn {Scheme Procedure} export-environment-private env |
301 | @deffnx {C Function} scm_export_environment_private (env) | |
a0e07ba4 NJ |
302 | Return the private environment of export environment @var{env}. |
303 | @end deffn | |
304 | ||
8f85c0c6 NJ |
305 | @deffn {Scheme Procedure} export-environment-set-private! env private |
306 | @deffnx {C Function} scm_export_environment_set_private_x (env, private) | |
a0e07ba4 NJ |
307 | Change the private environment of export environment @var{env}. |
308 | @end deffn | |
309 | ||
8f85c0c6 NJ |
310 | @deffn {Scheme Procedure} export-environment-signature env |
311 | @deffnx {C Function} scm_export_environment_signature (env) | |
a0e07ba4 NJ |
312 | Return the signature of export environment @var{env}. |
313 | @end deffn | |
314 | ||
8f85c0c6 NJ |
315 | @deffn {Scheme Procedure} export-environment-set-signature! env signature |
316 | @deffnx {C Function} scm_export_environment_set_signature_x (env, signature) | |
a0e07ba4 NJ |
317 | Change the signature of export environment @var{env}. |
318 | @end deffn | |
319 | ||
8f85c0c6 NJ |
320 | @deffn {Scheme Procedure} %compute-slots class |
321 | @deffnx {C Function} scm_sys_compute_slots (class) | |
a0e07ba4 NJ |
322 | Return a list consisting of the names of all slots belonging to |
323 | class @var{class}, i. e. the slots of @var{class} and of all of | |
198586ed | 324 | its superclasses. |
a0e07ba4 NJ |
325 | @end deffn |
326 | ||
8f85c0c6 NJ |
327 | @deffn {Scheme Procedure} get-keyword key l default_value |
328 | @deffnx {C Function} scm_get_keyword (key, l, default_value) | |
a0e07ba4 NJ |
329 | Determine an associated value for the keyword @var{key} from |
330 | the list @var{l}. The list @var{l} has to consist of an even | |
331 | number of elements, where, starting with the first, every | |
332 | second element is a keyword, followed by its associated value. | |
333 | If @var{l} does not hold a value for @var{key}, the value | |
334 | @var{default_value} is returned. | |
335 | @end deffn | |
336 | ||
8f85c0c6 NJ |
337 | @deffn {Scheme Procedure} slot-ref-using-class class obj slot_name |
338 | @deffnx {C Function} scm_slot_ref_using_class (class, obj, slot_name) | |
9401323e | 339 | |
a0e07ba4 NJ |
340 | @end deffn |
341 | ||
8f85c0c6 NJ |
342 | @deffn {Scheme Procedure} slot-set-using-class! class obj slot_name value |
343 | @deffnx {C Function} scm_slot_set_using_class_x (class, obj, slot_name, value) | |
9401323e | 344 | |
a0e07ba4 NJ |
345 | @end deffn |
346 | ||
8f85c0c6 NJ |
347 | @deffn {Scheme Procedure} class-of x |
348 | @deffnx {C Function} scm_class_of (x) | |
a0e07ba4 NJ |
349 | Return the class of @var{x}. |
350 | @end deffn | |
351 | ||
8f85c0c6 NJ |
352 | @deffn {Scheme Procedure} %goops-loaded |
353 | @deffnx {C Function} scm_sys_goops_loaded () | |
a0e07ba4 NJ |
354 | Announce that GOOPS is loaded and perform initialization |
355 | on the C level which depends on the loaded GOOPS modules. | |
356 | @end deffn | |
357 | ||
8f85c0c6 NJ |
358 | @deffn {Scheme Procedure} %method-more-specific? m1 m2 targs |
359 | @deffnx {C Function} scm_sys_method_more_specific_p (m1, m2, targs) | |
9401323e | 360 | |
a0e07ba4 NJ |
361 | @end deffn |
362 | ||
8f85c0c6 NJ |
363 | @deffn {Scheme Procedure} find-method . l |
364 | @deffnx {C Function} scm_find_method (l) | |
9401323e | 365 | |
a0e07ba4 NJ |
366 | @end deffn |
367 | ||
8f85c0c6 NJ |
368 | @deffn {Scheme Procedure} primitive-generic-generic subr |
369 | @deffnx {C Function} scm_primitive_generic_generic (subr) | |
9401323e | 370 | |
a0e07ba4 NJ |
371 | @end deffn |
372 | ||
8f85c0c6 NJ |
373 | @deffn {Scheme Procedure} enable-primitive-generic! . subrs |
374 | @deffnx {C Function} scm_enable_primitive_generic_x (subrs) | |
9401323e | 375 | |
a0e07ba4 NJ |
376 | @end deffn |
377 | ||
8f85c0c6 NJ |
378 | @deffn {Scheme Procedure} generic-capability? proc |
379 | @deffnx {C Function} scm_generic_capability_p (proc) | |
9401323e | 380 | |
a0e07ba4 NJ |
381 | @end deffn |
382 | ||
8f85c0c6 NJ |
383 | @deffn {Scheme Procedure} %invalidate-method-cache! gf |
384 | @deffnx {C Function} scm_sys_invalidate_method_cache_x (gf) | |
9401323e | 385 | |
a0e07ba4 NJ |
386 | @end deffn |
387 | ||
8f85c0c6 NJ |
388 | @deffn {Scheme Procedure} %invalidate-class class |
389 | @deffnx {C Function} scm_sys_invalidate_class (class) | |
9401323e | 390 | |
a0e07ba4 NJ |
391 | @end deffn |
392 | ||
8f85c0c6 NJ |
393 | @deffn {Scheme Procedure} %modify-class old new |
394 | @deffnx {C Function} scm_sys_modify_class (old, new) | |
9401323e | 395 | |
a0e07ba4 NJ |
396 | @end deffn |
397 | ||
8f85c0c6 NJ |
398 | @deffn {Scheme Procedure} %modify-instance old new |
399 | @deffnx {C Function} scm_sys_modify_instance (old, new) | |
9401323e | 400 | |
a0e07ba4 NJ |
401 | @end deffn |
402 | ||
8f85c0c6 NJ |
403 | @deffn {Scheme Procedure} %set-object-setter! obj setter |
404 | @deffnx {C Function} scm_sys_set_object_setter_x (obj, setter) | |
9401323e | 405 | |
a0e07ba4 NJ |
406 | @end deffn |
407 | ||
8f85c0c6 NJ |
408 | @deffn {Scheme Procedure} %allocate-instance class initargs |
409 | @deffnx {C Function} scm_sys_allocate_instance (class, initargs) | |
a0e07ba4 NJ |
410 | Create a new instance of class @var{class} and initialize it |
411 | from the arguments @var{initargs}. | |
412 | @end deffn | |
413 | ||
8f85c0c6 | 414 | @deffn {Scheme Procedure} slot-exists? obj slot_name |
46732b54 | 415 | @deffnx {C Function} scm_slot_exists_p (obj, slot_name) |
a0e07ba4 NJ |
416 | Return @code{#t} if @var{obj} has a slot named @var{slot_name}. |
417 | @end deffn | |
418 | ||
8f85c0c6 NJ |
419 | @deffn {Scheme Procedure} slot-bound? obj slot_name |
420 | @deffnx {C Function} scm_slot_bound_p (obj, slot_name) | |
a0e07ba4 NJ |
421 | Return @code{#t} if the slot named @var{slot_name} of @var{obj} |
422 | is bound. | |
423 | @end deffn | |
424 | ||
8f85c0c6 NJ |
425 | @deffn {Scheme Procedure} slot-set! obj slot_name value |
426 | @deffnx {C Function} scm_slot_set_x (obj, slot_name, value) | |
a0e07ba4 NJ |
427 | Set the slot named @var{slot_name} of @var{obj} to @var{value}. |
428 | @end deffn | |
429 | ||
8f85c0c6 NJ |
430 | @deffn {Scheme Procedure} slot-exists-using-class? class obj slot_name |
431 | @deffnx {C Function} scm_slot_exists_using_class_p (class, obj, slot_name) | |
9401323e | 432 | |
a0e07ba4 NJ |
433 | @end deffn |
434 | ||
8f85c0c6 NJ |
435 | @deffn {Scheme Procedure} slot-bound-using-class? class obj slot_name |
436 | @deffnx {C Function} scm_slot_bound_using_class_p (class, obj, slot_name) | |
9401323e | 437 | |
a0e07ba4 NJ |
438 | @end deffn |
439 | ||
8f85c0c6 NJ |
440 | @deffn {Scheme Procedure} %fast-slot-set! obj index value |
441 | @deffnx {C Function} scm_sys_fast_slot_set_x (obj, index, value) | |
a0e07ba4 NJ |
442 | Set the slot with index @var{index} in @var{obj} to |
443 | @var{value}. | |
444 | @end deffn | |
445 | ||
8f85c0c6 NJ |
446 | @deffn {Scheme Procedure} %fast-slot-ref obj index |
447 | @deffnx {C Function} scm_sys_fast_slot_ref (obj, index) | |
a0e07ba4 NJ |
448 | Return the slot value with index @var{index} from @var{obj}. |
449 | @end deffn | |
450 | ||
8f85c0c6 NJ |
451 | @deffn {Scheme Procedure} @@assert-bound-ref obj index |
452 | @deffnx {C Function} scm_at_assert_bound_ref (obj, index) | |
a0e07ba4 NJ |
453 | Like @code{assert-bound}, but use @var{index} for accessing |
454 | the value from @var{obj}. | |
455 | @end deffn | |
456 | ||
8f85c0c6 NJ |
457 | @deffn {Scheme Procedure} assert-bound value obj |
458 | @deffnx {C Function} scm_assert_bound (value, obj) | |
a0e07ba4 NJ |
459 | Return @var{value} if it is bound, and invoke the |
460 | @var{slot-unbound} method of @var{obj} if it is not. | |
461 | @end deffn | |
462 | ||
8f85c0c6 NJ |
463 | @deffn {Scheme Procedure} unbound? obj |
464 | @deffnx {C Function} scm_unbound_p (obj) | |
a0e07ba4 NJ |
465 | Return @code{#t} if @var{obj} is unbound. |
466 | @end deffn | |
467 | ||
8f85c0c6 NJ |
468 | @deffn {Scheme Procedure} make-unbound |
469 | @deffnx {C Function} scm_make_unbound () | |
a0e07ba4 NJ |
470 | Return the unbound value. |
471 | @end deffn | |
472 | ||
8f85c0c6 NJ |
473 | @deffn {Scheme Procedure} accessor-method-slot-definition obj |
474 | @deffnx {C Function} scm_accessor_method_slot_definition (obj) | |
a0e07ba4 NJ |
475 | Return the slot definition of the accessor @var{obj}. |
476 | @end deffn | |
477 | ||
8f85c0c6 NJ |
478 | @deffn {Scheme Procedure} method-procedure obj |
479 | @deffnx {C Function} scm_method_procedure (obj) | |
a0e07ba4 NJ |
480 | Return the procedure of the method @var{obj}. |
481 | @end deffn | |
482 | ||
8f85c0c6 NJ |
483 | @deffn {Scheme Procedure} method-specializers obj |
484 | @deffnx {C Function} scm_method_specializers (obj) | |
a0e07ba4 NJ |
485 | Return specializers of the method @var{obj}. |
486 | @end deffn | |
487 | ||
8f85c0c6 NJ |
488 | @deffn {Scheme Procedure} method-generic-function obj |
489 | @deffnx {C Function} scm_method_generic_function (obj) | |
85a9b4ed | 490 | Return the generic function for the method @var{obj}. |
a0e07ba4 NJ |
491 | @end deffn |
492 | ||
8f85c0c6 NJ |
493 | @deffn {Scheme Procedure} generic-function-methods obj |
494 | @deffnx {C Function} scm_generic_function_methods (obj) | |
a0e07ba4 NJ |
495 | Return the methods of the generic function @var{obj}. |
496 | @end deffn | |
497 | ||
8f85c0c6 NJ |
498 | @deffn {Scheme Procedure} generic-function-name obj |
499 | @deffnx {C Function} scm_generic_function_name (obj) | |
a0e07ba4 NJ |
500 | Return the name of the generic function @var{obj}. |
501 | @end deffn | |
502 | ||
8f85c0c6 NJ |
503 | @deffn {Scheme Procedure} class-environment obj |
504 | @deffnx {C Function} scm_class_environment (obj) | |
a0e07ba4 NJ |
505 | Return the environment of the class @var{obj}. |
506 | @end deffn | |
507 | ||
8f85c0c6 NJ |
508 | @deffn {Scheme Procedure} class-slots obj |
509 | @deffnx {C Function} scm_class_slots (obj) | |
a0e07ba4 NJ |
510 | Return the slot list of the class @var{obj}. |
511 | @end deffn | |
512 | ||
8f85c0c6 NJ |
513 | @deffn {Scheme Procedure} class-precedence-list obj |
514 | @deffnx {C Function} scm_class_precedence_list (obj) | |
a0e07ba4 NJ |
515 | Return the class precedence list of the class @var{obj}. |
516 | @end deffn | |
517 | ||
8f85c0c6 NJ |
518 | @deffn {Scheme Procedure} class-direct-methods obj |
519 | @deffnx {C Function} scm_class_direct_methods (obj) | |
a0e07ba4 NJ |
520 | Return the direct methods of the class @var{obj} |
521 | @end deffn | |
522 | ||
8f85c0c6 NJ |
523 | @deffn {Scheme Procedure} class-direct-subclasses obj |
524 | @deffnx {C Function} scm_class_direct_subclasses (obj) | |
a0e07ba4 NJ |
525 | Return the direct subclasses of the class @var{obj}. |
526 | @end deffn | |
527 | ||
8f85c0c6 NJ |
528 | @deffn {Scheme Procedure} class-direct-slots obj |
529 | @deffnx {C Function} scm_class_direct_slots (obj) | |
a0e07ba4 NJ |
530 | Return the direct slots of the class @var{obj}. |
531 | @end deffn | |
532 | ||
8f85c0c6 NJ |
533 | @deffn {Scheme Procedure} class-direct-supers obj |
534 | @deffnx {C Function} scm_class_direct_supers (obj) | |
198586ed | 535 | Return the direct superclasses of the class @var{obj}. |
a0e07ba4 NJ |
536 | @end deffn |
537 | ||
8f85c0c6 NJ |
538 | @deffn {Scheme Procedure} class-name obj |
539 | @deffnx {C Function} scm_class_name (obj) | |
a0e07ba4 NJ |
540 | Return the class name of @var{obj}. |
541 | @end deffn | |
542 | ||
8f85c0c6 NJ |
543 | @deffn {Scheme Procedure} instance? obj |
544 | @deffnx {C Function} scm_instance_p (obj) | |
a0e07ba4 NJ |
545 | Return @code{#t} if @var{obj} is an instance. |
546 | @end deffn | |
547 | ||
8f85c0c6 NJ |
548 | @deffn {Scheme Procedure} %inherit-magic! class dsupers |
549 | @deffnx {C Function} scm_sys_inherit_magic_x (class, dsupers) | |
9401323e | 550 | |
a0e07ba4 NJ |
551 | @end deffn |
552 | ||
8f85c0c6 NJ |
553 | @deffn {Scheme Procedure} %prep-layout! class |
554 | @deffnx {C Function} scm_sys_prep_layout_x (class) | |
9401323e | 555 | |
a0e07ba4 NJ |
556 | @end deffn |
557 | ||
8f85c0c6 NJ |
558 | @deffn {Scheme Procedure} %initialize-object obj initargs |
559 | @deffnx {C Function} scm_sys_initialize_object (obj, initargs) | |
a0e07ba4 NJ |
560 | Initialize the object @var{obj} with the given arguments |
561 | @var{initargs}. | |
562 | @end deffn | |
563 | ||
8f85c0c6 NJ |
564 | @deffn {Scheme Procedure} make . args |
565 | @deffnx {C Function} scm_make (args) | |
a0e07ba4 NJ |
566 | Make a new object. @var{args} must contain the class and |
567 | all necessary initialization information. | |
568 | @end deffn | |
569 | ||
8f85c0c6 NJ |
570 | @deffn {Scheme Procedure} slot-ref obj slot_name |
571 | @deffnx {C Function} scm_slot_ref (obj, slot_name) | |
a0e07ba4 NJ |
572 | Return the value from @var{obj}'s slot with the name |
573 | @var{slot_name}. | |
574 | @end deffn | |
575 | ||
8f85c0c6 NJ |
576 | @deffn {Scheme Procedure} %tag-body body |
577 | @deffnx {C Function} scm_sys_tag_body (body) | |
a0e07ba4 NJ |
578 | Internal GOOPS magic---don't use this function! |
579 | @end deffn | |
580 | ||
8f85c0c6 | 581 | @deffn {Scheme Procedure} list* |
72dd0a03 | 582 | implemented by the C function "scm_cons_star" |
a0e07ba4 NJ |
583 | @end deffn |
584 | ||
8f85c0c6 NJ |
585 | @deffn {Scheme Procedure} set-current-module module |
586 | @deffnx {C Function} scm_set_current_module (module) | |
a0e07ba4 NJ |
587 | Set the current module to @var{module} and return |
588 | the previous current module. | |
589 | @end deffn | |
590 | ||
8f85c0c6 NJ |
591 | @deffn {Scheme Procedure} current-module |
592 | @deffnx {C Function} scm_current_module () | |
a0e07ba4 NJ |
593 | Return the current module. |
594 | @end deffn | |
595 | ||
8f85c0c6 | 596 | @deffn {Scheme Procedure} c-clear-registered-modules |
a0e07ba4 NJ |
597 | Destroy the list of modules registered with the current Guile process. |
598 | The return value is unspecified. @strong{Warning:} this function does | |
599 | not actually unlink or deallocate these modules, but only destroys the | |
600 | records of which modules have been loaded. It should therefore be used | |
601 | only by module bookkeeping operations. | |
602 | @end deffn | |
603 | ||
8f85c0c6 | 604 | @deffn {Scheme Procedure} c-registered-modules |
a0e07ba4 NJ |
605 | Return a list of the object code modules that have been imported into |
606 | the current Guile process. Each element of the list is a pair whose | |
607 | car is the name of the module, and whose cdr is the function handle | |
608 | for that module's initializer function. The name is the string that | |
609 | has been passed to scm_register_module_xxx. | |
610 | @end deffn | |
611 | ||
8f85c0c6 | 612 | @deffn {Scheme Procedure} include-deprecated-features |
a0e07ba4 NJ |
613 | Return @code{#t} iff deprecated features should be included |
614 | in public interfaces. | |
615 | @end deffn | |
616 | ||
8f85c0c6 | 617 | @deffn {Scheme Procedure} issue-deprecation-warning . msgs |
a0e07ba4 NJ |
618 | Output @var{msgs} to @code{(current-error-port)} when this |
619 | is the first call to @code{issue-deprecation-warning} with | |
620 | this specific @var{msg}. Do nothing otherwise. | |
621 | The argument @var{msgs} should be a list of strings; | |
622 | they are printed in turn, each one followed by a newline. | |
623 | @end deffn | |
9401323e | 624 | |
8f85c0c6 NJ |
625 | @deffn {Scheme Procedure} valid-object-procedure? proc |
626 | @deffnx {C Function} scm_valid_object_procedure_p (proc) | |
9401323e NJ |
627 | Return @code{#t} iff @var{proc} is a procedure that can be used with @code{set-object-procedure}. It is always valid to use a closure constructed by @code{lambda}. |
628 | @end deffn | |
629 | ||
8f85c0c6 NJ |
630 | @deffn {Scheme Procedure} %get-pre-modules-obarray |
631 | @deffnx {C Function} scm_get_pre_modules_obarray () | |
9401323e NJ |
632 | Return the obarray that is used for all new bindings before the module system is booted. The first call to @code{set-current-module} will boot the module system. |
633 | @end deffn | |
634 | ||
8f85c0c6 NJ |
635 | @deffn {Scheme Procedure} standard-interface-eval-closure module |
636 | @deffnx {C Function} scm_standard_interface_eval_closure (module) | |
9401323e NJ |
637 | Return a interface eval closure for the module @var{module}. Such a closure does not allow new bindings to be added. |
638 | @end deffn | |
639 | ||
8f85c0c6 NJ |
640 | @deffn {Scheme Procedure} env-module env |
641 | @deffnx {C Function} scm_env_module (env) | |
9401323e NJ |
642 | Return the module of @var{ENV}, a lexical environment. |
643 | @end deffn | |
644 | ||
8f85c0c6 NJ |
645 | @deffn {Scheme Procedure} load-extension lib init |
646 | @deffnx {C Function} scm_load_extension (lib, init) | |
72dd0a03 | 647 | Load and initialize the extension designated by LIB and INIT. |
9401323e NJ |
648 | When there is no pre-registered function for LIB/INIT, this is |
649 | equivalent to | |
650 | ||
651 | @lisp | |
652 | (dynamic-call INIT (dynamic-link LIB)) | |
653 | @end lisp | |
654 | ||
655 | When there is a pre-registered function, that function is called | |
656 | instead. | |
657 | ||
658 | Normally, there is no pre-registered function. This option exists | |
659 | only for situations where dynamic linking is unavailable or unwanted. | |
660 | In that case, you would statically link your program with the desired | |
661 | library, and register its init function right after Guile has been | |
662 | initialized. | |
663 | ||
664 | LIB should be a string denoting a shared library without any file type | |
665 | suffix such as ".so". The suffix is provided automatically. It | |
666 | should also not contain any directory components. Libraries that | |
667 | implement Guile Extensions should be put into the normal locations for | |
668 | shared libraries. We recommend to use the naming convention | |
669 | libguile-bla-blum for a extension related to a module `(bla blum)'. | |
670 | ||
671 | The normal way for a extension to be used is to write a small Scheme | |
672 | file that defines a module, and to load the extension into this | |
673 | module. When the module is auto-loaded, the extension is loaded as | |
674 | well. For example, | |
675 | ||
676 | @lisp | |
677 | (define-module (bla blum)) | |
678 | ||
679 | (load-extension "libguile-bla-blum" "bla_init_blum") | |
680 | @end lisp | |
681 | @end deffn | |
21b83aab NJ |
682 | |
683 | @deffn {Scheme Procedure} single-active-thread? | |
684 | implemented by the C function "scm_single_thread_p" | |
685 | @end deffn | |
686 | ||
687 | @deffn {Scheme Procedure} object-address obj | |
688 | @deffnx {C Function} scm_object_address (obj) | |
689 | Return an integer that for the lifetime of @var{obj} is uniquely | |
690 | returned by this function for @var{obj} | |
691 | @end deffn | |
46732b54 GH |
692 | |
693 | @deffn {Scheme Procedure} nan | |
694 | @deffnx {C Function} scm_nan () | |
695 | Return NaN. | |
696 | @end deffn | |
697 | ||
698 | @deffn {Scheme Procedure} inf | |
699 | @deffnx {C Function} scm_inf () | |
700 | Return Inf. | |
701 | @end deffn | |
f631e15e GH |
702 | |
703 | @deffn {Scheme Procedure} set-debug-cell-accesses! flag | |
704 | @deffnx {C Function} scm_set_debug_cell_accesses_x (flag) | |
705 | This function is used to turn on checking for a debug version of GUILE. This version does not support this functionality | |
706 | ||
707 | @end deffn |