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