Bump version to 1.2.
[bpt/guile.git] / NEWS
CommitLineData
f7b47737
JB
1Guile NEWS --- history of user-visible changes. -*- text -*-
2Copyright (C) 1996, 1997 Free Software Foundation, Inc.
5c54da76
JB
3See the end for copying conditions.
4
16f2ebea 5Please send Guile bug reports to bug-guile@prep.ai.mit.edu.
5c54da76 6\f
737c9113 7Changes in Guile 1.2:
cf78e9e8 8
737c9113
JB
9[[trim out any sections we don't need]]
10
11* Changes to the distribution
12
832b09ed
JB
13** Nightly snapshots are now available from ftp.red-bean.com.
14The old server, ftp.cyclic.com, has been relinquished to its rightful
15owner.
16
17Nightly snapshots of the Guile development sources are now available via
18anonymous FTP from ftp.red-bean.com, as /pub/guile/guile-snap.tar.gz.
19
20Via the web, that's: ftp://ftp.red-bean.com/pub/guile/guile-snap.tar.gz
21For getit, that's: ftp.red-bean.com:/pub/guile/guile-snap.tar.gz
22
0fcab5ed
JB
23** To run Guile without installing it, the procedure has changed a bit.
24
25If you used a separate build directory to compile Guile, you'll need
26to include the build directory in SCHEME_LOAD_PATH, as well as the
27source directory. See the `INSTALL' file for examples.
28
737c9113
JB
29* Changes to the procedure for linking libguile with your programs
30
0fcab5ed 31** Like Guile 1.0, Guile 1.2 will now use the Rx regular expression
27590f82
JB
32library, if it is installed on your system. When you are linking
33libguile into your own programs, this means you will have to link
34against -lguile, -lqt (if you configured Guile with thread support),
35and -lrx.
36
37If you are using autoconf to generate configuration scripts for your
38application, the following lines should suffice to add the appropriate
39libraries to your link command:
40
41### Find Rx, quickthreads and libguile.
42AC_CHECK_LIB(rx, main)
43AC_CHECK_LIB(qt, main)
44AC_CHECK_LIB(guile, scm_shell)
45
b83b8bee
JB
46* Changes to Scheme functions and syntax
47
e035e7e6
MV
48** The dynamic linking features of Guile are now enabled by default.
49You can disable them by giving the `--disable-dynamic-linking' option
50to configure.
51
e035e7e6
MV
52 (dynamic-link FILENAME)
53
54 Find the object file denoted by FILENAME (a string) and link it
55 into the running Guile application. When everything works out,
56 return a Scheme object suitable for representing the linked object
57 file. Otherwise an error is thrown. How object files are
58 searched is system dependent.
59
60 (dynamic-object? VAL)
61
62 Determine whether VAL represents a dynamically linked object file.
63
64 (dynamic-unlink DYNOBJ)
65
66 Unlink the indicated object file from the application. DYNOBJ
67 should be one of the values returned by `dynamic-link'.
68
69 (dynamic-func FUNCTION DYNOBJ)
70
71 Search the C function indicated by FUNCTION (a string or symbol)
72 in DYNOBJ and return some Scheme object that can later be used
73 with `dynamic-call' to actually call this function. Right now,
74 these Scheme objects are formed by casting the address of the
75 function to `long' and converting this number to its Scheme
76 representation.
77
78 (dynamic-call FUNCTION DYNOBJ)
79
80 Call the C function indicated by FUNCTION and DYNOBJ. The
81 function is passed no arguments and its return value is ignored.
82 When FUNCTION is something returned by `dynamic-func', call that
83 function and ignore DYNOBJ. When FUNCTION is a string (or symbol,
84 etc.), look it up in DYNOBJ; this is equivalent to
85
86 (dynamic-call (dynamic-func FUNCTION DYNOBJ) #f)
87
88 Interrupts are deferred while the C function is executing (with
89 SCM_DEFER_INTS/SCM_ALLOW_INTS).
90
91 (dynamic-args-call FUNCTION DYNOBJ ARGS)
92
93 Call the C function indicated by FUNCTION and DYNOBJ, but pass it
94 some arguments and return its return value. The C function is
95 expected to take two arguments and return an `int', just like
96 `main':
97
98 int c_func (int argc, char **argv);
99
100 ARGS must be a list of strings and is converted into an array of
101 `char *'. The array is passed in ARGV and its size in ARGC. The
102 return value is converted to a Scheme number and returned from the
103 call to `dynamic-args-call'.
104
0fcab5ed
JB
105When dynamic linking is disabled or not supported on your system,
106the above functions throw errors, but they are still available.
107
e035e7e6
MV
108Here is a small example that works on GNU/Linux:
109
110 (define libc-obj (dynamic-link "libc.so"))
111 (dynamic-args-call 'rand libc-obj '())
112
113See the file `libguile/DYNAMIC-LINKING' for additional comments.
114
27590f82
JB
115** The #/ syntax for module names is depreciated, and will be removed
116in a future version of Guile. Instead of
117
118 #/foo/bar/baz
119
120instead write
121
122 (foo bar baz)
123
124The latter syntax is more consistent with existing Lisp practice.
125
5dade857
MV
126** Guile now does fancier printing of structures. Structures are the
127underlying implementation for records, which in turn are used to
128implement modules, so all of these object now print differently and in
129a more informative way.
130
161029df
JB
131The Scheme printer will examine the builtin variable *struct-printer*
132whenever it needs to print a structure object. When this variable is
133not `#f' it is deemed to be a procedure and will be applied to the
134structure object and the output port. When *struct-printer* is `#f'
135or the procedure return `#f' the structure object will be printed in
136the boring #<struct 80458270> form.
5dade857
MV
137
138This hook is used by some routines in ice-9/boot-9.scm to implement
139type specific printing routines. Please read the comments there about
140"printing structs".
141
142One of the more specific uses of structs are records. The printing
143procedure that could be passed to MAKE-RECORD-TYPE is now actually
144called. It should behave like a *struct-printer* procedure (described
145above).
146
b83b8bee
JB
147** Guile now supports a new R4RS-compliant syntax for keywords. A
148token of the form #:NAME, where NAME has the same syntax as a Scheme
149symbol, is the external representation of the keyword named NAME.
150Keyword objects print using this syntax as well, so values containing
1e5afba0
JB
151keyword objects can be read back into Guile. When used in an
152expression, keywords are self-quoting objects.
b83b8bee
JB
153
154Guile suports this read syntax, and uses this print syntax, regardless
155of the current setting of the `keyword' read option. The `keyword'
156read option only controls whether Guile recognizes the `:NAME' syntax,
157which is incompatible with R4RS. (R4RS says such token represent
158symbols.)
737c9113
JB
159
160** Guile has regular expression support again. Guile 1.0 included
161functions for matching regular expressions, based on the Rx library.
162In Guile 1.1, the Guile/Rx interface was removed to simplify the
163distribution, and thus Guile had no regular expression support. Guile
1641.2 now adds back the most commonly used functions, and supports all
165of SCSH's regular expression functions. They are:
166
9e2310a8
JB
167*** [[get stuff from Tim's documentation]]
168*** [[mention the regexp/mumble flags]]
169
2409cdfa
JB
170** Guile now provides information on how it was built, via the new
171global variable, %guile-build-info. This variable records the values
172of the standard GNU makefile directory variables as an assocation
173list, mapping variable names (symbols) onto directory paths (strings).
174For example, to find out where the Guile link libraries were
175installed, you can say:
176
177guile -c "(display (assq-ref %guile-build-info 'libdir)) (newline)"
178
179
737c9113
JB
180* Changes to the gh_ interface
181
182* Changes to the scm_ interface
cf78e9e8 183
161029df
JB
184** The new function scm_handle_by_message_noexit is just like the
185existing scm_handle_by_message function, except that it doesn't call
186exit to terminate the process. Instead, it prints a message and just
187returns #f. This might be a more appropriate catch-all handler for
188new dynamic roots and threads.
189
e1a191a8
GH
190* Changes to system call interfaces:
191
192** The value returned by `raise' is now unspecified. It throws an exception
193if an error occurs.
194
195** A new procedure `sigaction' can be used to install signal handlers
115b09a5
GH
196
197(sigaction signum [action] [flags])
198
199signum is the signal number, which can be specified using the value
200of SIGINT etc.
201
202If action is omitted, sigaction returns a pair: the CAR is the current
203signal hander, which will be either an integer with the value SIG_DFL
204(default action) or SIG_IGN (ignore), or the Scheme procedure which
205handles the signal, or #f if a non-Scheme procedure handles the
206signal. The CDR contains the current sigaction flags for the handler.
207
208If action is provided, it is installed as the new handler for signum.
209action can be a Scheme procedure taking one argument, or the value of
210SIG_DFL (default action) or SIG_IGN (ignore), or #f to restore
211whatever signal handler was installed before sigaction was first used.
212Flags can optionally be specified for the new handler (SA_RESTART is
213always used if the system provides it, so need not be specified.) The
214return value is a pair with information about the old handler as
215described above.
216
217This interface does not provide access to the "signal blocking"
218facility. Maybe this is not needed, since the thread support may
219provide solutions to the problem of consistent access to data
220structures.
e1a191a8 221
89ea5b7c
GH
222** A new procedure `flush-all-ports' is equivalent to running
223`force-output' on every port open for output.
224
cf78e9e8
JB
225\f
226Changes in Guile 1.1 (Fri May 16 1997):
f3b1485f
JB
227
228* Changes to the distribution.
229
230The Guile 1.0 distribution has been split up into several smaller
231pieces:
232guile-core --- the Guile interpreter itself.
233guile-tcltk --- the interface between the Guile interpreter and
234 Tcl/Tk; Tcl is an interpreter for a stringy language, and Tk
235 is a toolkit for building graphical user interfaces.
236guile-rgx-ctax --- the interface between Guile and the Rx regular
237 expression matcher, and the translator for the Ctax
238 programming language. These are packaged together because the
239 Ctax translator uses Rx to parse Ctax source code.
240
095936d2
JB
241This NEWS file describes the changes made to guile-core since the 1.0
242release.
243
48d224d7
JB
244We no longer distribute the documentation, since it was either out of
245date, or incomplete. As soon as we have current documentation, we
246will distribute it.
247
0fcab5ed
JB
248
249
f3b1485f
JB
250* Changes to the stand-alone interpreter
251
48d224d7
JB
252** guile now accepts command-line arguments compatible with SCSH, Olin
253Shivers' Scheme Shell.
254
255In general, arguments are evaluated from left to right, but there are
256exceptions. The following switches stop argument processing, and
257stash all remaining command-line arguments as the value returned by
258the (command-line) function.
259 -s SCRIPT load Scheme source code from FILE, and exit
260 -c EXPR evalute Scheme expression EXPR, and exit
261 -- stop scanning arguments; run interactively
262
263The switches below are processed as they are encountered.
264 -l FILE load Scheme source code from FILE
265 -e FUNCTION after reading script, apply FUNCTION to
266 command line arguments
267 -ds do -s script at this point
268 --emacs enable Emacs protocol (experimental)
269 -h, --help display this help and exit
270 -v, --version display version information and exit
271 \ read arguments from following script lines
272
273So, for example, here is a Guile script named `ekko' (thanks, Olin)
274which re-implements the traditional "echo" command:
275
276#!/usr/local/bin/guile -s
277!#
278(define (main args)
279 (map (lambda (arg) (display arg) (display " "))
280 (cdr args))
281 (newline))
282
283(main (command-line))
284
285Suppose we invoke this script as follows:
286
287 ekko a speckled gecko
288
289Through the magic of Unix script processing (triggered by the `#!'
290token at the top of the file), /usr/local/bin/guile receives the
291following list of command-line arguments:
292
293 ("-s" "./ekko" "a" "speckled" "gecko")
294
295Unix inserts the name of the script after the argument specified on
296the first line of the file (in this case, "-s"), and then follows that
297with the arguments given to the script. Guile loads the script, which
298defines the `main' function, and then applies it to the list of
299remaining command-line arguments, ("a" "speckled" "gecko").
300
095936d2
JB
301In Unix, the first line of a script file must take the following form:
302
303#!INTERPRETER ARGUMENT
304
305where INTERPRETER is the absolute filename of the interpreter
306executable, and ARGUMENT is a single command-line argument to pass to
307the interpreter.
308
309You may only pass one argument to the interpreter, and its length is
310limited. These restrictions can be annoying to work around, so Guile
311provides a general mechanism (borrowed from, and compatible with,
312SCSH) for circumventing them.
313
314If the ARGUMENT in a Guile script is a single backslash character,
315`\', Guile will open the script file, parse arguments from its second
316and subsequent lines, and replace the `\' with them. So, for example,
317here is another implementation of the `ekko' script:
318
319#!/usr/local/bin/guile \
320-e main -s
321!#
322(define (main args)
323 (for-each (lambda (arg) (display arg) (display " "))
324 (cdr args))
325 (newline))
326
327If the user invokes this script as follows:
328
329 ekko a speckled gecko
330
331Unix expands this into
332
333 /usr/local/bin/guile \ ekko a speckled gecko
334
335When Guile sees the `\' argument, it replaces it with the arguments
336read from the second line of the script, producing:
337
338 /usr/local/bin/guile -e main -s ekko a speckled gecko
339
340This tells Guile to load the `ekko' script, and apply the function
341`main' to the argument list ("a" "speckled" "gecko").
342
343Here is how Guile parses the command-line arguments:
344- Each space character terminates an argument. This means that two
345 spaces in a row introduce an empty-string argument.
346- The tab character is not permitted (unless you quote it with the
347 backslash character, as described below), to avoid confusion.
348- The newline character terminates the sequence of arguments, and will
349 also terminate a final non-empty argument. (However, a newline
350 following a space will not introduce a final empty-string argument;
351 it only terminates the argument list.)
352- The backslash character is the escape character. It escapes
353 backslash, space, tab, and newline. The ANSI C escape sequences
354 like \n and \t are also supported. These produce argument
355 constituents; the two-character combination \n doesn't act like a
356 terminating newline. The escape sequence \NNN for exactly three
357 octal digits reads as the character whose ASCII code is NNN. As
358 above, characters produced this way are argument constituents.
359 Backslash followed by other characters is not allowed.
360
48d224d7
JB
361* Changes to the procedure for linking libguile with your programs
362
363** Guile now builds and installs a shared guile library, if your
364system support shared libraries. (It still builds a static library on
365all systems.) Guile automatically detects whether your system
366supports shared libraries. To prevent Guile from buildisg shared
367libraries, pass the `--disable-shared' flag to the configure script.
368
369Guile takes longer to compile when it builds shared libraries, because
370it must compile every file twice --- once to produce position-
371independent object code, and once to produce normal object code.
372
373** The libthreads library has been merged into libguile.
374
375To link a program against Guile, you now need only link against
376-lguile and -lqt; -lthreads is no longer needed. If you are using
377autoconf to generate configuration scripts for your application, the
378following lines should suffice to add the appropriate libraries to
379your link command:
380
381### Find quickthreads and libguile.
382AC_CHECK_LIB(qt, main)
383AC_CHECK_LIB(guile, scm_shell)
f3b1485f
JB
384
385* Changes to Scheme functions
386
095936d2
JB
387** Guile Scheme's special syntax for keyword objects is now optional,
388and disabled by default.
389
390The syntax variation from R4RS made it difficult to port some
391interesting packages to Guile. The routines which accepted keyword
392arguments (mostly in the module system) have been modified to also
393accept symbols whose names begin with `:'.
394
395To change the keyword syntax, you must first import the (ice-9 debug)
396module:
397 (use-modules (ice-9 debug))
398
399Then you can enable the keyword syntax as follows:
400 (read-set! keywords 'prefix)
401
402To disable keyword syntax, do this:
403 (read-set! keywords #f)
404
405** Many more primitive functions accept shared substrings as
406arguments. In the past, these functions required normal, mutable
407strings as arguments, although they never made use of this
408restriction.
409
410** The uniform array functions now operate on byte vectors. These
411functions are `array-fill!', `serial-array-copy!', `array-copy!',
412`serial-array-map', `array-map', `array-for-each', and
413`array-index-map!'.
414
415** The new functions `trace' and `untrace' implement simple debugging
416support for Scheme functions.
417
418The `trace' function accepts any number of procedures as arguments,
419and tells the Guile interpreter to display each procedure's name and
420arguments each time the procedure is invoked. When invoked with no
421arguments, `trace' returns the list of procedures currently being
422traced.
423
424The `untrace' function accepts any number of procedures as arguments,
425and tells the Guile interpreter not to trace them any more. When
426invoked with no arguments, `untrace' untraces all curretly traced
427procedures.
428
429The tracing in Guile has an advantage over most other systems: we
430don't create new procedure objects, but mark the procedure objects
431themselves. This means that anonymous and internal procedures can be
432traced.
433
434** The function `assert-repl-prompt' has been renamed to
435`set-repl-prompt!'. It takes one argument, PROMPT.
436- If PROMPT is #f, the Guile read-eval-print loop will not prompt.
437- If PROMPT is a string, we use it as a prompt.
438- If PROMPT is a procedure accepting no arguments, we call it, and
439 display the result as a prompt.
440- Otherwise, we display "> ".
441
442** The new function `eval-string' reads Scheme expressions from a
443string and evaluates them, returning the value of the last expression
444in the string. If the string contains no expressions, it returns an
445unspecified value.
446
447** The new function `thunk?' returns true iff its argument is a
448procedure of zero arguments.
449
450** `defined?' is now a builtin function, instead of syntax. This
451means that its argument should be quoted. It returns #t iff its
452argument is bound in the current module.
453
454** The new syntax `use-modules' allows you to add new modules to your
455environment without re-typing a complete `define-module' form. It
456accepts any number of module names as arguments, and imports their
457public bindings into the current module.
458
459** The new function (module-defined? NAME MODULE) returns true iff
460NAME, a symbol, is defined in MODULE, a module object.
461
462** The new function `builtin-bindings' creates and returns a hash
463table containing copies of all the root module's bindings.
464
465** The new function `builtin-weak-bindings' does the same as
466`builtin-bindings', but creates a doubly-weak hash table.
467
468** The `equal?' function now considers variable objects to be
469equivalent if they have the same name and the same value.
470
471** The new function `command-line' returns the command-line arguments
472given to Guile, as a list of strings.
473
474When using guile as a script interpreter, `command-line' returns the
475script's arguments; those processed by the interpreter (like `-s' or
476`-c') are omitted. (In other words, you get the normal, expected
477behavior.) Any application that uses scm_shell to process its
478command-line arguments gets this behavior as well.
479
480** The new function `load-user-init' looks for a file called `.guile'
481in the user's home directory, and loads it if it exists. This is
482mostly for use by the code generated by scm_compile_shell_switches,
483but we thought it might also be useful in other circumstances.
484
485** The new function `log10' returns the base-10 logarithm of its
486argument.
487
488** Changes to I/O functions
489
490*** The functions `read', `primitive-load', `read-and-eval!', and
491`primitive-load-path' no longer take optional arguments controlling
492case insensitivity and a `#' parser.
493
494Case sensitivity is now controlled by a read option called
495`case-insensitive'. The user can add new `#' syntaxes with the
496`read-hash-extend' function (see below).
497
498*** The new function `read-hash-extend' allows the user to change the
499syntax of Guile Scheme in a somewhat controlled way.
500
501(read-hash-extend CHAR PROC)
502 When parsing S-expressions, if we read a `#' character followed by
503 the character CHAR, use PROC to parse an object from the stream.
504 If PROC is #f, remove any parsing procedure registered for CHAR.
505
506 The reader applies PROC to two arguments: CHAR and an input port.
507
508*** The new functions read-delimited and read-delimited! provide a
509general mechanism for doing delimited input on streams.
510
511(read-delimited DELIMS [PORT HANDLE-DELIM])
512 Read until we encounter one of the characters in DELIMS (a string),
513 or end-of-file. PORT is the input port to read from; it defaults to
514 the current input port. The HANDLE-DELIM parameter determines how
515 the terminating character is handled; it should be one of the
516 following symbols:
517
518 'trim omit delimiter from result
519 'peek leave delimiter character in input stream
520 'concat append delimiter character to returned value
521 'split return a pair: (RESULT . TERMINATOR)
522
523 HANDLE-DELIM defaults to 'peek.
524
525(read-delimited! DELIMS BUF [PORT HANDLE-DELIM START END])
526 A side-effecting variant of `read-delimited'.
527
528 The data is written into the string BUF at the indices in the
529 half-open interval [START, END); the default interval is the whole
530 string: START = 0 and END = (string-length BUF). The values of
531 START and END must specify a well-defined interval in BUF, i.e.
532 0 <= START <= END <= (string-length BUF).
533
534 It returns NBYTES, the number of bytes read. If the buffer filled
535 up without a delimiter character being found, it returns #f. If the
536 port is at EOF when the read starts, it returns the EOF object.
537
538 If an integer is returned (i.e., the read is successfully terminated
539 by reading a delimiter character), then the HANDLE-DELIM parameter
540 determines how to handle the terminating character. It is described
541 above, and defaults to 'peek.
542
543(The descriptions of these functions were borrowed from the SCSH
544manual, by Olin Shivers and Brian Carlstrom.)
545
546*** The `%read-delimited!' function is the primitive used to implement
547`read-delimited' and `read-delimited!'.
548
549(%read-delimited! DELIMS BUF GOBBLE? [PORT START END])
550
551This returns a pair of values: (TERMINATOR . NUM-READ).
552- TERMINATOR describes why the read was terminated. If it is a
553 character or the eof object, then that is the value that terminated
554 the read. If it is #f, the function filled the buffer without finding
555 a delimiting character.
556- NUM-READ is the number of characters read into BUF.
557
558If the read is successfully terminated by reading a delimiter
559character, then the gobble? parameter determines what to do with the
560terminating character. If true, the character is removed from the
561input stream; if false, the character is left in the input stream
562where a subsequent read operation will retrieve it. In either case,
563the character is also the first value returned by the procedure call.
564
565(The descriptions of this function was borrowed from the SCSH manual,
566by Olin Shivers and Brian Carlstrom.)
567
568*** The `read-line' and `read-line!' functions have changed; they now
569trim the terminator by default; previously they appended it to the
570returned string. For the old behavior, use (read-line PORT 'concat).
571
572*** The functions `uniform-array-read!' and `uniform-array-write!' now
573take new optional START and END arguments, specifying the region of
574the array to read and write.
575
f348c807
JB
576*** The `ungetc-char-ready?' function has been removed. We feel it's
577inappropriate for an interface to expose implementation details this
578way.
095936d2
JB
579
580** Changes to the Unix library and system call interface
581
582*** The new fcntl function provides access to the Unix `fcntl' system
583call.
584
585(fcntl PORT COMMAND VALUE)
586 Apply COMMAND to PORT's file descriptor, with VALUE as an argument.
587 Values for COMMAND are:
588
589 F_DUPFD duplicate a file descriptor
590 F_GETFD read the descriptor's close-on-exec flag
591 F_SETFD set the descriptor's close-on-exec flag to VALUE
592 F_GETFL read the descriptor's flags, as set on open
593 F_SETFL set the descriptor's flags, as set on open to VALUE
594 F_GETOWN return the process ID of a socket's owner, for SIGIO
595 F_SETOWN set the process that owns a socket to VALUE, for SIGIO
596 FD_CLOEXEC not sure what this is
597
598For details, see the documentation for the fcntl system call.
599
600*** The arguments to `select' have changed, for compatibility with
601SCSH. The TIMEOUT parameter may now be non-integral, yielding the
602expected behavior. The MILLISECONDS parameter has been changed to
603MICROSECONDS, to more closely resemble the underlying system call.
604The RVEC, WVEC, and EVEC arguments can now be vectors; the type of the
605corresponding return set will be the same.
606
607*** The arguments to the `mknod' system call have changed. They are
608now:
609
610(mknod PATH TYPE PERMS DEV)
611 Create a new file (`node') in the file system. PATH is the name of
612 the file to create. TYPE is the kind of file to create; it should
613 be 'fifo, 'block-special, or 'char-special. PERMS specifies the
614 permission bits to give the newly created file. If TYPE is
615 'block-special or 'char-special, DEV specifies which device the
616 special file refers to; its interpretation depends on the kind of
617 special file being created.
618
619*** The `fork' function has been renamed to `primitive-fork', to avoid
620clashing with various SCSH forks.
621
622*** The `recv' and `recvfrom' functions have been renamed to `recv!'
623and `recvfrom!'. They no longer accept a size for a second argument;
624you must pass a string to hold the received value. They no longer
625return the buffer. Instead, `recv' returns the length of the message
626received, and `recvfrom' returns a pair containing the packet's length
627and originating address.
628
629*** The file descriptor datatype has been removed, as have the
630`read-fd', `write-fd', `close', `lseek', and `dup' functions.
631We plan to replace these functions with a SCSH-compatible interface.
632
633*** The `create' function has been removed; it's just a special case
634of `open'.
635
636*** There are new functions to break down process termination status
637values. In the descriptions below, STATUS is a value returned by
638`waitpid'.
639
640(status:exit-val STATUS)
641 If the child process exited normally, this function returns the exit
642 code for the child process (i.e., the value passed to exit, or
643 returned from main). If the child process did not exit normally,
644 this function returns #f.
645
646(status:stop-sig STATUS)
647 If the child process was suspended by a signal, this function
648 returns the signal that suspended the child. Otherwise, it returns
649 #f.
650
651(status:term-sig STATUS)
652 If the child process terminated abnormally, this function returns
653 the signal that terminated the child. Otherwise, this function
654 returns false.
655
656POSIX promises that exactly one of these functions will return true on
657a valid STATUS value.
658
659These functions are compatible with SCSH.
660
661*** There are new accessors and setters for the broken-out time vectors
48d224d7
JB
662returned by `localtime', `gmtime', and that ilk. They are:
663
664 Component Accessor Setter
665 ========================= ============ ============
666 seconds tm:sec set-tm:sec
667 minutes tm:min set-tm:min
668 hours tm:hour set-tm:hour
669 day of the month tm:mday set-tm:mday
670 month tm:mon set-tm:mon
671 year tm:year set-tm:year
672 day of the week tm:wday set-tm:wday
673 day in the year tm:yday set-tm:yday
674 daylight saving time tm:isdst set-tm:isdst
675 GMT offset, seconds tm:gmtoff set-tm:gmtoff
676 name of time zone tm:zone set-tm:zone
677
095936d2
JB
678*** There are new accessors for the vectors returned by `uname',
679describing the host system:
48d224d7
JB
680
681 Component Accessor
682 ============================================== ================
683 name of the operating system implementation utsname:sysname
684 network name of this machine utsname:nodename
685 release level of the operating system utsname:release
686 version level of the operating system utsname:version
687 machine hardware platform utsname:machine
688
095936d2
JB
689*** There are new accessors for the vectors returned by `getpw',
690`getpwnam', `getpwuid', and `getpwent', describing entries from the
691system's user database:
692
693 Component Accessor
694 ====================== =================
695 user name passwd:name
696 user password passwd:passwd
697 user id passwd:uid
698 group id passwd:gid
699 real name passwd:gecos
700 home directory passwd:dir
701 shell program passwd:shell
702
703*** There are new accessors for the vectors returned by `getgr',
704`getgrnam', `getgrgid', and `getgrent', describing entries from the
705system's group database:
706
707 Component Accessor
708 ======================= ============
709 group name group:name
710 group password group:passwd
711 group id group:gid
712 group members group:mem
713
714*** There are new accessors for the vectors returned by `gethost',
715`gethostbyaddr', `gethostbyname', and `gethostent', describing
716internet hosts:
717
718 Component Accessor
719 ========================= ===============
720 official name of host hostent:name
721 alias list hostent:aliases
722 host address type hostent:addrtype
723 length of address hostent:length
724 list of addresses hostent:addr-list
725
726*** There are new accessors for the vectors returned by `getnet',
727`getnetbyaddr', `getnetbyname', and `getnetent', describing internet
728networks:
729
730 Component Accessor
731 ========================= ===============
732 official name of net netent:name
733 alias list netent:aliases
734 net number type netent:addrtype
735 net number netent:net
736
737*** There are new accessors for the vectors returned by `getproto',
738`getprotobyname', `getprotobynumber', and `getprotoent', describing
739internet protocols:
740
741 Component Accessor
742 ========================= ===============
743 official protocol name protoent:name
744 alias list protoent:aliases
745 protocol number protoent:proto
746
747*** There are new accessors for the vectors returned by `getserv',
748`getservbyname', `getservbyport', and `getservent', describing
749internet protocols:
750
751 Component Accessor
752 ========================= ===============
753 official service name servent:name
754 alias list servent:aliases
755 port number servent:port
756 protocol to use servent:proto
757
758*** There are new accessors for the sockaddr structures returned by
759`accept', `getsockname', `getpeername', `recvfrom!':
760
761 Component Accessor
762 ======================================== ===============
763 address format (`family') sockaddr:fam
764 path, for file domain addresses sockaddr:path
765 address, for internet domain addresses sockaddr:addr
766 TCP or UDP port, for internet sockaddr:port
767
768*** The `getpwent', `getgrent', `gethostent', `getnetent',
769`getprotoent', and `getservent' functions now return #f at the end of
770the user database. (They used to throw an exception.)
771
772Note that calling MUMBLEent function is equivalent to calling the
773corresponding MUMBLE function with no arguments.
774
775*** The `setpwent', `setgrent', `sethostent', `setnetent',
776`setprotoent', and `setservent' routines now take no arguments.
777
778*** The `gethost', `getproto', `getnet', and `getserv' functions now
779provide more useful information when they throw an exception.
780
781*** The `lnaof' function has been renamed to `inet-lnaof'.
782
783*** Guile now claims to have the `current-time' feature.
784
785*** The `mktime' function now takes an optional second argument ZONE,
786giving the time zone to use for the conversion. ZONE should be a
787string, in the same format as expected for the "TZ" environment variable.
788
789*** The `strptime' function now returns a pair (TIME . COUNT), where
790TIME is the parsed time as a vector, and COUNT is the number of
791characters from the string left unparsed. This function used to
792return the remaining characters as a string.
793
794*** The `gettimeofday' function has replaced the old `time+ticks' function.
795The return value is now (SECONDS . MICROSECONDS); the fractional
796component is no longer expressed in "ticks".
797
798*** The `ticks/sec' constant has been removed, in light of the above change.
6685dc83 799
ea00ecba
MG
800* Changes to the gh_ interface
801
802** gh_eval_str() now returns an SCM object which is the result of the
803evaluation
804
aaef0d2a
MG
805** gh_scm2str() now copies the Scheme data to a caller-provided C
806array
807
808** gh_scm2newstr() now makes a C array, copies the Scheme data to it,
809and returns the array
810
811** gh_scm2str0() is gone: there is no need to distinguish
812null-terminated from non-null-terminated, since gh_scm2newstr() allows
813the user to interpret the data both ways.
814
f3b1485f
JB
815* Changes to the scm_ interface
816
095936d2
JB
817** The new function scm_symbol_value0 provides an easy way to get a
818symbol's value from C code:
819
820SCM scm_symbol_value0 (char *NAME)
821 Return the value of the symbol named by the null-terminated string
822 NAME in the current module. If the symbol named NAME is unbound in
823 the current module, return SCM_UNDEFINED.
824
825** The new function scm_sysintern0 creates new top-level variables,
826without assigning them a value.
827
828SCM scm_sysintern0 (char *NAME)
829 Create a new Scheme top-level variable named NAME. NAME is a
830 null-terminated string. Return the variable's value cell.
831
832** The function scm_internal_catch is the guts of catch. It handles
833all the mechanics of setting up a catch target, invoking the catch
834body, and perhaps invoking the handler if the body does a throw.
835
836The function is designed to be usable from C code, but is general
837enough to implement all the semantics Guile Scheme expects from throw.
838
839TAG is the catch tag. Typically, this is a symbol, but this function
840doesn't actually care about that.
841
842BODY is a pointer to a C function which runs the body of the catch;
843this is the code you can throw from. We call it like this:
844 BODY (BODY_DATA, JMPBUF)
845where:
846 BODY_DATA is just the BODY_DATA argument we received; we pass it
847 through to BODY as its first argument. The caller can make
848 BODY_DATA point to anything useful that BODY might need.
849 JMPBUF is the Scheme jmpbuf object corresponding to this catch,
850 which we have just created and initialized.
851
852HANDLER is a pointer to a C function to deal with a throw to TAG,
853should one occur. We call it like this:
854 HANDLER (HANDLER_DATA, THROWN_TAG, THROW_ARGS)
855where
856 HANDLER_DATA is the HANDLER_DATA argument we recevied; it's the
857 same idea as BODY_DATA above.
858 THROWN_TAG is the tag that the user threw to; usually this is
859 TAG, but it could be something else if TAG was #t (i.e., a
860 catch-all), or the user threw to a jmpbuf.
861 THROW_ARGS is the list of arguments the user passed to the THROW
862 function.
863
864BODY_DATA is just a pointer we pass through to BODY. HANDLER_DATA
865is just a pointer we pass through to HANDLER. We don't actually
866use either of those pointers otherwise ourselves. The idea is
867that, if our caller wants to communicate something to BODY or
868HANDLER, it can pass a pointer to it as MUMBLE_DATA, which BODY and
869HANDLER can then use. Think of it as a way to make BODY and
870HANDLER closures, not just functions; MUMBLE_DATA points to the
871enclosed variables.
872
873Of course, it's up to the caller to make sure that any data a
874MUMBLE_DATA needs is protected from GC. A common way to do this is
875to make MUMBLE_DATA a pointer to data stored in an automatic
876structure variable; since the collector must scan the stack for
877references anyway, this assures that any references in MUMBLE_DATA
878will be found.
879
880** The new function scm_internal_lazy_catch is exactly like
881scm_internal_catch, except:
882
883- It does not unwind the stack (this is the major difference).
884- If handler returns, its value is returned from the throw.
885- BODY always receives #f as its JMPBUF argument (since there's no
886 jmpbuf associated with a lazy catch, because we don't unwind the
887 stack.)
888
889** scm_body_thunk is a new body function you can pass to
890scm_internal_catch if you want the body to be like Scheme's `catch'
891--- a thunk, or a function of one argument if the tag is #f.
892
893BODY_DATA is a pointer to a scm_body_thunk_data structure, which
894contains the Scheme procedure to invoke as the body, and the tag
895we're catching. If the tag is #f, then we pass JMPBUF (created by
896scm_internal_catch) to the body procedure; otherwise, the body gets
897no arguments.
898
899** scm_handle_by_proc is a new handler function you can pass to
900scm_internal_catch if you want the handler to act like Scheme's catch
901--- call a procedure with the tag and the throw arguments.
902
903If the user does a throw to this catch, this function runs a handler
904procedure written in Scheme. HANDLER_DATA is a pointer to an SCM
905variable holding the Scheme procedure object to invoke. It ought to
906be a pointer to an automatic variable (i.e., one living on the stack),
907or the procedure object should be otherwise protected from GC.
908
909** scm_handle_by_message is a new handler function to use with
910`scm_internal_catch' if you want Guile to print a message and die.
911It's useful for dealing with throws to uncaught keys at the top level.
912
913HANDLER_DATA, if non-zero, is assumed to be a char * pointing to a
914message header to print; if zero, we use "guile" instead. That
915text is followed by a colon, then the message described by ARGS.
916
917** The return type of scm_boot_guile is now void; the function does
918not return a value, and indeed, never returns at all.
919
f3b1485f
JB
920** The new function scm_shell makes it easy for user applications to
921process command-line arguments in a way that is compatible with the
922stand-alone guile interpreter (which is in turn compatible with SCSH,
923the Scheme shell).
924
925To use the scm_shell function, first initialize any guile modules
926linked into your application, and then call scm_shell with the values
927of ARGC and ARGV your `main' function received. scm_shell will adding
928any SCSH-style meta-arguments from the top of the script file to the
929argument vector, and then process the command-line arguments. This
930generally means loading a script file or starting up an interactive
931command interpreter. For details, see "Changes to the stand-alone
932interpreter" above.
933
095936d2
JB
934** The new functions scm_get_meta_args and scm_count_argv help you
935implement the SCSH-style meta-argument, `\'.
936
937char **scm_get_meta_args (int ARGC, char **ARGV)
938 If the second element of ARGV is a string consisting of a single
939 backslash character (i.e. "\\" in Scheme notation), open the file
940 named by the following argument, parse arguments from it, and return
941 the spliced command line. The returned array is terminated by a
942 null pointer.
943
944 For details of argument parsing, see above, under "guile now accepts
945 command-line arguments compatible with SCSH..."
946
947int scm_count_argv (char **ARGV)
948 Count the arguments in ARGV, assuming it is terminated by a null
949 pointer.
950
951For an example of how these functions might be used, see the source
952code for the function scm_shell in libguile/script.c.
953
954You will usually want to use scm_shell instead of calling this
955function yourself.
956
957** The new function scm_compile_shell_switches turns an array of
958command-line arguments into Scheme code to carry out the actions they
959describe. Given ARGC and ARGV, it returns a Scheme expression to
960evaluate, and calls scm_set_program_arguments to make any remaining
961command-line arguments available to the Scheme code. For example,
962given the following arguments:
963
964 -e main -s ekko a speckled gecko
965
966scm_set_program_arguments will return the following expression:
967
968 (begin (load "ekko") (main (command-line)) (quit))
969
970You will usually want to use scm_shell instead of calling this
971function yourself.
972
973** The function scm_shell_usage prints a usage message appropriate for
974an interpreter that uses scm_compile_shell_switches to handle its
975command-line arguments.
976
977void scm_shell_usage (int FATAL, char *MESSAGE)
978 Print a usage message to the standard error output. If MESSAGE is
979 non-zero, write it before the usage message, followed by a newline.
980 If FATAL is non-zero, exit the process, using FATAL as the
981 termination status. (If you want to be compatible with Guile,
982 always use 1 as the exit status when terminating due to command-line
983 usage problems.)
984
985You will usually want to use scm_shell instead of calling this
986function yourself.
48d224d7
JB
987
988** scm_eval_0str now returns SCM_UNSPECIFIED if the string contains no
095936d2
JB
989expressions. It used to return SCM_EOL. Earth-shattering.
990
991** The macros for declaring scheme objects in C code have been
992rearranged slightly. They are now:
993
994SCM_SYMBOL (C_NAME, SCHEME_NAME)
995 Declare a static SCM variable named C_NAME, and initialize it to
996 point to the Scheme symbol whose name is SCHEME_NAME. C_NAME should
997 be a C identifier, and SCHEME_NAME should be a C string.
998
999SCM_GLOBAL_SYMBOL (C_NAME, SCHEME_NAME)
1000 Just like SCM_SYMBOL, but make C_NAME globally visible.
1001
1002SCM_VCELL (C_NAME, SCHEME_NAME)
1003 Create a global variable at the Scheme level named SCHEME_NAME.
1004 Declare a static SCM variable named C_NAME, and initialize it to
1005 point to the Scheme variable's value cell.
1006
1007SCM_GLOBAL_VCELL (C_NAME, SCHEME_NAME)
1008 Just like SCM_VCELL, but make C_NAME globally visible.
1009
1010The `guile-snarf' script writes initialization code for these macros
1011to its standard output, given C source code as input.
1012
1013The SCM_GLOBAL macro is gone.
1014
1015** The scm_read_line and scm_read_line_x functions have been replaced
1016by Scheme code based on the %read-delimited! procedure (known to C
1017code as scm_read_delimited_x). See its description above for more
1018information.
48d224d7 1019
095936d2
JB
1020** The function scm_sys_open has been renamed to scm_open. It now
1021returns a port instead of an FD object.
ea00ecba 1022
095936d2
JB
1023* The dynamic linking support has changed. For more information, see
1024libguile/DYNAMIC-LINKING.
ea00ecba 1025
f7b47737
JB
1026\f
1027Guile 1.0b3
3065a62a 1028
f3b1485f
JB
1029User-visible changes from Thursday, September 5, 1996 until Guile 1.0
1030(Sun 5 Jan 1997):
3065a62a 1031
4b521edb 1032* Changes to the 'guile' program:
3065a62a 1033
4b521edb
JB
1034** Guile now loads some new files when it starts up. Guile first
1035searches the load path for init.scm, and loads it if found. Then, if
1036Guile is not being used to execute a script, and the user's home
1037directory contains a file named `.guile', Guile loads that.
c6486f8a 1038
4b521edb 1039** You can now use Guile as a shell script interpreter.
3065a62a
JB
1040
1041To paraphrase the SCSH manual:
1042
1043 When Unix tries to execute an executable file whose first two
1044 characters are the `#!', it treats the file not as machine code to
1045 be directly executed by the native processor, but as source code
1046 to be executed by some interpreter. The interpreter to use is
1047 specified immediately after the #! sequence on the first line of
1048 the source file. The kernel reads in the name of the interpreter,
1049 and executes that instead. It passes the interpreter the source
1050 filename as its first argument, with the original arguments
1051 following. Consult the Unix man page for the `exec' system call
1052 for more information.
1053
1a1945be
JB
1054Now you can use Guile as an interpreter, using a mechanism which is a
1055compatible subset of that provided by SCSH.
1056
3065a62a
JB
1057Guile now recognizes a '-s' command line switch, whose argument is the
1058name of a file of Scheme code to load. It also treats the two
1059characters `#!' as the start of a comment, terminated by `!#'. Thus,
1060to make a file of Scheme code directly executable by Unix, insert the
1061following two lines at the top of the file:
1062
1063#!/usr/local/bin/guile -s
1064!#
1065
1066Guile treats the argument of the `-s' command-line switch as the name
1067of a file of Scheme code to load, and treats the sequence `#!' as the
1068start of a block comment, terminated by `!#'.
1069
1070For example, here's a version of 'echo' written in Scheme:
1071
1072#!/usr/local/bin/guile -s
1073!#
1074(let loop ((args (cdr (program-arguments))))
1075 (if (pair? args)
1076 (begin
1077 (display (car args))
1078 (if (pair? (cdr args))
1079 (display " "))
1080 (loop (cdr args)))))
1081(newline)
1082
1083Why does `#!' start a block comment terminated by `!#', instead of the
1084end of the line? That is the notation SCSH uses, and although we
1085don't yet support the other SCSH features that motivate that choice,
1086we would like to be backward-compatible with any existing Guile
3763761c
JB
1087scripts once we do. Furthermore, if the path to Guile on your system
1088is too long for your kernel, you can start the script with this
1089horrible hack:
1090
1091#!/bin/sh
1092exec /really/long/path/to/guile -s "$0" ${1+"$@"}
1093!#
3065a62a
JB
1094
1095Note that some very old Unix systems don't support the `#!' syntax.
1096
c6486f8a 1097
4b521edb 1098** You can now run Guile without installing it.
6685dc83
JB
1099
1100Previous versions of the interactive Guile interpreter (`guile')
1101couldn't start up unless Guile's Scheme library had been installed;
1102they used the value of the environment variable `SCHEME_LOAD_PATH'
1103later on in the startup process, but not to find the startup code
1104itself. Now Guile uses `SCHEME_LOAD_PATH' in all searches for Scheme
1105code.
1106
1107To run Guile without installing it, build it in the normal way, and
1108then set the environment variable `SCHEME_LOAD_PATH' to a
1109colon-separated list of directories, including the top-level directory
1110of the Guile sources. For example, if you unpacked Guile so that the
1111full filename of this NEWS file is /home/jimb/guile-1.0b3/NEWS, then
1112you might say
1113
1114 export SCHEME_LOAD_PATH=/home/jimb/my-scheme:/home/jimb/guile-1.0b3
1115
c6486f8a 1116
4b521edb
JB
1117** Guile's read-eval-print loop no longer prints #<unspecified>
1118results. If the user wants to see this, she can evaluate the
1119expression (assert-repl-print-unspecified #t), perhaps in her startup
48d224d7 1120file.
6685dc83 1121
4b521edb
JB
1122** Guile no longer shows backtraces by default when an error occurs;
1123however, it does display a message saying how to get one, and how to
1124request that they be displayed by default. After an error, evaluate
1125 (backtrace)
1126to see a backtrace, and
1127 (debug-enable 'backtrace)
1128to see them by default.
6685dc83 1129
6685dc83 1130
d9fb83d9 1131
4b521edb
JB
1132* Changes to Guile Scheme:
1133
1134** Guile now distinguishes between #f and the empty list.
1135
1136This is for compatibility with the IEEE standard, the (possibly)
1137upcoming Revised^5 Report on Scheme, and many extant Scheme
1138implementations.
1139
1140Guile used to have #f and '() denote the same object, to make Scheme's
1141type system more compatible with Emacs Lisp's. However, the change
1142caused too much trouble for Scheme programmers, and we found another
1143way to reconcile Emacs Lisp with Scheme that didn't require this.
1144
1145
1146** Guile's delq, delv, delete functions, and their destructive
c6486f8a
JB
1147counterparts, delq!, delv!, and delete!, now remove all matching
1148elements from the list, not just the first. This matches the behavior
1149of the corresponding Emacs Lisp functions, and (I believe) the Maclisp
1150functions which inspired them.
1151
1152I recognize that this change may break code in subtle ways, but it
1153seems best to make the change before the FSF's first Guile release,
1154rather than after.
1155
1156
4b521edb 1157** The compiled-library-path function has been deleted from libguile.
6685dc83 1158
4b521edb 1159** The facilities for loading Scheme source files have changed.
c6486f8a 1160
4b521edb 1161*** The variable %load-path now tells Guile which directories to search
6685dc83
JB
1162for Scheme code. Its value is a list of strings, each of which names
1163a directory.
1164
4b521edb
JB
1165*** The variable %load-extensions now tells Guile which extensions to
1166try appending to a filename when searching the load path. Its value
1167is a list of strings. Its default value is ("" ".scm").
1168
1169*** (%search-load-path FILENAME) searches the directories listed in the
1170value of the %load-path variable for a Scheme file named FILENAME,
1171with all the extensions listed in %load-extensions. If it finds a
1172match, then it returns its full filename. If FILENAME is absolute, it
1173returns it unchanged. Otherwise, it returns #f.
6685dc83 1174
4b521edb
JB
1175%search-load-path will not return matches that refer to directories.
1176
1177*** (primitive-load FILENAME :optional CASE-INSENSITIVE-P SHARP)
1178uses %seach-load-path to find a file named FILENAME, and loads it if
1179it finds it. If it can't read FILENAME for any reason, it throws an
1180error.
6685dc83
JB
1181
1182The arguments CASE-INSENSITIVE-P and SHARP are interpreted as by the
4b521edb
JB
1183`read' function.
1184
1185*** load uses the same searching semantics as primitive-load.
1186
1187*** The functions %try-load, try-load-with-path, %load, load-with-path,
1188basic-try-load-with-path, basic-load-with-path, try-load-module-with-
1189path, and load-module-with-path have been deleted. The functions
1190above should serve their purposes.
1191
1192*** If the value of the variable %load-hook is a procedure,
1193`primitive-load' applies its value to the name of the file being
1194loaded (without the load path directory name prepended). If its value
1195is #f, it is ignored. Otherwise, an error occurs.
1196
1197This is mostly useful for printing load notification messages.
1198
1199
1200** The function `eval!' is no longer accessible from the scheme level.
1201We can't allow operations which introduce glocs into the scheme level,
1202because Guile's type system can't handle these as data. Use `eval' or
1203`read-and-eval!' (see below) as replacement.
1204
1205** The new function read-and-eval! reads an expression from PORT,
1206evaluates it, and returns the result. This is more efficient than
1207simply calling `read' and `eval', since it is not necessary to make a
1208copy of the expression for the evaluator to munge.
1209
1210Its optional arguments CASE_INSENSITIVE_P and SHARP are interpreted as
1211for the `read' function.
1212
1213
1214** The function `int?' has been removed; its definition was identical
1215to that of `integer?'.
1216
1217** The functions `<?', `<?', `<=?', `=?', `>?', and `>=?'. Code should
1218use the R4RS names for these functions.
1219
1220** The function object-properties no longer returns the hash handle;
1221it simply returns the object's property list.
1222
1223** Many functions have been changed to throw errors, instead of
1224returning #f on failure. The point of providing exception handling in
1225the language is to simplify the logic of user code, but this is less
1226useful if Guile's primitives don't throw exceptions.
1227
1228** The function `fileno' has been renamed from `%fileno'.
1229
1230** The function primitive-mode->fdes returns #t or #f now, not 1 or 0.
1231
1232
1233* Changes to Guile's C interface:
1234
1235** The library's initialization procedure has been simplified.
1236scm_boot_guile now has the prototype:
1237
1238void scm_boot_guile (int ARGC,
1239 char **ARGV,
1240 void (*main_func) (),
1241 void *closure);
1242
1243scm_boot_guile calls MAIN_FUNC, passing it CLOSURE, ARGC, and ARGV.
1244MAIN_FUNC should do all the work of the program (initializing other
1245packages, reading user input, etc.) before returning. When MAIN_FUNC
1246returns, call exit (0); this function never returns. If you want some
1247other exit value, MAIN_FUNC may call exit itself.
1248
1249scm_boot_guile arranges for program-arguments to return the strings
1250given by ARGC and ARGV. If MAIN_FUNC modifies ARGC/ARGV, should call
1251scm_set_program_arguments with the final list, so Scheme code will
1252know which arguments have been processed.
1253
1254scm_boot_guile establishes a catch-all catch handler which prints an
1255error message and exits the process. This means that Guile exits in a
1256coherent way when system errors occur and the user isn't prepared to
1257handle it. If the user doesn't like this behavior, they can establish
1258their own universal catcher in MAIN_FUNC to shadow this one.
1259
1260Why must the caller do all the real work from MAIN_FUNC? The garbage
1261collector assumes that all local variables of type SCM will be above
1262scm_boot_guile's stack frame on the stack. If you try to manipulate
1263SCM values after this function returns, it's the luck of the draw
1264whether the GC will be able to find the objects you allocate. So,
1265scm_boot_guile function exits, rather than returning, to discourage
1266people from making that mistake.
1267
1268The IN, OUT, and ERR arguments were removed; there are other
1269convenient ways to override these when desired.
1270
1271The RESULT argument was deleted; this function should never return.
1272
1273The BOOT_CMD argument was deleted; the MAIN_FUNC argument is more
1274general.
1275
1276
1277** Guile's header files should no longer conflict with your system's
1278header files.
1279
1280In order to compile code which #included <libguile.h>, previous
1281versions of Guile required you to add a directory containing all the
1282Guile header files to your #include path. This was a problem, since
1283Guile's header files have names which conflict with many systems'
1284header files.
1285
1286Now only <libguile.h> need appear in your #include path; you must
1287refer to all Guile's other header files as <libguile/mumble.h>.
1288Guile's installation procedure puts libguile.h in $(includedir), and
1289the rest in $(includedir)/libguile.
1290
1291
1292** Two new C functions, scm_protect_object and scm_unprotect_object,
1293have been added to the Guile library.
1294
1295scm_protect_object (OBJ) protects OBJ from the garbage collector.
1296OBJ will not be freed, even if all other references are dropped,
1297until someone does scm_unprotect_object (OBJ). Both functions
1298return OBJ.
1299
1300Note that calls to scm_protect_object do not nest. You can call
1301scm_protect_object any number of times on a given object, and the
1302next call to scm_unprotect_object will unprotect it completely.
1303
1304Basically, scm_protect_object and scm_unprotect_object just
1305maintain a list of references to things. Since the GC knows about
1306this list, all objects it mentions stay alive. scm_protect_object
1307adds its argument to the list; scm_unprotect_object remove its
1308argument from the list.
1309
1310
1311** scm_eval_0str now returns the value of the last expression
1312evaluated.
1313
1314** The new function scm_read_0str reads an s-expression from a
1315null-terminated string, and returns it.
1316
1317** The new function `scm_stdio_to_port' converts a STDIO file pointer
1318to a Scheme port object.
1319
1320** The new function `scm_set_program_arguments' allows C code to set
1321the value teruturned by the Scheme `program-arguments' function.
6685dc83 1322
6685dc83 1323\f
1a1945be
JB
1324Older changes:
1325
1326* Guile no longer includes sophisticated Tcl/Tk support.
1327
1328The old Tcl/Tk support was unsatisfying to us, because it required the
1329user to link against the Tcl library, as well as Tk and Guile. The
1330interface was also un-lispy, in that it preserved Tcl/Tk's practice of
1331referring to widgets by names, rather than exporting widgets to Scheme
1332code as a special datatype.
1333
1334In the Usenix Tk Developer's Workshop held in July 1996, the Tcl/Tk
1335maintainers described some very interesting changes in progress to the
1336Tcl/Tk internals, which would facilitate clean interfaces between lone
1337Tk and other interpreters --- even for garbage-collected languages
1338like Scheme. They expected the new Tk to be publicly available in the
1339fall of 1996.
1340
1341Since it seems that Guile might soon have a new, cleaner interface to
1342lone Tk, and that the old Guile/Tk glue code would probably need to be
1343completely rewritten, we (Jim Blandy and Richard Stallman) have
1344decided not to support the old code. We'll spend the time instead on
1345a good interface to the newer Tk, as soon as it is available.
5c54da76 1346
8512dea6 1347Until then, gtcltk-lib provides trivial, low-maintenance functionality.
deb95d71 1348
5c54da76
JB
1349\f
1350Copyright information:
1351
ea00ecba 1352Copyright (C) 1996,1997 Free Software Foundation, Inc.
5c54da76
JB
1353
1354 Permission is granted to anyone to make or distribute verbatim copies
1355 of this document as received, in any medium, provided that the
1356 copyright notice and this permission notice are preserved,
1357 thus giving the recipient permission to redistribute in turn.
1358
1359 Permission is granted to distribute modified versions
1360 of this document, or of portions of it,
1361 under the above conditions, provided also that they
1362 carry prominent notices stating who last changed them.
1363
48d224d7
JB
1364\f
1365Local variables:
1366mode: outline
1367paragraph-separate: "[ \f]*$"
1368end:
1369