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