mirror of
https://git.savannah.gnu.org/git/guile.git
synced 2025-07-12 20:20:29 +02:00
In general, use @lisp in preference to @smalllisp
because it looks better in the DVI output. Exceptions are - wide examples, which would cause overfull hboxes if they used the bigger @lisp font - very large examples, which may look too big at the @lisp size.
This commit is contained in:
parent
f618f4363d
commit
aba0dff5f7
12 changed files with 76 additions and 76 deletions
|
@ -3477,9 +3477,9 @@ allocated string.
|
||||||
@deffnx {C Function} scm_string_concatenate_reverse (ls, final_string, end)
|
@deffnx {C Function} scm_string_concatenate_reverse (ls, final_string, end)
|
||||||
Without optional arguments, this procedure is equivalent to
|
Without optional arguments, this procedure is equivalent to
|
||||||
|
|
||||||
@smalllisp
|
@lisp
|
||||||
(string-concatenate (reverse ls))
|
(string-concatenate (reverse ls))
|
||||||
@end smalllisp
|
@end lisp
|
||||||
|
|
||||||
If the optional argument @var{final_string} is specified, it is
|
If the optional argument @var{final_string} is specified, it is
|
||||||
consed onto the beginning to @var{ls} before performing the
|
consed onto the beginning to @var{ls} before performing the
|
||||||
|
@ -5505,7 +5505,7 @@ the @code{read-set!} procedure documented in @ref{User level options
|
||||||
interfaces} and @ref{Reader options}. Note that the @code{prefix} and
|
interfaces} and @ref{Reader options}. Note that the @code{prefix} and
|
||||||
@code{postfix} syntax are mutually exclusive.
|
@code{postfix} syntax are mutually exclusive.
|
||||||
|
|
||||||
@smalllisp
|
@lisp
|
||||||
(read-set! keywords 'prefix)
|
(read-set! keywords 'prefix)
|
||||||
|
|
||||||
#:type
|
#:type
|
||||||
|
@ -5537,7 +5537,7 @@ type:
|
||||||
ERROR: In expression :type:
|
ERROR: In expression :type:
|
||||||
ERROR: Unbound variable: :type
|
ERROR: Unbound variable: :type
|
||||||
ABORT: (unbound-variable)
|
ABORT: (unbound-variable)
|
||||||
@end smalllisp
|
@end lisp
|
||||||
|
|
||||||
@node Keyword Procedures
|
@node Keyword Procedures
|
||||||
@subsubsection Keyword Procedures
|
@subsubsection Keyword Procedures
|
||||||
|
|
|
@ -424,9 +424,9 @@ the current size, but this is not mandatory in the POSIX standard.
|
||||||
|
|
||||||
The delimited-I/O module can be accessed with:
|
The delimited-I/O module can be accessed with:
|
||||||
|
|
||||||
@smalllisp
|
@lisp
|
||||||
(use-modules (ice-9 rdelim))
|
(use-modules (ice-9 rdelim))
|
||||||
@end smalllisp
|
@end lisp
|
||||||
|
|
||||||
It can be used to read or write lines of text, or read text delimited by
|
It can be used to read or write lines of text, or read text delimited by
|
||||||
a specified set of characters. It's similar to the @code{(scsh rdelim)}
|
a specified set of characters. It's similar to the @code{(scsh rdelim)}
|
||||||
|
@ -536,9 +536,9 @@ delimiter may be either a newline or the @var{eof-object}; if
|
||||||
|
|
||||||
The Block-string-I/O module can be accessed with:
|
The Block-string-I/O module can be accessed with:
|
||||||
|
|
||||||
@smalllisp
|
@lisp
|
||||||
(use-modules (ice-9 rw))
|
(use-modules (ice-9 rw))
|
||||||
@end smalllisp
|
@end lisp
|
||||||
|
|
||||||
It currently contains procedures that help to implement the
|
It currently contains procedures that help to implement the
|
||||||
@code{(scsh rw)} module in guile-scsh.
|
@code{(scsh rw)} module in guile-scsh.
|
||||||
|
@ -795,17 +795,17 @@ current interfaces.
|
||||||
@rnindex open-input-file
|
@rnindex open-input-file
|
||||||
@deffn {Scheme Procedure} open-input-file filename
|
@deffn {Scheme Procedure} open-input-file filename
|
||||||
Open @var{filename} for input. Equivalent to
|
Open @var{filename} for input. Equivalent to
|
||||||
@smalllisp
|
@lisp
|
||||||
(open-file @var{filename} "r")
|
(open-file @var{filename} "r")
|
||||||
@end smalllisp
|
@end lisp
|
||||||
@end deffn
|
@end deffn
|
||||||
|
|
||||||
@rnindex open-output-file
|
@rnindex open-output-file
|
||||||
@deffn {Scheme Procedure} open-output-file filename
|
@deffn {Scheme Procedure} open-output-file filename
|
||||||
Open @var{filename} for output. Equivalent to
|
Open @var{filename} for output. Equivalent to
|
||||||
@smalllisp
|
@lisp
|
||||||
(open-file @var{filename} "w")
|
(open-file @var{filename} "w")
|
||||||
@end smalllisp
|
@end lisp
|
||||||
@end deffn
|
@end deffn
|
||||||
|
|
||||||
@deffn {Scheme Procedure} call-with-input-file filename proc
|
@deffn {Scheme Procedure} call-with-input-file filename proc
|
||||||
|
|
|
@ -60,15 +60,15 @@ Library files in SLIB @emph{provide} a feature, and when user programs
|
||||||
For example, the file @file{random.scm} in the SLIB package contains the
|
For example, the file @file{random.scm} in the SLIB package contains the
|
||||||
line
|
line
|
||||||
|
|
||||||
@smalllisp
|
@lisp
|
||||||
(provide 'random)
|
(provide 'random)
|
||||||
@end smalllisp
|
@end lisp
|
||||||
|
|
||||||
so to use its procedures, a user would type
|
so to use its procedures, a user would type
|
||||||
|
|
||||||
@smalllisp
|
@lisp
|
||||||
(require 'random)
|
(require 'random)
|
||||||
@end smalllisp
|
@end lisp
|
||||||
|
|
||||||
and they would magically become available, @emph{but still have the same
|
and they would magically become available, @emph{but still have the same
|
||||||
names!} So this method is nice, but not as good as a full-featured
|
names!} So this method is nice, but not as good as a full-featured
|
||||||
|
@ -99,9 +99,9 @@ i.e., passed as the second argument to @code{eval}.
|
||||||
Note: the following two procedures are available only when the
|
Note: the following two procedures are available only when the
|
||||||
@code{(ice-9 r5rs)} module is loaded:
|
@code{(ice-9 r5rs)} module is loaded:
|
||||||
|
|
||||||
@smalllisp
|
@lisp
|
||||||
(use-modules (ice-9 r5rs))
|
(use-modules (ice-9 r5rs))
|
||||||
@end smalllisp
|
@end lisp
|
||||||
|
|
||||||
@deffn {Scheme Procedure} scheme-report-environment version
|
@deffn {Scheme Procedure} scheme-report-environment version
|
||||||
@deffnx {Scheme Procedure} null-environment version
|
@deffnx {Scheme Procedure} null-environment version
|
||||||
|
@ -224,9 +224,9 @@ An @dfn{interface specification} has one of two forms. The first
|
||||||
variation is simply to name the module, in which case its public
|
variation is simply to name the module, in which case its public
|
||||||
interface is the one accessed. For example:
|
interface is the one accessed. For example:
|
||||||
|
|
||||||
@smalllisp
|
@lisp
|
||||||
(use-modules (ice-9 popen))
|
(use-modules (ice-9 popen))
|
||||||
@end smalllisp
|
@end lisp
|
||||||
|
|
||||||
Here, the interface specification is @code{(ice-9 popen)}, and the
|
Here, the interface specification is @code{(ice-9 popen)}, and the
|
||||||
result is that the current module now has access to @code{open-pipe},
|
result is that the current module now has access to @code{open-pipe},
|
||||||
|
@ -241,11 +241,11 @@ module to be accessed, but also selects bindings from it and renames
|
||||||
them to suit the current module's needs. For example:
|
them to suit the current module's needs. For example:
|
||||||
|
|
||||||
@cindex binding renamer
|
@cindex binding renamer
|
||||||
@smalllisp
|
@lisp
|
||||||
(use-modules ((ice-9 popen)
|
(use-modules ((ice-9 popen)
|
||||||
:select ((open-pipe . pipe-open) close-pipe)
|
:select ((open-pipe . pipe-open) close-pipe)
|
||||||
:renamer (symbol-prefix-proc 'unixy:)))
|
:renamer (symbol-prefix-proc 'unixy:)))
|
||||||
@end smalllisp
|
@end lisp
|
||||||
|
|
||||||
Here, the interface specification is more complex than before, and the
|
Here, the interface specification is more complex than before, and the
|
||||||
result is that a custom interface with only two bindings is created and
|
result is that a custom interface with only two bindings is created and
|
||||||
|
@ -270,10 +270,10 @@ You can also directly refer to bindings in a module by using the
|
||||||
open-pipe)}. Thus an alternative to the complete @code{use-modules}
|
open-pipe)}. Thus an alternative to the complete @code{use-modules}
|
||||||
statement would be
|
statement would be
|
||||||
|
|
||||||
@smalllisp
|
@lisp
|
||||||
(define unixy:pipe-open (@@ (ice-9 popen) open-pipe))
|
(define unixy:pipe-open (@@ (ice-9 popen) open-pipe))
|
||||||
(define unixy:close-pipe (@@ (ice-9 popen) close-pipe))
|
(define unixy:close-pipe (@@ (ice-9 popen) close-pipe))
|
||||||
@end smalllisp
|
@end lisp
|
||||||
|
|
||||||
There is also @code{@@@@}, which can be used like @code{@@}, but does
|
There is also @code{@@@@}, which can be used like @code{@@}, but does
|
||||||
not check whether the variable that is being accessed is actually
|
not check whether the variable that is being accessed is actually
|
||||||
|
@ -307,9 +307,9 @@ whose public interface is found and used.
|
||||||
@var{spec} can also be of the form:
|
@var{spec} can also be of the form:
|
||||||
|
|
||||||
@cindex binding renamer
|
@cindex binding renamer
|
||||||
@smalllisp
|
@lisp
|
||||||
(MODULE-NAME [:select SELECTION] [:renamer RENAMER])
|
(MODULE-NAME [:select SELECTION] [:renamer RENAMER])
|
||||||
@end smalllisp
|
@end lisp
|
||||||
|
|
||||||
in which case a custom interface is newly created and used.
|
in which case a custom interface is newly created and used.
|
||||||
@var{module-name} is a list of symbols, as above; @var{selection} is a
|
@var{module-name} is a list of symbols, as above; @var{selection} is a
|
||||||
|
@ -373,9 +373,9 @@ by using @code{define-public} or @code{export} (both documented below).
|
||||||
@var{module-name} is of the form @code{(hierarchy file)}. One
|
@var{module-name} is of the form @code{(hierarchy file)}. One
|
||||||
example of this is
|
example of this is
|
||||||
|
|
||||||
@smalllisp
|
@lisp
|
||||||
(define-module (ice-9 popen))
|
(define-module (ice-9 popen))
|
||||||
@end smalllisp
|
@end lisp
|
||||||
|
|
||||||
@code{define-module} makes this module available to Guile programs under
|
@code{define-module} makes this module available to Guile programs under
|
||||||
the given @var{module-name}.
|
the given @var{module-name}.
|
||||||
|
@ -541,9 +541,9 @@ duplication to the next handler in @var{list}.
|
||||||
The default duplicate binding resolution policy is given by the
|
The default duplicate binding resolution policy is given by the
|
||||||
@code{default-duplicate-binding-handler} procedure, and is
|
@code{default-duplicate-binding-handler} procedure, and is
|
||||||
|
|
||||||
@smalllisp
|
@lisp
|
||||||
(replace warn-override-core warn last)
|
(replace warn-override-core warn last)
|
||||||
@end smalllisp
|
@end lisp
|
||||||
|
|
||||||
@item #:no-backtrace
|
@item #:no-backtrace
|
||||||
@cindex no backtrace
|
@cindex no backtrace
|
||||||
|
@ -1138,12 +1138,12 @@ gcc -shared -o libbessel.so -fPIC bessel.c
|
||||||
|
|
||||||
Now fire up Guile:
|
Now fire up Guile:
|
||||||
|
|
||||||
@smalllisp
|
@lisp
|
||||||
(define bessel-lib (dynamic-link "./libbessel.so"))
|
(define bessel-lib (dynamic-link "./libbessel.so"))
|
||||||
(dynamic-call "init_math_bessel" bessel-lib)
|
(dynamic-call "init_math_bessel" bessel-lib)
|
||||||
(j0 2)
|
(j0 2)
|
||||||
@result{} 0.223890779141236
|
@result{} 0.223890779141236
|
||||||
@end smalllisp
|
@end lisp
|
||||||
|
|
||||||
The filename @file{./libbessel.so} should be pointing to the shared
|
The filename @file{./libbessel.so} should be pointing to the shared
|
||||||
library produced with the @code{gcc} command above, of course. The
|
library produced with the @code{gcc} command above, of course. The
|
||||||
|
|
|
@ -504,9 +504,9 @@ Guile is case-sensitive by default.
|
||||||
|
|
||||||
To make Guile case insensitive, you can type
|
To make Guile case insensitive, you can type
|
||||||
|
|
||||||
@smalllisp
|
@lisp
|
||||||
(read-enable 'case-insensitive)
|
(read-enable 'case-insensitive)
|
||||||
@end smalllisp
|
@end lisp
|
||||||
|
|
||||||
@node Printing options
|
@node Printing options
|
||||||
@subsubsection Printing options
|
@subsubsection Printing options
|
||||||
|
@ -719,7 +719,6 @@ backtrace. Need to give a better example, possibly putting debugging
|
||||||
option examples in a separate session.]
|
option examples in a separate session.]
|
||||||
@end enumerate
|
@end enumerate
|
||||||
|
|
||||||
|
|
||||||
@smalllisp
|
@smalllisp
|
||||||
guile> (define abc "hello")
|
guile> (define abc "hello")
|
||||||
guile> abc
|
guile> abc
|
||||||
|
|
|
@ -10,9 +10,9 @@
|
||||||
|
|
||||||
The macros in this section are made available with:
|
The macros in this section are made available with:
|
||||||
|
|
||||||
@smalllisp
|
@lisp
|
||||||
(use-modules (ice-9 expect))
|
(use-modules (ice-9 expect))
|
||||||
@end smalllisp
|
@end lisp
|
||||||
|
|
||||||
@code{expect} is a macro for selecting actions based on the output from
|
@code{expect} is a macro for selecting actions based on the output from
|
||||||
a port. The name comes from a tool of similar functionality by Don Libes.
|
a port. The name comes from a tool of similar functionality by Don Libes.
|
||||||
|
@ -30,14 +30,14 @@ which is matched against each of the patterns. When a
|
||||||
pattern matches, the remaining expression(s) in
|
pattern matches, the remaining expression(s) in
|
||||||
the clause are evaluated and the value of the last is returned. For example:
|
the clause are evaluated and the value of the last is returned. For example:
|
||||||
|
|
||||||
@smalllisp
|
@lisp
|
||||||
(with-input-from-file "/etc/passwd"
|
(with-input-from-file "/etc/passwd"
|
||||||
(lambda ()
|
(lambda ()
|
||||||
(expect-strings
|
(expect-strings
|
||||||
("^nobody" (display "Got a nobody user.\n")
|
("^nobody" (display "Got a nobody user.\n")
|
||||||
(display "That's no problem.\n"))
|
(display "That's no problem.\n"))
|
||||||
("^daemon" (display "Got a daemon user.\n")))))
|
("^daemon" (display "Got a daemon user.\n")))))
|
||||||
@end smalllisp
|
@end lisp
|
||||||
|
|
||||||
The regular expression is compiled with the @code{REG_NEWLINE} flag, so
|
The regular expression is compiled with the @code{REG_NEWLINE} flag, so
|
||||||
that the ^ and $ anchors will match at any newline, not just at the start
|
that the ^ and $ anchors will match at any newline, not just at the start
|
||||||
|
@ -54,13 +54,13 @@ The symbol @code{=>} can be used to indicate that the expression is a
|
||||||
procedure which will accept the result of a successful regular expression
|
procedure which will accept the result of a successful regular expression
|
||||||
match. E.g.,
|
match. E.g.,
|
||||||
|
|
||||||
@smalllisp
|
@lisp
|
||||||
("^daemon" => write)
|
("^daemon" => write)
|
||||||
("^d(aemon)" => (lambda args (for-each write args)))
|
("^d(aemon)" => (lambda args (for-each write args)))
|
||||||
("^da(em)on" => (lambda (all sub)
|
("^da(em)on" => (lambda (all sub)
|
||||||
(write all) (newline)
|
(write all) (newline)
|
||||||
(write sub) (newline)))
|
(write sub) (newline)))
|
||||||
@end smalllisp
|
@end lisp
|
||||||
|
|
||||||
The order of the substrings corresponds to the order in which the
|
The order of the substrings corresponds to the order in which the
|
||||||
opening brackets occur.
|
opening brackets occur.
|
||||||
|
@ -135,12 +135,12 @@ expression.
|
||||||
In the following example, a string will only be matched at the beginning
|
In the following example, a string will only be matched at the beginning
|
||||||
of the file:
|
of the file:
|
||||||
|
|
||||||
@smalllisp
|
@lisp
|
||||||
(let ((expect-port (open-input-file "/etc/passwd")))
|
(let ((expect-port (open-input-file "/etc/passwd")))
|
||||||
(expect
|
(expect
|
||||||
((lambda (s eof?) (string=? s "fnord!"))
|
((lambda (s eof?) (string=? s "fnord!"))
|
||||||
(display "Got a nobody user!\n"))))
|
(display "Got a nobody user!\n"))))
|
||||||
@end smalllisp
|
@end lisp
|
||||||
|
|
||||||
The control variables described for @code{expect-strings} also
|
The control variables described for @code{expect-strings} also
|
||||||
influence the behaviour of @code{expect}, with the exception of
|
influence the behaviour of @code{expect}, with the exception of
|
||||||
|
|
|
@ -172,12 +172,12 @@ Then the expression
|
||||||
@noindent
|
@noindent
|
||||||
will print the following information on the standard output:
|
will print the following information on the standard output:
|
||||||
|
|
||||||
@lisp
|
@smalllisp
|
||||||
#<<my-complex> 401d8638> is an instance of class <my-complex>
|
#<<my-complex> 401d8638> is an instance of class <my-complex>
|
||||||
Slots are:
|
Slots are:
|
||||||
r = 10
|
r = 10
|
||||||
i = 3
|
i = 3
|
||||||
@end lisp
|
@end smalllisp
|
||||||
|
|
||||||
@node Slot description
|
@node Slot description
|
||||||
@subsection Slot description
|
@subsection Slot description
|
||||||
|
@ -400,20 +400,21 @@ A more complete example is given below:
|
||||||
|
|
||||||
@example
|
@example
|
||||||
@group
|
@group
|
||||||
@lisp
|
@smalllisp
|
||||||
(define c (make <my-complex> #:r 12 #:i 20))
|
(define c (make <my-complex> #:r 12 #:i 20))
|
||||||
(real-part c) @result{} 12
|
(real-part c) @result{} 12
|
||||||
(angle c) @result{} 1.03037682652431
|
(angle c) @result{} 1.03037682652431
|
||||||
(slot-set! c 'i 10)
|
(slot-set! c 'i 10)
|
||||||
(set! (real-part c) 1)
|
(set! (real-part c) 1)
|
||||||
(describe c) @result{}
|
(describe c)
|
||||||
#<<my-complex> 401e9b58> is an instance of class <my-complex>
|
@print{}
|
||||||
Slots are:
|
#<<my-complex> 401e9b58> is an instance of class <my-complex>
|
||||||
r = 1
|
Slots are:
|
||||||
i = 10
|
r = 1
|
||||||
m = 10.0498756211209
|
i = 10
|
||||||
a = 1.47112767430373
|
m = 10.0498756211209
|
||||||
@end lisp
|
a = 1.47112767430373
|
||||||
|
@end smalllisp
|
||||||
@end group
|
@end group
|
||||||
@end example
|
@end example
|
||||||
|
|
||||||
|
|
|
@ -44,9 +44,9 @@ quick introduction to its main operations.
|
||||||
|
|
||||||
To start using GOOPS, load the @code{(oop goops)} module:
|
To start using GOOPS, load the @code{(oop goops)} module:
|
||||||
|
|
||||||
@smalllisp
|
@lisp
|
||||||
(use-modules (oop goops))
|
(use-modules (oop goops))
|
||||||
@end smalllisp
|
@end lisp
|
||||||
|
|
||||||
We're now ready to try some basic GOOPS functionality.
|
We're now ready to try some basic GOOPS functionality.
|
||||||
|
|
||||||
|
@ -1489,7 +1489,7 @@ This can be resolved automagically with the duplicates handler
|
||||||
@code{merge-generics} which gives the module system license to merge
|
@code{merge-generics} which gives the module system license to merge
|
||||||
all generic functions sharing a common name:
|
all generic functions sharing a common name:
|
||||||
|
|
||||||
@smalllisp
|
@lisp
|
||||||
(define-module (math 2D-vectors)
|
(define-module (math 2D-vectors)
|
||||||
:use-module (oop goops)
|
:use-module (oop goops)
|
||||||
:export (x y ...))
|
:export (x y ...))
|
||||||
|
@ -1502,7 +1502,7 @@ all generic functions sharing a common name:
|
||||||
:use-module (math 2D-vectors)
|
:use-module (math 2D-vectors)
|
||||||
:use-module (math 3D-vectors)
|
:use-module (math 3D-vectors)
|
||||||
:duplicates merge-generics)
|
:duplicates merge-generics)
|
||||||
@end smalllisp
|
@end lisp
|
||||||
|
|
||||||
The generic function @code{x} in @code{(my-module)} will now share
|
The generic function @code{x} in @code{(my-module)} will now share
|
||||||
methods with @code{x} in both imported modules.
|
methods with @code{x} in both imported modules.
|
||||||
|
@ -1534,9 +1534,9 @@ adding it to the ancestor.
|
||||||
If duplicates checking is desired in the above example, the following
|
If duplicates checking is desired in the above example, the following
|
||||||
form of the @code{:duplicates} option can be used instead:
|
form of the @code{:duplicates} option can be used instead:
|
||||||
|
|
||||||
@smalllisp
|
@lisp
|
||||||
:duplicates (merge-generics check)
|
:duplicates (merge-generics check)
|
||||||
@end smalllisp
|
@end lisp
|
||||||
|
|
||||||
@node Generic Function Internals
|
@node Generic Function Internals
|
||||||
@subsubsection Generic Function Internals
|
@subsubsection Generic Function Internals
|
||||||
|
|
|
@ -94,11 +94,11 @@ we are going to call the function @code{init_bessel} which will make
|
||||||
@file{.so} when invoking @code{load-extension}. The right extension for
|
@file{.so} when invoking @code{load-extension}. The right extension for
|
||||||
the host platform will be provided automatically.
|
the host platform will be provided automatically.
|
||||||
|
|
||||||
@smalllisp
|
@lisp
|
||||||
(load-extension "libguile-bessel" "init_bessel")
|
(load-extension "libguile-bessel" "init_bessel")
|
||||||
(j0 2)
|
(j0 2)
|
||||||
@result{} 0.223890779141236
|
@result{} 0.223890779141236
|
||||||
@end smalllisp
|
@end lisp
|
||||||
|
|
||||||
For this to work, @code{load-extension} must be able to find
|
For this to work, @code{load-extension} must be able to find
|
||||||
@file{libguile-bessel}, of course. It will look in the places that
|
@file{libguile-bessel}, of course. It will look in the places that
|
||||||
|
|
|
@ -2072,9 +2072,9 @@ The following procedures are similar to the @code{popen} and
|
||||||
@code{pclose} system routines. The code is in a separate ``popen''
|
@code{pclose} system routines. The code is in a separate ``popen''
|
||||||
module:
|
module:
|
||||||
|
|
||||||
@smalllisp
|
@lisp
|
||||||
(use-modules (ice-9 popen))
|
(use-modules (ice-9 popen))
|
||||||
@end smalllisp
|
@end lisp
|
||||||
|
|
||||||
@findex popen
|
@findex popen
|
||||||
@deffn {Scheme Procedure} open-pipe command mode
|
@deffn {Scheme Procedure} open-pipe command mode
|
||||||
|
|
|
@ -14,9 +14,9 @@ call to that procedure is reported to the user during a program run.
|
||||||
The idea is that you can mark a collection of procedures for tracing,
|
The idea is that you can mark a collection of procedures for tracing,
|
||||||
and Guile will subsequently print out a line of the form
|
and Guile will subsequently print out a line of the form
|
||||||
|
|
||||||
@smalllisp
|
@lisp
|
||||||
| | [@var{procedure} @var{args} @dots{}]
|
| | [@var{procedure} @var{args} @dots{}]
|
||||||
@end smalllisp
|
@end lisp
|
||||||
|
|
||||||
whenever a marked procedure is about to be applied to its arguments.
|
whenever a marked procedure is about to be applied to its arguments.
|
||||||
This can help a programmer determine whether a function is being called
|
This can help a programmer determine whether a function is being called
|
||||||
|
@ -27,7 +27,7 @@ how the traced applications are or are not tail recursive with respect
|
||||||
to each other. Thus, a trace of a non-tail recursive factorial
|
to each other. Thus, a trace of a non-tail recursive factorial
|
||||||
implementation looks like this:
|
implementation looks like this:
|
||||||
|
|
||||||
@smalllisp
|
@lisp
|
||||||
[fact1 4]
|
[fact1 4]
|
||||||
| [fact1 3]
|
| [fact1 3]
|
||||||
| | [fact1 2]
|
| | [fact1 2]
|
||||||
|
@ -38,11 +38,11 @@ implementation looks like this:
|
||||||
| | 2
|
| | 2
|
||||||
| 6
|
| 6
|
||||||
24
|
24
|
||||||
@end smalllisp
|
@end lisp
|
||||||
|
|
||||||
While a typical tail recursive implementation would look more like this:
|
While a typical tail recursive implementation would look more like this:
|
||||||
|
|
||||||
@smalllisp
|
@lisp
|
||||||
[fact2 4]
|
[fact2 4]
|
||||||
[facti 1 4]
|
[facti 1 4]
|
||||||
[facti 4 3]
|
[facti 4 3]
|
||||||
|
@ -50,7 +50,7 @@ While a typical tail recursive implementation would look more like this:
|
||||||
[facti 24 1]
|
[facti 24 1]
|
||||||
[facti 24 0]
|
[facti 24 0]
|
||||||
24
|
24
|
||||||
@end smalllisp
|
@end lisp
|
||||||
|
|
||||||
@deffn {Scheme Procedure} trace procedure
|
@deffn {Scheme Procedure} trace procedure
|
||||||
Enable tracing for @code{procedure}. While a program is being run,
|
Enable tracing for @code{procedure}. While a program is being run,
|
||||||
|
|
|
@ -19,8 +19,8 @@ For information about scsh see
|
||||||
|
|
||||||
The closest emulation of scsh can be obtained by running:
|
The closest emulation of scsh can be obtained by running:
|
||||||
|
|
||||||
@smalllisp
|
@lisp
|
||||||
(load-from-path "scsh/init")
|
(load-from-path "scsh/init")
|
||||||
@end smalllisp
|
@end lisp
|
||||||
|
|
||||||
See the USAGE file supplied with guile-scsh for more details.
|
See the USAGE file supplied with guile-scsh for more details.
|
||||||
|
|
|
@ -11,9 +11,9 @@
|
||||||
Before the SLIB facilities can be used, the following Scheme expression
|
Before the SLIB facilities can be used, the following Scheme expression
|
||||||
must be executed:
|
must be executed:
|
||||||
|
|
||||||
@smalllisp
|
@lisp
|
||||||
(use-modules (ice-9 slib))
|
(use-modules (ice-9 slib))
|
||||||
@end smalllisp
|
@end lisp
|
||||||
|
|
||||||
@findex require
|
@findex require
|
||||||
@code{require} can then be used in the usual way (@pxref{Require,,,
|
@code{require} can then be used in the usual way (@pxref{Require,,,
|
||||||
|
@ -103,11 +103,11 @@ It is usually installed as an extra package in SLIB.
|
||||||
|
|
||||||
You can use Guile's interface to SLIB to invoke Jacal:
|
You can use Guile's interface to SLIB to invoke Jacal:
|
||||||
|
|
||||||
@smalllisp
|
@lisp
|
||||||
(use-modules (ice-9 slib))
|
(use-modules (ice-9 slib))
|
||||||
(slib:load "math")
|
(slib:load "math")
|
||||||
(math)
|
(math)
|
||||||
@end smalllisp
|
@end lisp
|
||||||
|
|
||||||
@noindent
|
@noindent
|
||||||
For complete documentation on Jacal, please read the Jacal manual. If
|
For complete documentation on Jacal, please read the Jacal manual. If
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue