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