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