Fix omissions and typos in previous commit.
[bpt/guile.git] / doc / ref / api-options.texi
CommitLineData
07d83abe
MV
1@c -*-texinfo-*-
2@c This is part of the GNU Guile Reference Manual.
ef4cbc08 3@c Copyright (C) 1996, 1997, 2000, 2001, 2002, 2003, 2004, 2005, 2006, 2008
07d83abe
MV
4@c Free Software Foundation, Inc.
5@c See the file guile.texi for copying conditions.
6
7@page
8@node Options and Config
9@section Configuration, Features and Runtime Options
10
11Why is my Guile different from your Guile? There are three kinds of
12possible variation:
13
14@itemize @bullet
15@item
16build differences --- different versions of the Guile source code,
17installation directories, configuration flags that control pieces of
18functionality being included or left out, etc.
19
20@item
21differences in dynamically loaded code --- behaviour and features
22provided by modules that can be dynamically loaded into a running Guile
23
24@item
25different runtime options --- some of the options that are provided for
26controlling Guile's behaviour may be set differently.
27@end itemize
28
29Guile provides ``introspective'' variables and procedures to query all
30of these possible variations at runtime. For runtime options, it also
31provides procedures to change the settings of options and to obtain
32documentation on what the options mean.
33
34@menu
35* Build Config:: Build and installation configuration.
36* Feature Tracking:: Available features in the Guile process.
37* Runtime Options:: Controlling Guile's runtime behaviour.
38@end menu
39
40
41@node Build Config
42@subsection Configuration, Build and Installation
43
44The following procedures and variables provide information about how
45Guile was configured, built and installed on your system.
46
47@deffn {Scheme Procedure} version
48@deffnx {Scheme Procedure} effective-version
49@deffnx {Scheme Procedure} major-version
50@deffnx {Scheme Procedure} minor-version
51@deffnx {Scheme Procedure} micro-version
52@deffnx {C Function} scm_version ()
53@deffnx {C Function} scm_effective_version ()
54@deffnx {C Function} scm_major_version ()
55@deffnx {C Function} scm_minor_version ()
56@deffnx {C Function} scm_micro_version ()
57Return a string describing Guile's full version number, effective
58version number, major, minor or micro version number, respectively.
59The @code{effective-version} function returns the version name that
60should remain unchanged during a stable series. Currently that means
61that it omits the micro version. The effective version should be used
62for items like the versioned share directory name
63i.e. @file{/usr/share/guile/1.6/}
64
65@lisp
66(version) @result{} "1.6.0"
67(effective-version) @result{} "1.6"
68(major-version) @result{} "1"
69(minor-version) @result{} "6"
70(micro-version) @result{} "0"
71@end lisp
72@end deffn
73
74@deffn {Scheme Procedure} %package-data-dir
75@deffnx {C Function} scm_sys_package_data_dir ()
76Return the name of the directory under which Guile Scheme files in
77general are stored. On Unix-like systems, this is usually
78@file{/usr/local/share/guile} or @file{/usr/share/guile}.
79@end deffn
80
81@deffn {Scheme Procedure} %library-dir
82@deffnx {C Function} scm_sys_library_dir ()
83Return the name of the directory where the Guile Scheme files that
84belong to the core Guile installation (as opposed to files from a 3rd
85party package) are installed. On Unix-like systems, this is usually
86@file{/usr/local/share/guile/<GUILE_EFFECTIVE_VERSION>} or
87@file{/usr/share/guile/<GUILE_EFFECTIVE_VERSION>}, for example:
88@file{/usr/local/share/guile/1.6}.
89@end deffn
90
91@deffn {Scheme Procedure} %site-dir
92@deffnx {C Function} scm_sys_site_dir ()
93Return the name of the directory where Guile Scheme files specific to
94your site should be installed. On Unix-like systems, this is usually
95@file{/usr/local/share/guile/site} or @file{/usr/share/guile/site}.
96@end deffn
97
98@cindex GUILE_LOAD_PATH
99@defvar %load-path
100List of directories which should be searched for Scheme modules and
101libraries. @code{%load-path} is initialized when Guile starts up to
102@code{(list (%site-dir) (%library-dir) (%package-data-dir) ".")},
103prepended with the contents of the GUILE_LOAD_PATH environment variable,
104if it is set.
105@end defvar
106
107@deffn {Scheme Procedure} parse-path path [tail]
108@deffnx {C Function} scm_parse_path (path, tail)
109Parse @var{path}, which is expected to be a colon-separated
110string, into a list and return the resulting list with
111@var{tail} appended. If @var{path} is @code{#f}, @var{tail}
112is returned.
113@end deffn
114
115@deffn {Scheme Procedure} search-path path filename [extensions]
116@deffnx {C Function} scm_search_path (path, filename, extensions)
117Search @var{path} for a directory containing a file named
118@var{filename}. The file must be readable, and not a directory.
119If we find one, return its full filename; otherwise, return
120@code{#f}. If @var{filename} is absolute, return it unchanged.
121If given, @var{extensions} is a list of strings; for each
122directory in @var{path}, we search for @var{filename}
123concatenated with each @var{extension}.
124@end deffn
125
126@defvar %guile-build-info
127Alist of information collected during the building of a particular
128Guile. Entries can be grouped into one of several categories:
129directories, env vars, and versioning info.
130
131Briefly, here are the keys in @code{%guile-build-info}, by group:
132
133@cindex @code{srcdir}
134@cindex @code{top_srcdir}
135@cindex @code{prefix}
136@cindex @code{exec_prefix}
137@cindex @code{bindir}
138@cindex @code{sbindir}
139@cindex @code{libexecdir}
140@cindex @code{datadir}
141@cindex @code{sysconfdir}
142@cindex @code{sharedstatedir}
143@cindex @code{localstatedir}
144@cindex @code{libdir}
145@cindex @code{infodir}
146@cindex @code{mandir}
147@cindex @code{includedir}
148@cindex @code{pkgdatadir}
149@cindex @code{pkglibdir}
150@cindex @code{pkgincludedir}
151@table @asis
152@item directories
153srcdir, top_srcdir, prefix, exec_prefix, bindir, sbindir, libexecdir,
154datadir, sysconfdir, sharedstatedir, localstatedir, libdir, infodir,
155mandir, includedir, pkgdatadir, pkglibdir, pkgincludedir
156@cindex @code{LIBS}
157@item env vars
158LIBS
159@cindex @code{guileversion}
160@cindex @code{libguileinterface}
161@cindex @code{buildstamp}
162@item versioning info
163guileversion, libguileinterface, buildstamp
164@end table
165
166Values are all strings. The value for @code{LIBS} is typically found
167also as a part of "guile-config link" output. The value for
168@code{guileversion} has form X.Y.Z, and should be the same as returned
73e46534
KR
169by @code{(version)}. The value for @code{libguileinterface} is
170libtool compatible and has form CURRENT:REVISION:AGE
171(@pxref{Versioning,, Library interface versions, libtool, GNU
172Libtool}). The value for @code{buildstamp} is the output of the
173date(1) command.
07d83abe
MV
174
175In the source, @code{%guile-build-info} is initialized from
176libguile/libpath.h, which is completely generated, so deleting this file
177before a build guarantees up-to-date values for that build.
178@end defvar
179
180
181@node Feature Tracking
182@subsection Feature Tracking
183
184Guile has a Scheme level variable @code{*features*} that keeps track to
185some extent of the features that are available in a running Guile.
186@code{*features*} is a list of symbols, for example @code{threads}, each
187of which describes a feature of the running Guile process.
188
189@defvar *features*
190A list of symbols describing available features of the Guile process.
191@end defvar
192
193You shouldn't modify the @code{*features*} variable directly using
194@code{set!}. Instead, see the procedures that are provided for this
195purpose in the following subsection.
196
197@menu
198* Feature Manipulation:: Checking for and advertising features.
199* Common Feature Symbols:: Commonly available features.
200@end menu
201
202
203@node Feature Manipulation
204@subsubsection Feature Manipulation
205
206To check whether a particular feature is available, use the
207@code{provided?} procedure:
208
209@deffn {Scheme Procedure} provided? feature
210@deffnx {Deprecated Scheme Procedure} feature? feature
211Return @code{#t} if the specified @var{feature} is available, otherwise
212@code{#f}.
213@end deffn
214
215To advertise a feature from your own Scheme code, you can use the
216@code{provide} procedure:
217
218@deffn {Scheme Procedure} provide feature
219Add @var{feature} to the list of available features in this Guile
220process.
221@end deffn
222
223For C code, the equivalent function takes its feature name as a
224@code{char *} argument for convenience:
225
226@deftypefn {C Function} void scm_add_feature (const char *str)
227Add a symbol with name @var{str} to the list of available features in
228this Guile process.
229@end deftypefn
230
231
232@node Common Feature Symbols
233@subsubsection Common Feature Symbols
234
235In general, a particular feature may be available for one of two
236reasons. Either because the Guile library was configured and compiled
237with that feature enabled --- i.e. the feature is built into the library
238on your system. Or because some C or Scheme code that was dynamically
239loaded by Guile has added that feature to the list.
240
241In the first category, here are the features that the current version of
242Guile may define (depending on how it is built), and what they mean.
243
244@table @code
245@item array
246Indicates support for arrays (@pxref{Arrays}).
247
248@item array-for-each
249Indicates availability of @code{array-for-each} and other array mapping
40499598 250procedures (@pxref{Arrays}).
07d83abe
MV
251
252@item char-ready?
253Indicates that the @code{char-ready?} function is available
254(@pxref{Reading}).
255
256@item complex
257Indicates support for complex numbers.
258
259@item current-time
260Indicates availability of time-related functions: @code{times},
261@code{get-internal-run-time} and so on (@pxref{Time}).
262
263@item debug-extensions
264Indicates that the debugging evaluator is available, together with the
265options for controlling it.
266
267@item delay
268Indicates support for promises (@pxref{Delayed Evaluation}).
269
270@item EIDs
271Indicates that the @code{geteuid} and @code{getegid} really return
272effective user and group IDs (@pxref{Processes}).
273
274@item inexact
275Indicates support for inexact numbers.
276
277@item i/o-extensions
278Indicates availability of the following extended I/O procedures:
279@code{ftell}, @code{redirect-port}, @code{dup->fdes}, @code{dup2},
280@code{fileno}, @code{isatty?}, @code{fdopen},
281@code{primitive-move->fdes} and @code{fdes->ports} (@pxref{Ports and
282File Descriptors}).
283
284@item net-db
285Indicates availability of network database functions:
286@code{scm_gethost}, @code{scm_getnet}, @code{scm_getproto},
287@code{scm_getserv}, @code{scm_sethost}, @code{scm_setnet}, @code{scm_setproto},
288@code{scm_setserv}, and their `byXXX' variants (@pxref{Network
289Databases}).
290
291@item posix
292Indicates support for POSIX functions: @code{pipe}, @code{getgroups},
293@code{kill}, @code{execl} and so on (@pxref{POSIX}).
294
295@item random
296Indicates availability of random number generation functions:
297@code{random}, @code{copy-random-state}, @code{random-uniform} and so on
298(@pxref{Random}).
299
300@item reckless
301Indicates that Guile was built with important checks omitted --- you
302should never see this!
303
304@item regex
305Indicates support for POSIX regular expressions using
306@code{make-regexp}, @code{regexp-exec} and friends (@pxref{Regexp
307Functions}).
308
309@item socket
310Indicates availability of socket-related functions: @code{socket},
311@code{bind}, @code{connect} and so on (@pxref{Network Sockets and
312Communication}).
313
314@item sort
315Indicates availability of sorting and merging functions
316(@pxref{Sorting}).
317
318@item system
319Indicates that the @code{system} function is available
320(@pxref{Processes}).
321
322@item threads
323Indicates support for multithreading (@pxref{Threads}).
324
325@item values
326Indicates support for multiple return values using @code{values} and
327@code{call-with-values} (@pxref{Multiple Values}).
328@end table
329
330Available features in the second category depend, by definition, on what
331additional code your Guile process has loaded in. The following table
332lists features that you might encounter for this reason.
333
334@table @code
335@item defmacro
336Indicates that the @code{defmacro} macro is available (@pxref{Macros}).
337
338@item describe
339Indicates that the @code{(oop goops describe)} module has been loaded,
340which provides a procedure for describing the contents of GOOPS
341instances.
342
343@item readline
344Indicates that Guile has loaded in Readline support, for command line
345editing (@pxref{Readline Support}).
346
347@item record
348Indicates support for record definition using @code{make-record-type}
349and friends (@pxref{Records}).
350@end table
351
352Although these tables may seem exhaustive, it is probably unwise in
353practice to rely on them, as the correspondences between feature symbols
354and available procedures/behaviour are not strictly defined. If you are
355writing code that needs to check for the existence of some procedure, it
356is probably safer to do so directly using the @code{defined?} procedure
357than to test for the corresponding feature using @code{provided?}.
358
359
360@node Runtime Options
361@subsection Runtime Options
362
363Guile's runtime behaviour can be modified by setting options. For
364example, is the language that Guile accepts case sensitive, or should
365the debugger automatically show a backtrace on error?
366
367Guile has two levels of interface for managing options: a low-level
368control interface, and a user-level interface which allows the enabling
369or disabling of options.
370
371Moreover, the options are classified in groups according to whether they
372configure @emph{reading}, @emph{printing}, @emph{debugging} or
373@emph{evaluating}.
374
375@menu
376* Low level options interfaces::
377* User level options interfaces::
378* Reader options::
379* Printing options::
380* Debugger options::
381* Evaluator options::
382* Evaluator trap options::
383* Examples of option use::
384@end menu
385
386
387@node Low level options interfaces
388@subsubsection Low Level Options Interfaces
389
390@deffn {Scheme Procedure} read-options-interface [setting]
391@deffnx {Scheme Procedure} eval-options-interface [setting]
392@deffnx {Scheme Procedure} print-options-interface [setting]
393@deffnx {Scheme Procedure} debug-options-interface [setting]
394@deffnx {Scheme Procedure} evaluator-traps-interface [setting]
395@deffnx {C Function} scm_read_options (setting)
396@deffnx {C Function} scm_eval_options_interface (setting)
397@deffnx {C Function} scm_print_options (setting)
398@deffnx {C Function} scm_debug_options (setting)
399@deffnx {C Function} scm_evaluator_traps (setting)
400If one of these procedures is called with no arguments (or with
401@code{setting == SCM_UNDEFINED} in C code), it returns a list describing
402the current setting of the read, eval, print, debug or evaluator traps
403options respectively. The setting of a boolean option is indicated
404simply by the presence or absence of the option symbol in the list. The
405setting of a non-boolean option is indicated by the presence of the
406option symbol immediately followed by the option's current value.
407
408If called with a list argument, these procedures interpret the list as
409an option setting and modify the relevant options accordingly. [FIXME
410--- this glosses over a lot of details!]
411
412If called with any other argument, such as @code{'help}, these
413procedures return a list of entries like @code{(@var{OPTION-SYMBOL}
414@var{DEFAULT-VALUE} @var{DOC-STRING})}, with each entry giving the
415default value and documentation for each option symbol in the relevant
416set of options.
417@end deffn
418
419
420@node User level options interfaces
421@subsubsection User Level Options Interfaces
422
423@c @deftp {Data type} scm_option
424@c @code{scm_option} is used to represent run time options. It can be a
425@c @emph{boolean} type, in which case the option will be set by the strings
426@c @code{"yes"} and @code{"no"}. It can be a
427@c @end deftp
428
429@c NJFIXME
430@deffn {Scheme Procedure} <group>-options [arg]
431@deffnx {Scheme Procedure} read-options [arg]
432@deffnx {Scheme Procedure} print-options [arg]
433@deffnx {Scheme Procedure} debug-options [arg]
434@deffnx {Scheme Procedure} traps [arg]
435These functions list the options in their group. The optional argument
436@var{arg} is a symbol which modifies the form in which the options are
437presented.
438
439With no arguments, @code{<group>-options} returns the values of the
440options in that particular group. If @var{arg} is @code{'help}, a
441description of each option is given. If @var{arg} is @code{'full},
442programmers' options are also shown.
443
444@var{arg} can also be a list representing the state of all options. In
445this case, the list contains single symbols (for enabled boolean
446options) and symbols followed by values.
447@end deffn
448[FIXME: I don't think 'full is ever any different from 'help. What's
449up?]
450
451@c NJFIXME
452@deffn {Scheme Procedure} <group>-enable option-symbol
453@deffnx {Scheme Procedure} read-enable option-symbol
454@deffnx {Scheme Procedure} print-enable option-symbol
455@deffnx {Scheme Procedure} debug-enable option-symbol
456@deffnx {Scheme Procedure} trap-enable option-symbol
457These functions set the specified @var{option-symbol} in their options
458group. They only work if the option is boolean, and throw an error
459otherwise.
460@end deffn
461
462@c NJFIXME
463@deffn {Scheme Procedure} <group>-disable option-symbol
464@deffnx {Scheme Procedure} read-disable option-symbol
465@deffnx {Scheme Procedure} print-disable option-symbol
466@deffnx {Scheme Procedure} debug-disable option-symbol
467@deffnx {Scheme Procedure} trap-disable option-symbol
468These functions turn off the specified @var{option-symbol} in their
469options group. They only work if the option is boolean, and throw an
470error otherwise.
471@end deffn
472
473@c NJFIXME
474@deffn syntax <group>-set! option-symbol value
475@deffnx syntax read-set! option-symbol value
476@deffnx syntax print-set! option-symbol value
477@deffnx syntax debug-set! option-symbol value
478@deffnx syntax trap-set! option-symbol value
479These functions set a non-boolean @var{option-symbol} to the specified
480@var{value}.
481@end deffn
482
483
484@node Reader options
485@subsubsection Reader options
486@cindex options - read
487@cindex read options
488
489Here is the list of reader options generated by typing
490@code{(read-options 'full)} in Guile. You can also see the default
491values.
492
493@smalllisp
ef4cbc08 494keywords #f Style of keyword recognition: #f, 'prefix or 'postfix
07d83abe
MV
495case-insensitive no Convert symbols to lower case.
496positions yes Record positions of source code expressions.
497copy no Copy source code expressions.
498@end smalllisp
499
500Notice that while Standard Scheme is case insensitive, to ease
501translation of other Lisp dialects, notably Emacs Lisp, into Guile,
502Guile is case-sensitive by default.
503
504To make Guile case insensitive, you can type
505
506@smalllisp
507(read-enable 'case-insensitive)
508@end smalllisp
509
510@node Printing options
511@subsubsection Printing options
512
513Here is the list of print options generated by typing
514@code{(print-options 'full)} in Guile. You can also see the default
515values.
516
517@smallexample
227eafdb
MV
518quote-keywordish-symbols reader How to print symbols that have a colon
519 as their first or last character. The
520 value '#f' does not quote the colons;
521 '#t' quotes them; 'reader' quotes
522 them when the reader option
523 'keywords' is not '#f'.
524
525highlight-prefix @{ The string to print before highlighted values.
526highlight-suffix @} The string to print after highlighted values.
527
528source no Print closures with source.
529closure-hook #f Hook for printing closures.
07d83abe
MV
530@end smallexample
531
532
533@node Evaluator options
534@subsubsection Evaluator options
535
536These are the evaluator options with their default values, as they are
537printed by typing @code{(eval-options 'full)} in Guile.
538
539@smallexample
540stack 22000 Size of thread stacks (in machine words).
541@end smallexample
542
543
544@node Evaluator trap options
545@subsubsection Evaluator trap options
546[FIXME: These flags, together with their corresponding handlers, are not
547user level options. Probably this entire section should be moved to the
548documentation about the low-level programmer debugging interface.]
549
550Here is the list of evaluator trap options generated by typing
551@code{(traps 'full)} in Guile. You can also see the default values.
552
553@smallexample
554exit-frame no Trap when exiting eval or apply.
555apply-frame no Trap when entering apply.
556enter-frame no Trap when eval enters new frame.
19ab431e 557memoize-symbol no Trap when eval memoizes a symbol's value
07d83abe
MV
558traps yes Enable evaluator traps.
559@end smallexample
560
561@deffn apply-frame-handler key cont tailp
562Called when a procedure is being applied.
563
564Called if:
565
566@itemize @bullet
567@item
568evaluator traps are enabled [traps interface], and
569@item
570either
571@itemize @minus
572@item
573@code{apply-frame} is enabled [traps interface], or
574@item
575trace mode is on [debug-options interface], and the procedure being
576called has the trace property enabled.
577@end itemize
578@end itemize
579
31e2cc50
NJ
580@var{cont} is a ``debug object'', which means that it can be passed to
581@code{make-stack} to discover the stack at the point of the trap. The
582apply frame handler's code can capture a restartable continuation if it
583wants to by using @code{call-with-current-continuation} in the usual way.
07d83abe
MV
584
585@var{tailp} is true if this is a tail call
586@end deffn
587
588@deffn exit-frame-handler key cont retval
589Called when a value is returned from a procedure.
590
591Called if:
592
593@itemize @bullet
594@item
595evaluator traps are enabled [traps interface], and
596@item
597either
598@itemize @minus
599@item
600 @code{exit-frame} is enabled [traps interface], or
601@item
602trace mode is on [debug-options interface], and the procedure being
603called has the trace property enabled.
604@end itemize
605@end itemize
606
31e2cc50
NJ
607@var{cont} is a ``debug object'', which means that it can be passed to
608@code{make-stack} to discover the stack at the point of the trap. The
609exit frame handler's code can capture a restartable continuation if it
610wants to by using @code{call-with-current-continuation} in the usual
611way.
07d83abe
MV
612
613@var{retval} is the return value.
614@end deffn
615
19ab431e
HWN
616@deffn memoize-symbol-handler key cont expression env
617Called when the evaluator memoizes the value of a procedure symbol
618
619@var{cont} is a ``debug object'', which means that it can be passed to
620@code{make-stack} to discover the stack at the point of the trap. The
621exit frame handler's code can capture a restartable continuation if it
622wants to by using @code{call-with-current-continuation} in the usual
623way.
624
625@var{retval} is the return value.
626@end deffn
627
24dbb5ed
NJ
628@deffn {Scheme Procedure} with-traps thunk
629@deffnx {C Function} scm_with_traps (thunk)
630Call @var{thunk} with traps enabled.
631@end deffn
632
633@deffn {Scheme Procedure} debug-object? obj
634@deffnx {C Function} scm_debug_object_p (obj)
635Return @code{#t} if @var{obj} is a debug object.
636@end deffn
637
19ab431e 638
07d83abe
MV
639@node Debugger options
640@subsubsection Debugger options
641
642Here is the list of print options generated by typing
643@code{(debug-options 'full)} in Guile. You can also see the default
644values.
645
646@smallexample
647stack 20000 Stack size limit (0 = no check).
648debug yes Use the debugging evaluator.
649backtrace no Show backtrace on error.
650depth 20 Maximal length of printed backtrace.
651maxdepth 1000 Maximal number of stored backtrace frames.
652frames 3 Maximum number of tail-recursive frames in backtrace.
653indent 10 Maximal indentation in backtrace.
654backwards no Display backtrace in anti-chronological order.
655procnames yes Record procedure names at definition.
656trace no *Trace mode.
657breakpoints no *Check for breakpoints.
31e2cc50 658cheap yes *This option is now obsolete. Setting it has no effect.
07d83abe
MV
659@end smallexample
660
661@subsubheading Stack overflow
662
663@cindex overflow, stack
664@cindex stack overflow
665Stack overflow errors are caused by a computation trying to use more
666stack space than has been enabled by the @code{stack} option. They are
667reported like this:
668
669@lisp
670(non-tail-recursive-factorial 500)
671@print{}
672ERROR: Stack overflow
673ABORT: (stack-overflow)
674@end lisp
675
676If you get an error like this, you can either try rewriting your code to
677use less stack space, or increase the maximum stack size. To increase
678the maximum stack size, use @code{debug-set!}, for example:
679
680@lisp
681(debug-set! stack 200000)
682@result{}
683(show-file-name #t stack 200000 debug backtrace depth 20 maxdepth 1000 frames 3 indent 10 width 79 procnames cheap)
684
685(non-tail-recursive-factorial 500)
686@result{}
687122013682599111006870123878542304692625357434@dots{}
688@end lisp
689
690If you prefer to try rewriting your code, you may be able to save stack
bfc083ec
KR
691space by making some of your procedures @dfn{tail recursive}
692(@pxref{Tail Calls}).
07d83abe
MV
693
694
695@node Examples of option use
696@subsubsection Examples of option use
697
698Here is an example of a session in which some read and debug option
699handling procedures are used. In this example, the user
700
701@enumerate
702@item
703Notices that the symbols @code{abc} and @code{aBc} are not the same
704@item
705Examines the @code{read-options}, and sees that @code{case-insensitive}
706is set to ``no''.
707@item
708Enables @code{case-insensitive}
709@item
710Verifies that now @code{aBc} and @code{abc} are the same
711@item
712Disables @code{case-insensitive} and enables debugging @code{backtrace}
713@item
714Reproduces the error of displaying @code{aBc} with backtracing enabled
715[FIXME: this last example is lame because there is no depth in the
716backtrace. Need to give a better example, possibly putting debugging
717option examples in a separate session.]
718@end enumerate
719
720
721@smalllisp
722guile> (define abc "hello")
723guile> abc
724"hello"
725guile> aBc
726ERROR: In expression aBc:
727ERROR: Unbound variable: aBc
728ABORT: (misc-error)
729
730Type "(backtrace)" to get more information.
731guile> (read-options 'help)
ef4cbc08 732keywords #f Style of keyword recognition: #f, 'prefix or 'postfix
07d83abe
MV
733case-insensitive no Convert symbols to lower case.
734positions yes Record positions of source code expressions.
735copy no Copy source code expressions.
736guile> (debug-options 'help)
737stack 20000 Stack size limit (0 = no check).
738debug yes Use the debugging evaluator.
739backtrace no Show backtrace on error.
740depth 20 Maximal length of printed backtrace.
741maxdepth 1000 Maximal number of stored backtrace frames.
742frames 3 Maximum number of tail-recursive frames in backtrace.
743indent 10 Maximal indentation in backtrace.
744backwards no Display backtrace in anti-chronological order.
745procnames yes Record procedure names at definition.
746trace no *Trace mode.
747breakpoints no *Check for breakpoints.
31e2cc50 748cheap yes *This option is now obsolete. Setting it has no effect.
07d83abe
MV
749guile> (read-enable 'case-insensitive)
750(keywords #f case-insensitive positions)
751guile> aBc
752"hello"
753guile> (read-disable 'case-insensitive)
754(keywords #f positions)
755guile> (debug-enable 'backtrace)
756(stack 20000 debug backtrace depth 20 maxdepth 1000 frames 3 indent 10 procnames cheap)
757guile> aBc
758
759Backtrace:
7600* aBc
761
762ERROR: In expression aBc:
763ERROR: Unbound variable: aBc
764ABORT: (misc-error)
765guile>
766@end smalllisp
767
768
769@c Local Variables:
770@c TeX-master: "guile.texi"
771@c End: