Commit | Line | Data |
---|---|---|
07d83abe MV |
1 | @c -*-texinfo-*- |
2 | @c This is part of the GNU Guile Reference Manual. | |
3 | @c Copyright (C) 1996, 1997, 2000, 2001, 2002, 2003, 2004 | |
4 | @c Free Software Foundation, Inc. | |
5 | @c See the file guile.texi for copying conditions. | |
6 | ||
7 | @page | |
8 | @node Read/Load/Eval | |
9 | @section Reading and Evaluating Scheme Code | |
10 | ||
11 | This chapter describes Guile functions that are concerned with reading, | |
12 | loading and evaluating Scheme code at run time. | |
13 | ||
14 | @menu | |
15 | * Scheme Syntax:: Standard and extended Scheme syntax. | |
16 | * Scheme Read:: Reading Scheme code. | |
17 | * Fly Evaluation:: Procedures for on the fly evaluation. | |
18 | * Loading:: Loading Scheme code from file. | |
19 | * Delayed Evaluation:: Postponing evaluation until it is needed. | |
20 | * Local Evaluation:: Evaluation in a local environment. | |
21 | * Evaluator Behaviour:: Modifying Guile's evaluator. | |
22 | @end menu | |
23 | ||
24 | ||
25 | @node Scheme Syntax | |
26 | @subsection Scheme Syntax: Standard and Guile Extensions | |
27 | ||
28 | @menu | |
29 | * Expression Syntax:: | |
30 | * Comments:: | |
31 | * Block Comments:: | |
32 | * Case Sensitivity:: | |
33 | * Keyword Syntax:: | |
34 | * Reader Extensions:: | |
35 | @end menu | |
36 | ||
37 | ||
38 | @node Expression Syntax | |
39 | @subsubsection Expression Syntax | |
40 | ||
41 | An expression to be evaluated takes one of the following forms. | |
42 | ||
43 | @table @nicode | |
44 | ||
45 | @item @var{symbol} | |
46 | A symbol is evaluated by dereferencing. A binding of that symbol is | |
47 | sought and the value there used. For example, | |
48 | ||
49 | @example | |
50 | (define x 123) | |
51 | x @result{} 123 | |
52 | @end example | |
53 | ||
54 | @item (@var{proc} @var{args}@dots{}) | |
55 | A parenthesised expression is a function call. @var{proc} and each | |
56 | argument are evaluated, then the function (which @var{proc} evaluated | |
57 | to) is called with those arguments. | |
58 | ||
59 | The order in which @var{proc} and the arguments are evaluated is | |
60 | unspecified, so be careful when using expressions with side effects. | |
61 | ||
62 | @example | |
63 | (max 1 2 3) @result{} 3 | |
64 | ||
65 | (define (get-some-proc) min) | |
66 | ((get-some-proc) 1 2 3) @result{} 1 | |
67 | @end example | |
68 | ||
69 | The same sort of parenthesised form is used for a macro invocation, | |
70 | but in that case the arguments are not evaluated. See the | |
71 | descriptions of macros for more on this (@pxref{Macros}, and | |
72 | @pxref{Syntax Rules}). | |
73 | ||
74 | @item @var{constant} | |
75 | Number, string, character and boolean constants evaluate ``to | |
76 | themselves'', so can appear as literals. | |
77 | ||
78 | @example | |
79 | 123 @result{} 123 | |
80 | 99.9 @result{} 99.9 | |
81 | "hello" @result{} "hello" | |
82 | #\z @result{} #\z | |
83 | #t @result{} #t | |
84 | @end example | |
85 | ||
86 | Note that an application must not attempt to modify literal strings, | |
87 | since they may be in read-only memory. | |
88 | ||
89 | @item (quote @var{data}) | |
90 | @itemx '@var{data} | |
91 | @findex quote | |
92 | @findex ' | |
93 | Quoting is used to obtain a literal symbol (instead of a variable | |
94 | reference), a literal list (instead of a function call), or a literal | |
95 | vector. @nicode{'} is simply a shorthand for a @code{quote} form. | |
96 | For example, | |
97 | ||
98 | @example | |
99 | 'x @result{} x | |
100 | '(1 2 3) @result{} (1 2 3) | |
101 | '#(1 (2 3) 4) @result{} #(1 (2 3) 4) | |
102 | (quote x) @result{} x | |
103 | (quote (1 2 3)) @result{} (1 2 3) | |
104 | (quote #(1 (2 3) 4)) @result{} #(1 (2 3) 4) | |
105 | @end example | |
106 | ||
107 | Note that an application must not attempt to modify literal lists or | |
108 | vectors obtained from a @code{quote} form, since they may be in | |
109 | read-only memory. | |
110 | ||
111 | @item (quasiquote @var{data}) | |
112 | @itemx `@var{data} | |
113 | @findex quasiquote | |
114 | @findex ` | |
115 | Backquote quasi-quotation is like @code{quote}, but selected | |
116 | sub-expressions are evaluated. This is a convenient way to construct | |
117 | a list or vector structure most of which is constant, but at certain | |
118 | points should have expressions substituted. | |
119 | ||
120 | The same effect can always be had with suitable @code{list}, | |
121 | @code{cons} or @code{vector} calls, but quasi-quoting is often easier. | |
122 | ||
123 | @table @nicode | |
124 | ||
125 | @item (unquote @var{expr}) | |
126 | @itemx ,@var{expr} | |
127 | @findex unquote | |
128 | @findex , | |
129 | Within the quasiquote @var{data}, @code{unquote} or @code{,} indicates | |
130 | an expression to be evaluated and inserted. The comma syntax @code{,} | |
131 | is simply a shorthand for an @code{unquote} form. For example, | |
132 | ||
133 | @example | |
134 | `(1 2 ,(* 9 9) 3 4) @result{} (1 2 81 3 4) | |
135 | `(1 (unquote (+ 1 1)) 3) @result{} (1 2 3) | |
136 | `#(1 ,(/ 12 2)) @result{} #(1 6) | |
137 | @end example | |
138 | ||
139 | @item (unquote-splicing @var{expr}) | |
140 | @itemx ,@@@var{expr} | |
141 | @findex unquote-splicing | |
142 | @findex ,@@ | |
143 | Within the quasiquote @var{data}, @code{unquote-splicing} or | |
144 | @code{,@@} indicates an expression to be evaluated and the elements of | |
145 | the returned list inserted. @var{expr} must evaluate to a list. The | |
146 | ``comma-at'' syntax @code{,@@} is simply a shorthand for an | |
147 | @code{unquote-splicing} form. | |
148 | ||
149 | @example | |
150 | (define x '(2 3)) | |
151 | `(1 ,@@x 4) @result{} (1 2 3 4) | |
152 | `(1 (unquote-splicing (map 1+ x))) @result{} (1 3 4) | |
153 | `#(9 ,@@x 9) @result{} #(9 2 3 9) | |
154 | @end example | |
155 | ||
156 | Notice @code{,@@} differs from plain @code{,} in the way one level of | |
157 | nesting is stripped. For @code{,@@} the elements of a returned list | |
158 | are inserted, whereas with @code{,} it would be the list itself | |
159 | inserted. | |
160 | @end table | |
161 | ||
162 | @c | |
163 | @c FIXME: What can we say about the mutability of a quasiquote | |
164 | @c result? R5RS doesn't seem to specify anything, though where it | |
165 | @c says backquote without commas is the same as plain quote then | |
166 | @c presumably the "fixed" portions of a quasiquote expression must be | |
167 | @c treated as immutable. | |
168 | @c | |
169 | ||
170 | @end table | |
171 | ||
172 | ||
173 | @node Comments | |
174 | @subsubsection Comments | |
175 | ||
176 | @c FIXME::martin: Review me! | |
177 | ||
178 | Comments in Scheme source files are written by starting them with a | |
179 | semicolon character (@code{;}). The comment then reaches up to the end | |
180 | of the line. Comments can begin at any column, and the may be inserted | |
181 | on the same line as Scheme code. | |
182 | ||
183 | @lisp | |
184 | ; Comment | |
185 | ;; Comment too | |
186 | (define x 1) ; Comment after expression | |
187 | (let ((y 1)) | |
188 | ;; Display something. | |
189 | (display y) | |
190 | ;;; Comment at left margin. | |
191 | (display (+ y 1))) | |
192 | @end lisp | |
193 | ||
194 | It is common to use a single semicolon for comments following | |
195 | expressions on a line, to use two semicolons for comments which are | |
196 | indented like code, and three semicolons for comments which start at | |
197 | column 0, even if they are inside an indented code block. This | |
198 | convention is used when indenting code in Emacs' Scheme mode. | |
199 | ||
200 | ||
201 | @node Block Comments | |
202 | @subsubsection Block Comments | |
203 | ||
204 | @c FIXME::martin: Review me! | |
205 | ||
206 | @cindex multiline comments | |
207 | In addition to the standard line comments defined by R5RS, Guile has | |
208 | another comment type for multiline comments, called @dfn{block | |
209 | comments}. This type of comment begins with the character sequence | |
210 | @code{#!} and ends with the characters @code{!#}, which must appear on a | |
211 | line of their own. These comments are compatible with the block | |
212 | comments in the Scheme Shell @file{scsh} (@pxref{The Scheme shell | |
213 | (scsh)}). The characters @code{#!} were chosen because they are the | |
214 | magic characters used in shell scripts for indicating that the name of | |
215 | the program for executing the script follows on the same line. | |
216 | ||
217 | Thus a Guile script often starts like this. | |
218 | ||
219 | @lisp | |
220 | #! /usr/local/bin/guile -s | |
221 | !# | |
222 | @end lisp | |
223 | ||
224 | More details on Guile scripting can be found in the scripting section | |
225 | (@pxref{Guile Scripting}). | |
226 | ||
227 | ||
228 | @node Case Sensitivity | |
229 | @subsubsection Case Sensitivity | |
230 | ||
231 | @c FIXME::martin: Review me! | |
232 | ||
233 | Scheme as defined in R5RS is not case sensitive when reading symbols. | |
234 | Guile, on the contrary is case sensitive by default, so the identifiers | |
235 | ||
236 | @lisp | |
237 | guile-whuzzy | |
238 | Guile-Whuzzy | |
239 | @end lisp | |
240 | ||
241 | are the same in R5RS Scheme, but are different in Guile. | |
242 | ||
243 | It is possible to turn off case sensitivity in Guile by setting the | |
244 | reader option @code{case-insensitive}. More on reader options can be | |
245 | found at (@pxref{Reader options}). | |
246 | ||
247 | @lisp | |
248 | (read-enable 'case-insensitive) | |
249 | @end lisp | |
250 | ||
251 | Note that this is seldom a problem, because Scheme programmers tend not | |
252 | to use uppercase letters in their identifiers anyway. | |
253 | ||
254 | ||
255 | @node Keyword Syntax | |
256 | @subsubsection Keyword Syntax | |
257 | ||
258 | ||
259 | @node Reader Extensions | |
260 | @subsubsection Reader Extensions | |
261 | ||
262 | @deffn {Scheme Procedure} read-hash-extend chr proc | |
263 | @deffnx {C Function} scm_read_hash_extend (chr, proc) | |
264 | Install the procedure @var{proc} for reading expressions | |
265 | starting with the character sequence @code{#} and @var{chr}. | |
266 | @var{proc} will be called with two arguments: the character | |
267 | @var{chr} and the port to read further data from. The object | |
268 | returned will be the return value of @code{read}. | |
269 | @end deffn | |
270 | ||
271 | ||
272 | @node Scheme Read | |
273 | @subsection Reading Scheme Code | |
274 | ||
275 | @rnindex read | |
276 | @deffn {Scheme Procedure} read [port] | |
277 | @deffnx {C Function} scm_read (port) | |
278 | Read an s-expression from the input port @var{port}, or from | |
279 | the current input port if @var{port} is not specified. | |
280 | Any whitespace before the next token is discarded. | |
281 | @end deffn | |
282 | ||
283 | The behaviour of Guile's Scheme reader can be modified by manipulating | |
284 | its read options. For more information about options, @xref{User level | |
285 | options interfaces}. If you want to know which reader options are | |
286 | available, @xref{Reader options}. | |
287 | ||
288 | @c FIXME::martin: This is taken from libguile/options.c. Is there | |
289 | @c actually a difference between 'help and 'full? | |
290 | ||
291 | @deffn {Scheme Procedure} read-options [setting] | |
292 | Display the current settings of the read options. If @var{setting} is | |
293 | omitted, only a short form of the current read options is printed. | |
294 | Otherwise, @var{setting} should be one of the following symbols: | |
295 | @table @code | |
296 | @item help | |
297 | Display the complete option settings. | |
298 | @item full | |
299 | Like @code{help}, but also print programmer options. | |
300 | @end table | |
301 | @end deffn | |
302 | ||
303 | @deffn {Scheme Procedure} read-enable option-name | |
304 | @deffnx {Scheme Procedure} read-disable option-name | |
305 | @deffnx {Scheme Procedure} read-set! option-name value | |
306 | Modify the read options. @code{read-enable} should be used with boolean | |
307 | options and switches them on, @code{read-disable} switches them off. | |
308 | @code{read-set!} can be used to set an option to a specific value. | |
309 | @end deffn | |
310 | ||
311 | @deffn {Scheme Procedure} read-options-interface [setting] | |
312 | @deffnx {C Function} scm_read_options (setting) | |
313 | Option interface for the read options. Instead of using | |
314 | this procedure directly, use the procedures @code{read-enable}, | |
315 | @code{read-disable}, @code{read-set!} and @code{read-options}. | |
316 | @end deffn | |
317 | ||
318 | ||
319 | @node Fly Evaluation | |
320 | @subsection Procedures for On the Fly Evaluation | |
321 | ||
322 | @xref{Environments}. | |
323 | ||
324 | @rnindex eval | |
325 | @c ARGFIXME environment/environment specifier | |
326 | @deffn {Scheme Procedure} eval exp module | |
327 | @deffnx {C Function} scm_eval (exp, module) | |
328 | Evaluate @var{exp}, a list representing a Scheme expression, | |
329 | in the top-level environment specified by @var{module}. | |
330 | While @var{exp} is evaluated (using @code{primitive-eval}), | |
331 | @var{module} is made the current module. The current module | |
332 | is reset to its previous value when @var{eval} returns. | |
333 | @end deffn | |
334 | ||
335 | @rnindex interaction-environment | |
336 | @deffn {Scheme Procedure} interaction-environment | |
337 | @deffnx {C Function} scm_interaction_environment () | |
338 | Return a specifier for the environment that contains | |
339 | implementation--defined bindings, typically a superset of those | |
340 | listed in the report. The intent is that this procedure will | |
341 | return the environment in which the implementation would | |
342 | evaluate expressions dynamically typed by the user. | |
343 | @end deffn | |
344 | ||
345 | @deffn {Scheme Procedure} eval-string string [module] | |
346 | @deffnx {C Function} scm_eval_string (string) | |
347 | @deffnx {C Function} scm_eval_string_in_module (string, module) | |
348 | Evaluate @var{string} as the text representation of a Scheme form or | |
349 | forms, and return whatever value they produce. Evaluation takes place | |
350 | in the given module, or in the current module when no module is given. | |
351 | While the code is evaluated, the given module is made the current one. | |
352 | The current module is restored when this procedure returns. | |
353 | @end deffn | |
354 | ||
355 | @deffn {Scheme Procedure} apply proc arg1 @dots{} argN arglst | |
356 | @deffnx {C Function} scm_apply_0 (proc, arglst) | |
357 | @deffnx {C Function} scm_apply_1 (proc, arg1, arglst) | |
358 | @deffnx {C Function} scm_apply_2 (proc, arg1, arg2, arglst) | |
359 | @deffnx {C Function} scm_apply_3 (proc, arg1, arg2, arg3, arglst) | |
360 | @deffnx {C Function} scm_apply (proc, arg, rest) | |
361 | @rnindex apply | |
362 | Call @var{proc} with arguments @var{arg1} @dots{} @var{argN} plus the | |
363 | elements of the @var{arglst} list. | |
364 | ||
365 | @code{scm_apply} takes parameters corresponding to a Scheme level | |
366 | @code{(lambda (proc arg . rest) ...)}. So @var{arg} and all but the | |
367 | last element of the @var{rest} list make up | |
368 | @var{arg1}@dots{}@var{argN} and the last element of @var{rest} is the | |
369 | @var{arglst} list. Or if @var{rest} is the empty list @code{SCM_EOL} | |
370 | then there's no @var{arg1}@dots{}@var{argN} and @var{arg} is the | |
371 | @var{arglst}. | |
372 | ||
373 | @var{arglst} is not modified, but the @var{rest} list passed to | |
374 | @code{scm_apply} is modified. | |
375 | @end deffn | |
376 | ||
377 | @deffn {C Function} scm_call_0 (proc) | |
378 | @deffnx {C Function} scm_call_1 (proc, arg1) | |
379 | @deffnx {C Function} scm_call_2 (proc, arg1, arg2) | |
380 | @deffnx {C Function} scm_call_3 (proc, arg1, arg2, arg3) | |
381 | Call @var{proc} with the given arguments. | |
382 | @end deffn | |
383 | ||
384 | @deffn {Scheme Procedure} apply:nconc2last lst | |
385 | @deffnx {C Function} scm_nconc2last (lst) | |
386 | @var{lst} should be a list (@var{arg1} @dots{} @var{argN} | |
387 | @var{arglst}), with @var{arglst} being a list. This function returns | |
388 | a list comprising @var{arg1} to @var{argN} plus the elements of | |
389 | @var{arglst}. @var{lst} is modified to form the return. @var{arglst} | |
390 | is not modified, though the return does share structure with it. | |
391 | ||
392 | This operation collects up the arguments from a list which is | |
393 | @code{apply} style parameters. | |
394 | @end deffn | |
395 | ||
396 | @deffn {Scheme Procedure} primitive-eval exp | |
397 | @deffnx {C Function} scm_primitive_eval (exp) | |
398 | Evaluate @var{exp} in the top-level environment specified by | |
399 | the current module. | |
400 | @end deffn | |
401 | ||
402 | ||
403 | @node Loading | |
404 | @subsection Loading Scheme Code from File | |
405 | ||
406 | @rnindex load | |
407 | @deffn {Scheme Procedure} load filename | |
408 | Load @var{filename} and evaluate its contents in the top-level | |
409 | environment. The load paths are not searched. If the variable | |
410 | @code{%load-hook} is defined, it should be bound to a procedure that | |
411 | will be called before any code is loaded. See documentation for | |
412 | @code{%load-hook} later in this section. | |
413 | @end deffn | |
414 | ||
415 | @deffn {Scheme Procedure} load-from-path filename | |
416 | Similar to @code{load}, but searches for @var{filename} in the load | |
417 | paths. | |
418 | @end deffn | |
419 | ||
420 | @deffn {Scheme Procedure} primitive-load filename | |
421 | @deffnx {C Function} scm_primitive_load (filename) | |
422 | Load the file named @var{filename} and evaluate its contents in | |
423 | the top-level environment. The load paths are not searched; | |
424 | @var{filename} must either be a full pathname or be a pathname | |
425 | relative to the current directory. If the variable | |
426 | @code{%load-hook} is defined, it should be bound to a procedure | |
427 | that will be called before any code is loaded. See the | |
428 | documentation for @code{%load-hook} later in this section. | |
429 | @end deffn | |
430 | ||
431 | @deffn {Scheme Procedure} primitive-load-path filename | |
432 | @deffnx {C Function} scm_primitive_load_path (filename) | |
433 | Search @var{%load-path} for the file named @var{filename} and | |
434 | load it into the top-level environment. If @var{filename} is a | |
435 | relative pathname and is not found in the list of search paths, | |
436 | an error is signalled. | |
437 | @end deffn | |
438 | ||
439 | @deffn {Scheme Procedure} %search-load-path filename | |
440 | @deffnx {C Function} scm_sys_search_load_path (filename) | |
441 | Search @var{%load-path} for the file named @var{filename}, | |
442 | which must be readable by the current user. If @var{filename} | |
443 | is found in the list of paths to search or is an absolute | |
444 | pathname, return its full pathname. Otherwise, return | |
445 | @code{#f}. Filenames may have any of the optional extensions | |
446 | in the @code{%load-extensions} list; @code{%search-load-path} | |
447 | will try each extension automatically. | |
448 | @end deffn | |
449 | ||
450 | @defvar %load-hook | |
451 | A procedure to be run whenever @code{primitive-load} is called. If this | |
452 | procedure is defined, it will be called with the filename argument that | |
453 | was passed to @code{primitive-load}. | |
454 | ||
455 | @example | |
456 | (define %load-hook (lambda (file) | |
457 | (display "Loading ") | |
458 | (display file) | |
459 | (write-line "...."))) @result{} undefined | |
460 | (load-from-path "foo.scm") | |
461 | @print{} Loading /usr/local/share/guile/site/foo.scm.... | |
462 | @end example | |
463 | ||
464 | @end defvar | |
465 | ||
466 | @deffn {Scheme Procedure} current-load-port | |
467 | @deffnx {C Function} scm_current_load_port () | |
468 | Return the current-load-port. | |
469 | The load port is used internally by @code{primitive-load}. | |
470 | @end deffn | |
471 | ||
472 | @defvar %load-extensions | |
473 | A list of default file extensions for files containing Scheme code. | |
474 | @code{%search-load-path} tries each of these extensions when looking for | |
475 | a file to load. By default, @code{%load-extensions} is bound to the | |
476 | list @code{("" ".scm")}. | |
477 | @end defvar | |
478 | ||
479 | ||
480 | @node Delayed Evaluation | |
481 | @subsection Delayed Evaluation | |
482 | @cindex delayed evaluation | |
483 | @cindex promises | |
484 | ||
485 | Promises are a convenient way to defer a calculation until its result | |
486 | is actually needed, and to run such a calculation only once. | |
487 | ||
488 | @deffn syntax delay expr | |
489 | @rnindex delay | |
490 | Return a promise object which holds the given @var{expr} expression, | |
491 | ready to be evaluated by a later @code{force}. | |
492 | @end deffn | |
493 | ||
494 | @deffn {Scheme Procedure} promise? obj | |
495 | @deffnx {C Function} scm_promise_p (obj) | |
496 | Return true if @var{obj} is a promise. | |
497 | @end deffn | |
498 | ||
499 | @rnindex force | |
500 | @deffn {Scheme Procedure} force p | |
501 | @deffnx {C Function} scm_force (p) | |
502 | Return the value obtained from evaluating the @var{expr} in the given | |
503 | promise @var{p}. If @var{p} has previously been forced then its | |
504 | @var{expr} is not evaluated again, instead the value obtained at that | |
505 | time is simply returned. | |
506 | ||
507 | During a @code{force}, an @var{expr} can call @code{force} again on | |
508 | its own promise, resulting in a recursive evaluation of that | |
509 | @var{expr}. The first evaluation to return gives the value for the | |
510 | promise. Higher evaluations run to completion in the normal way, but | |
511 | their results are ignored, @code{force} always returns the first | |
512 | value. | |
513 | @end deffn | |
514 | ||
515 | ||
516 | @node Local Evaluation | |
517 | @subsection Local Evaluation | |
518 | ||
519 | [the-environment] | |
520 | ||
521 | @deffn {Scheme Procedure} local-eval exp [env] | |
522 | @deffnx {C Function} scm_local_eval (exp, env) | |
523 | Evaluate @var{exp} in its environment. If @var{env} is supplied, | |
524 | it is the environment in which to evaluate @var{exp}. Otherwise, | |
525 | @var{exp} must be a memoized code object (in which case, its environment | |
526 | is implicit). | |
527 | @end deffn | |
528 | ||
529 | ||
530 | @node Evaluator Behaviour | |
531 | @subsection Evaluator Behaviour | |
532 | ||
533 | @c FIXME::martin: Maybe this node name is bad, but the old name clashed with | |
534 | @c `Evaluator options' under `Options and Config'. | |
535 | ||
536 | The behaviour of Guile's evaluator can be modified by manipulating the | |
537 | evaluator options. For more information about options, @xref{User level | |
538 | options interfaces}. If you want to know which evaluator options are | |
539 | available, @xref{Evaluator options}. | |
540 | ||
541 | @c FIXME::martin: This is taken from libguile/options.c. Is there | |
542 | @c actually a difference between 'help and 'full? | |
543 | ||
544 | @deffn {Scheme Procedure} eval-options [setting] | |
545 | Display the current settings of the evaluator options. If @var{setting} | |
546 | is omitted, only a short form of the current evaluator options is | |
547 | printed. Otherwise, @var{setting} should be one of the following | |
548 | symbols: | |
549 | @table @code | |
550 | @item help | |
551 | Display the complete option settings. | |
552 | @item full | |
553 | Like @code{help}, but also print programmer options. | |
554 | @end table | |
555 | @end deffn | |
556 | ||
557 | @deffn {Scheme Procedure} eval-enable option-name | |
558 | @deffnx {Scheme Procedure} eval-disable option-name | |
559 | @deffnx {Scheme Procedure} eval-set! option-name value | |
560 | Modify the evaluator options. @code{eval-enable} should be used with boolean | |
561 | options and switches them on, @code{eval-disable} switches them off. | |
562 | @code{eval-set!} can be used to set an option to a specific value. | |
563 | @end deffn | |
564 | ||
565 | @deffn {Scheme Procedure} eval-options-interface [setting] | |
566 | @deffnx {C Function} scm_eval_options_interface (setting) | |
567 | Option interface for the evaluation options. Instead of using | |
568 | this procedure directly, use the procedures @code{eval-enable}, | |
569 | @code{eval-disable}, @code{eval-set!} and @code{eval-options}. | |
570 | @end deffn | |
571 | ||
572 | @c FIXME::martin: Why aren't these procedure named like the other options | |
573 | @c procedures? | |
574 | ||
575 | @deffn {Scheme Procedure} traps [setting] | |
576 | Display the current settings of the evaluator traps options. If | |
577 | @var{setting} is omitted, only a short form of the current evaluator | |
578 | traps options is printed. Otherwise, @var{setting} should be one of the | |
579 | following symbols: | |
580 | @table @code | |
581 | @item help | |
582 | Display the complete option settings. | |
583 | @item full | |
584 | Like @code{help}, but also print programmer options. | |
585 | @end table | |
586 | @end deffn | |
587 | ||
588 | @deffn {Scheme Procedure} trap-enable option-name | |
589 | @deffnx {Scheme Procedure} trap-disable option-name | |
590 | @deffnx {Scheme Procedure} trap-set! option-name value | |
591 | Modify the evaluator options. @code{trap-enable} should be used with boolean | |
592 | options and switches them on, @code{trap-disable} switches them off. | |
593 | @code{trap-set!} can be used to set an option to a specific value. | |
594 | @end deffn | |
595 | ||
596 | @deffn {Scheme Procedure} evaluator-traps-interface [setting] | |
597 | @deffnx {C Function} scm_evaluator_traps (setting) | |
598 | Option interface for the evaluator trap options. | |
599 | @end deffn | |
600 | ||
601 | ||
602 | @c Local Variables: | |
603 | @c TeX-master: "guile.texi" | |
604 | @c End: |