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