Updated
[bpt/guile.git] / NEWS
CommitLineData
f7b47737 1Guile NEWS --- history of user-visible changes. -*- text -*-
d23bbf3e 2Copyright (C) 1996, 1997, 1998 Free Software Foundation, Inc.
5c54da76
JB
3See the end for copying conditions.
4
e1b6c710 5Please send Guile bug reports to bug-guile@gnu.org.
5c54da76 6\f
f3227c7a
JB
7Changes since Guile 1.3:
8
e4eae9b1
MD
9* Changes to the stand-alone interpreter
10
11** Command line history is now restored from and saved to file
12
13If readline is used and the read option `history-file' is enabled, the
14command line history is read from file when the interpreter is
15entered, and written to file on exit. The filename used can be
16specified with the environment variable GUILE_HISTORY. Default file
17name is "$HOME/.guile_history". Nothing special happens if errors
18occur during read or write.
19
20** Command line history length can now be customized.
21Command line history length is now controlled by the read option
22`history-length'. Default is 200 lines.
23
55254a6a
MD
24* Changes to Scheme functions and syntax
25
88ceea5c
MD
26** New functions: delq1!, delv1!, delete1!
27These procedures behave similar to delq! and friends but delete only
28one object if at all.
29
55254a6a
MD
30** New function: unread-string STRING PORT
31Unread STRING to PORT, that is, push it back onto the port so that
32next read operation will work on the pushed back characters.
33
34** unread-char can now be called multiple times
35If unread-char is called multiple times, the unread characters will be
36read again in last-in first-out order.
37
d41b3904
MD
38** New function: serial-map PROC LIST1 LIST2 ...
39Version of `map' which guarantees that the procedure is applied to the
40lists in serial order.
41
42** New syntax: sequence->list BODY1 ...
43Version of `begin' which returns a list of the results of the body
44forms instead of the result of the last body form. In contrast to
45`begin', sequence->list allows an empty body.
46
e4eae9b1
MD
47** New functions: read-history FILENAME, write-history FILENAME
48Read/write command line history from/to file. Returns #t on success
49and #f if an error occured.
50
3ffc7a36
MD
51* Changes to the gh_ interface
52
53** gh_scm2doubles
54
55Now takes a second argument which is the result array. If this
56pointer is NULL, a new array is malloced (the old behaviour).
57
58** gh_chars2byvect, gh_shorts2svect, gh_floats2fvect, gh_scm2chars,
59 gh_scm2shorts, gh_scm2longs, gh_scm2floats
60
61New functions.
62
f3227c7a 63\f
d23bbf3e 64Changes in Guile 1.3 (released Monday, October 19, 1998):
c484bf7f
JB
65
66* Changes to the distribution
67
e2d6569c
JB
68** We renamed the SCHEME_LOAD_PATH environment variable to GUILE_LOAD_PATH.
69To avoid conflicts, programs should name environment variables after
70themselves, except when there's a common practice establishing some
71other convention.
72
73For now, Guile supports both GUILE_LOAD_PATH and SCHEME_LOAD_PATH,
74giving the former precedence, and printing a warning message if the
75latter is set. Guile 1.4 will not recognize SCHEME_LOAD_PATH at all.
76
77** The header files related to multi-byte characters have been removed.
78They were: libguile/extchrs.h and libguile/mbstrings.h. Any C code
79which referred to these explicitly will probably need to be rewritten,
80since the support for the variant string types has been removed; see
81below.
82
83** The header files append.h and sequences.h have been removed. These
84files implemented non-R4RS operations which would encourage
85non-portable programming style and less easy-to-read code.
3a97e020 86
c484bf7f
JB
87* Changes to the stand-alone interpreter
88
2e368582 89** New procedures have been added to implement a "batch mode":
ec4ab4fd 90
2e368582 91*** Function: batch-mode?
ec4ab4fd
GH
92
93 Returns a boolean indicating whether the interpreter is in batch
94 mode.
95
2e368582 96*** Function: set-batch-mode?! ARG
ec4ab4fd
GH
97
98 If ARG is true, switches the interpreter to batch mode. The `#f'
99 case has not been implemented.
100
2e368582
JB
101** Guile now provides full command-line editing, when run interactively.
102To use this feature, you must have the readline library installed.
103The Guile build process will notice it, and automatically include
104support for it.
105
106The readline library is available via anonymous FTP from any GNU
107mirror site; the canonical location is "ftp://prep.ai.mit.edu/pub/gnu".
108
a5d6d578
MD
109** the-last-stack is now a fluid.
110
c484bf7f
JB
111* Changes to the procedure for linking libguile with your programs
112
71f20534 113** You can now use the `guile-config' utility to build programs that use Guile.
2e368582 114
2adfe1c0 115Guile now includes a command-line utility called `guile-config', which
71f20534
JB
116can provide information about how to compile and link programs that
117use Guile.
118
119*** `guile-config compile' prints any C compiler flags needed to use Guile.
120You should include this command's output on the command line you use
121to compile C or C++ code that #includes the Guile header files. It's
122usually just a `-I' flag to help the compiler find the Guile headers.
123
124
125*** `guile-config link' prints any linker flags necessary to link with Guile.
8aa5c148 126
71f20534 127This command writes to its standard output a list of flags which you
8aa5c148
JB
128must pass to the linker to link your code against the Guile library.
129The flags include '-lguile' itself, any other libraries the Guile
130library depends upon, and any `-L' flags needed to help the linker
131find those libraries.
2e368582
JB
132
133For example, here is a Makefile rule that builds a program named 'foo'
134from the object files ${FOO_OBJECTS}, and links them against Guile:
135
136 foo: ${FOO_OBJECTS}
2adfe1c0 137 ${CC} ${CFLAGS} ${FOO_OBJECTS} `guile-config link` -o foo
2e368582 138
e2d6569c
JB
139Previous Guile releases recommended that you use autoconf to detect
140which of a predefined set of libraries were present on your system.
2adfe1c0 141It is more robust to use `guile-config', since it records exactly which
e2d6569c
JB
142libraries the installed Guile library requires.
143
2adfe1c0
JB
144This was originally called `build-guile', but was renamed to
145`guile-config' before Guile 1.3 was released, to be consistent with
146the analogous script for the GTK+ GUI toolkit, which is called
147`gtk-config'.
148
2e368582 149
8aa5c148
JB
150** Use the GUILE_FLAGS macro in your configure.in file to find Guile.
151
152If you are using the GNU autoconf package to configure your program,
153you can use the GUILE_FLAGS autoconf macro to call `guile-config'
154(described above) and gather the necessary values for use in your
155Makefiles.
156
157The GUILE_FLAGS macro expands to configure script code which runs the
158`guile-config' script, to find out where Guile's header files and
159libraries are installed. It sets two variables, marked for
160substitution, as by AC_SUBST.
161
162 GUILE_CFLAGS --- flags to pass to a C or C++ compiler to build
163 code that uses Guile header files. This is almost always just a
164 -I flag.
165
166 GUILE_LDFLAGS --- flags to pass to the linker to link a
167 program against Guile. This includes `-lguile' for the Guile
168 library itself, any libraries that Guile itself requires (like
169 -lqthreads), and so on. It may also include a -L flag to tell the
170 compiler where to find the libraries.
171
172GUILE_FLAGS is defined in the file guile.m4, in the top-level
173directory of the Guile distribution. You can copy it into your
174package's aclocal.m4 file, and then use it in your configure.in file.
175
176If you are using the `aclocal' program, distributed with GNU automake,
177to maintain your aclocal.m4 file, the Guile installation process
178installs guile.m4 where aclocal will find it. All you need to do is
179use GUILE_FLAGS in your configure.in file, and then run `aclocal';
180this will copy the definition of GUILE_FLAGS into your aclocal.m4
181file.
182
183
c484bf7f 184* Changes to Scheme functions and syntax
7ad3c1e7 185
02755d59 186** Multi-byte strings have been removed, as have multi-byte and wide
e2d6569c
JB
187ports. We felt that these were the wrong approach to
188internationalization support.
02755d59 189
2e368582
JB
190** New function: readline [PROMPT]
191Read a line from the terminal, and allow the user to edit it,
192prompting with PROMPT. READLINE provides a large set of Emacs-like
193editing commands, lets the user recall previously typed lines, and
194works on almost every kind of terminal, including dumb terminals.
195
196READLINE assumes that the cursor is at the beginning of the line when
197it is invoked. Thus, you can't print a prompt yourself, and then call
198READLINE; you need to package up your prompt as a string, pass it to
199the function, and let READLINE print the prompt itself. This is
200because READLINE needs to know the prompt's screen width.
201
8cd57bd0
JB
202For Guile to provide this function, you must have the readline
203library, version 2.1 or later, installed on your system. Readline is
204available via anonymous FTP from prep.ai.mit.edu in pub/gnu, or from
205any GNU mirror site.
2e368582
JB
206
207See also ADD-HISTORY function.
208
209** New function: add-history STRING
210Add STRING as the most recent line in the history used by the READLINE
211command. READLINE does not add lines to the history itself; you must
212call ADD-HISTORY to make previous input available to the user.
213
8cd57bd0
JB
214** The behavior of the read-line function has changed.
215
216This function now uses standard C library functions to read the line,
217for speed. This means that it doesn not respect the value of
218scm-line-incrementors; it assumes that lines are delimited with
219#\newline.
220
221(Note that this is read-line, the function that reads a line of text
222from a port, not readline, the function that reads a line from a
223terminal, providing full editing capabilities.)
224
1a0106ef
JB
225** New module (ice-9 getopt-gnu-style): Parse command-line arguments.
226
227This module provides some simple argument parsing. It exports one
228function:
229
230Function: getopt-gnu-style ARG-LS
231 Parse a list of program arguments into an alist of option
232 descriptions.
233
234 Each item in the list of program arguments is examined to see if
235 it meets the syntax of a GNU long-named option. An argument like
236 `--MUMBLE' produces an element of the form (MUMBLE . #t) in the
237 returned alist, where MUMBLE is a keyword object with the same
238 name as the argument. An argument like `--MUMBLE=FROB' produces
239 an element of the form (MUMBLE . FROB), where FROB is a string.
240
241 As a special case, the returned alist also contains a pair whose
242 car is the symbol `rest'. The cdr of this pair is a list
243 containing all the items in the argument list that are not options
244 of the form mentioned above.
245
246 The argument `--' is treated specially: all items in the argument
247 list appearing after such an argument are not examined, and are
248 returned in the special `rest' list.
249
250 This function does not parse normal single-character switches.
251 You will need to parse them out of the `rest' list yourself.
252
8cd57bd0
JB
253** The read syntax for byte vectors and short vectors has changed.
254
255Instead of #bytes(...), write #y(...).
256
257Instead of #short(...), write #h(...).
258
259This may seem nutty, but, like the other uniform vectors, byte vectors
260and short vectors want to have the same print and read syntax (and,
261more basic, want to have read syntax!). Changing the read syntax to
262use multiple characters after the hash sign breaks with the
263conventions used in R5RS and the conventions used for the other
264uniform vectors. It also introduces complexity in the current reader,
265both on the C and Scheme levels. (The Right solution is probably to
266change the syntax and prototypes for uniform vectors entirely.)
267
268
269** The new module (ice-9 session) provides useful interactive functions.
270
271*** New procedure: (apropos REGEXP OPTION ...)
272
273Display a list of top-level variables whose names match REGEXP, and
274the modules they are imported from. Each OPTION should be one of the
275following symbols:
276
277 value --- Show the value of each matching variable.
278 shadow --- Show bindings shadowed by subsequently imported modules.
279 full --- Same as both `shadow' and `value'.
280
281For example:
282
283 guile> (apropos "trace" 'full)
284 debug: trace #<procedure trace args>
285 debug: untrace #<procedure untrace args>
286 the-scm-module: display-backtrace #<compiled-closure #<primitive-procedure gsubr-apply>>
287 the-scm-module: before-backtrace-hook ()
288 the-scm-module: backtrace #<primitive-procedure backtrace>
289 the-scm-module: after-backtrace-hook ()
290 the-scm-module: has-shown-backtrace-hint? #f
291 guile>
292
293** There are new functions and syntax for working with macros.
294
295Guile implements macros as a special object type. Any variable whose
296top-level binding is a macro object acts as a macro. The macro object
297specifies how the expression should be transformed before evaluation.
298
299*** Macro objects now print in a reasonable way, resembling procedures.
300
301*** New function: (macro? OBJ)
302True iff OBJ is a macro object.
303
304*** New function: (primitive-macro? OBJ)
305Like (macro? OBJ), but true only if OBJ is one of the Guile primitive
306macro transformers, implemented in eval.c rather than Scheme code.
307
dbdd0c16
JB
308Why do we have this function?
309- For symmetry with procedure? and primitive-procedure?,
310- to allow custom print procedures to tell whether a macro is
311 primitive, and display it differently, and
312- to allow compilers and user-written evaluators to distinguish
313 builtin special forms from user-defined ones, which could be
314 compiled.
315
8cd57bd0
JB
316*** New function: (macro-type OBJ)
317Return a value indicating what kind of macro OBJ is. Possible return
318values are:
319
320 The symbol `syntax' --- a macro created by procedure->syntax.
321 The symbol `macro' --- a macro created by procedure->macro.
322 The symbol `macro!' --- a macro created by procedure->memoizing-macro.
323 The boolean #f --- if OBJ is not a macro object.
324
325*** New function: (macro-name MACRO)
326Return the name of the macro object MACRO's procedure, as returned by
327procedure-name.
328
329*** New function: (macro-transformer MACRO)
330Return the transformer procedure for MACRO.
331
332*** New syntax: (use-syntax MODULE ... TRANSFORMER)
333
334Specify a new macro expander to use in the current module. Each
335MODULE is a module name, with the same meaning as in the `use-modules'
336form; each named module's exported bindings are added to the current
337top-level environment. TRANSFORMER is an expression evaluated in the
338resulting environment which must yield a procedure to use as the
339module's eval transformer: every expression evaluated in this module
340is passed to this function, and the result passed to the Guile
341interpreter.
342
343*** macro-eval! is removed. Use local-eval instead.
29521173 344
8d9dcb3c
MV
345** Some magic has been added to the printer to better handle user
346written printing routines (like record printers, closure printers).
347
348The problem is that these user written routines must have access to
7fbd77df 349the current `print-state' to be able to handle fancy things like
8d9dcb3c
MV
350detection of circular references. These print-states have to be
351passed to the builtin printing routines (display, write, etc) to
352properly continue the print chain.
353
354We didn't want to change all existing print code so that it
8cd57bd0 355explicitly passes thru a print state in addition to a port. Instead,
8d9dcb3c
MV
356we extented the possible values that the builtin printing routines
357accept as a `port'. In addition to a normal port, they now also take
358a pair of a normal port and a print-state. Printing will go to the
359port and the print-state will be used to control the detection of
360circular references, etc. If the builtin function does not care for a
361print-state, it is simply ignored.
362
363User written callbacks are now called with such a pair as their
364`port', but because every function now accepts this pair as a PORT
365argument, you don't have to worry about that. In fact, it is probably
366safest to not check for these pairs.
367
368However, it is sometimes necessary to continue a print chain on a
369different port, for example to get a intermediate string
370representation of the printed value, mangle that string somehow, and
371then to finally print the mangled string. Use the new function
372
373 inherit-print-state OLD-PORT NEW-PORT
374
375for this. It constructs a new `port' that prints to NEW-PORT but
376inherits the print-state of OLD-PORT.
377
ef1ea498
MD
378** struct-vtable-offset renamed to vtable-offset-user
379
380** New constants: vtable-index-layout, vtable-index-vtable, vtable-index-printer
381
382** There is now a fourth (optional) argument to make-vtable-vtable and
383 make-struct when constructing new types (vtables). This argument
384 initializes field vtable-index-printer of the vtable.
385
4851dc57
MV
386** The detection of circular references has been extended to structs.
387That is, a structure that -- in the process of being printed -- prints
388itself does not lead to infinite recursion.
389
390** There is now some basic support for fluids. Please read
391"libguile/fluid.h" to find out more. It is accessible from Scheme with
392the following functions and macros:
393
9c3fb66f
MV
394Function: make-fluid
395
396 Create a new fluid object. Fluids are not special variables or
397 some other extension to the semantics of Scheme, but rather
398 ordinary Scheme objects. You can store them into variables (that
399 are still lexically scoped, of course) or into any other place you
400 like. Every fluid has a initial value of `#f'.
04c76b58 401
9c3fb66f 402Function: fluid? OBJ
04c76b58 403
9c3fb66f 404 Test whether OBJ is a fluid.
04c76b58 405
9c3fb66f
MV
406Function: fluid-ref FLUID
407Function: fluid-set! FLUID VAL
04c76b58
MV
408
409 Access/modify the fluid FLUID. Modifications are only visible
410 within the current dynamic root (that includes threads).
411
9c3fb66f
MV
412Function: with-fluids* FLUIDS VALUES THUNK
413
414 FLUIDS is a list of fluids and VALUES a corresponding list of
415 values for these fluids. Before THUNK gets called the values are
416 installed in the fluids and the old values of the fluids are
417 saved in the VALUES list. When the flow of control leaves THUNK
418 or reenters it, the values get swapped again. You might think of
419 this as a `safe-fluid-excursion'. Note that the VALUES list is
420 modified by `with-fluids*'.
421
422Macro: with-fluids ((FLUID VALUE) ...) FORM ...
423
424 The same as `with-fluids*' but with a different syntax. It looks
425 just like `let', but both FLUID and VALUE are evaluated. Remember,
426 fluids are not special variables but ordinary objects. FLUID
427 should evaluate to a fluid.
04c76b58 428
e2d6569c 429** Changes to system call interfaces:
64d01d13 430
e2d6569c 431*** close-port, close-input-port and close-output-port now return a
64d01d13
GH
432boolean instead of an `unspecified' object. #t means that the port
433was successfully closed, while #f means it was already closed. It is
434also now possible for these procedures to raise an exception if an
435error occurs (some errors from write can be delayed until close.)
436
e2d6569c 437*** the first argument to chmod, fcntl, ftell and fseek can now be a
6afcd3b2
GH
438file descriptor.
439
e2d6569c 440*** the third argument to fcntl is now optional.
6afcd3b2 441
e2d6569c 442*** the first argument to chown can now be a file descriptor or a port.
6afcd3b2 443
e2d6569c 444*** the argument to stat can now be a port.
6afcd3b2 445
e2d6569c 446*** The following new procedures have been added (most use scsh
64d01d13
GH
447interfaces):
448
e2d6569c 449*** procedure: close PORT/FD
ec4ab4fd
GH
450 Similar to close-port (*note close-port: Closing Ports.), but also
451 works on file descriptors. A side effect of closing a file
452 descriptor is that any ports using that file descriptor are moved
453 to a different file descriptor and have their revealed counts set
454 to zero.
455
e2d6569c 456*** procedure: port->fdes PORT
ec4ab4fd
GH
457 Returns the integer file descriptor underlying PORT. As a side
458 effect the revealed count of PORT is incremented.
459
e2d6569c 460*** procedure: fdes->ports FDES
ec4ab4fd
GH
461 Returns a list of existing ports which have FDES as an underlying
462 file descriptor, without changing their revealed counts.
463
e2d6569c 464*** procedure: fdes->inport FDES
ec4ab4fd
GH
465 Returns an existing input port which has FDES as its underlying
466 file descriptor, if one exists, and increments its revealed count.
467 Otherwise, returns a new input port with a revealed count of 1.
468
e2d6569c 469*** procedure: fdes->outport FDES
ec4ab4fd
GH
470 Returns an existing output port which has FDES as its underlying
471 file descriptor, if one exists, and increments its revealed count.
472 Otherwise, returns a new output port with a revealed count of 1.
473
474 The next group of procedures perform a `dup2' system call, if NEWFD
475(an integer) is supplied, otherwise a `dup'. The file descriptor to be
476duplicated can be supplied as an integer or contained in a port. The
64d01d13
GH
477type of value returned varies depending on which procedure is used.
478
ec4ab4fd
GH
479 All procedures also have the side effect when performing `dup2' that
480any ports using NEWFD are moved to a different file descriptor and have
64d01d13
GH
481their revealed counts set to zero.
482
e2d6569c 483*** procedure: dup->fdes PORT/FD [NEWFD]
ec4ab4fd 484 Returns an integer file descriptor.
64d01d13 485
e2d6569c 486*** procedure: dup->inport PORT/FD [NEWFD]
ec4ab4fd 487 Returns a new input port using the new file descriptor.
64d01d13 488
e2d6569c 489*** procedure: dup->outport PORT/FD [NEWFD]
ec4ab4fd 490 Returns a new output port using the new file descriptor.
64d01d13 491
e2d6569c 492*** procedure: dup PORT/FD [NEWFD]
ec4ab4fd
GH
493 Returns a new port if PORT/FD is a port, with the same mode as the
494 supplied port, otherwise returns an integer file descriptor.
64d01d13 495
e2d6569c 496*** procedure: dup->port PORT/FD MODE [NEWFD]
ec4ab4fd
GH
497 Returns a new port using the new file descriptor. MODE supplies a
498 mode string for the port (*note open-file: File Ports.).
64d01d13 499
e2d6569c 500*** procedure: setenv NAME VALUE
ec4ab4fd
GH
501 Modifies the environment of the current process, which is also the
502 default environment inherited by child processes.
64d01d13 503
ec4ab4fd
GH
504 If VALUE is `#f', then NAME is removed from the environment.
505 Otherwise, the string NAME=VALUE is added to the environment,
506 replacing any existing string with name matching NAME.
64d01d13 507
ec4ab4fd 508 The return value is unspecified.
956055a9 509
e2d6569c 510*** procedure: truncate-file OBJ SIZE
6afcd3b2
GH
511 Truncates the file referred to by OBJ to at most SIZE bytes. OBJ
512 can be a string containing a file name or an integer file
513 descriptor or port open for output on the file. The underlying
514 system calls are `truncate' and `ftruncate'.
515
516 The return value is unspecified.
517
e2d6569c 518*** procedure: setvbuf PORT MODE [SIZE]
7a6f1ffa
GH
519 Set the buffering mode for PORT. MODE can be:
520 `_IONBF'
521 non-buffered
522
523 `_IOLBF'
524 line buffered
525
526 `_IOFBF'
527 block buffered, using a newly allocated buffer of SIZE bytes.
528 However if SIZE is zero or unspecified, the port will be made
529 non-buffered.
530
531 This procedure should not be used after I/O has been performed with
532 the port.
533
534 Ports are usually block buffered by default, with a default buffer
535 size. Procedures e.g., *Note open-file: File Ports, which accept a
536 mode string allow `0' to be added to request an unbuffered port.
537
e2d6569c 538*** procedure: fsync PORT/FD
6afcd3b2
GH
539 Copies any unwritten data for the specified output file descriptor
540 to disk. If PORT/FD is a port, its buffer is flushed before the
541 underlying file descriptor is fsync'd. The return value is
542 unspecified.
543
e2d6569c 544*** procedure: open-fdes PATH FLAGS [MODES]
6afcd3b2
GH
545 Similar to `open' but returns a file descriptor instead of a port.
546
e2d6569c 547*** procedure: execle PATH ENV [ARG] ...
6afcd3b2
GH
548 Similar to `execl', but the environment of the new process is
549 specified by ENV, which must be a list of strings as returned by
550 the `environ' procedure.
551
552 This procedure is currently implemented using the `execve' system
553 call, but we call it `execle' because of its Scheme calling
554 interface.
555
e2d6569c 556*** procedure: strerror ERRNO
ec4ab4fd
GH
557 Returns the Unix error message corresponding to ERRNO, an integer.
558
e2d6569c 559*** procedure: primitive-exit [STATUS]
6afcd3b2
GH
560 Terminate the current process without unwinding the Scheme stack.
561 This is would typically be useful after a fork. The exit status
562 is STATUS if supplied, otherwise zero.
563
e2d6569c 564*** procedure: times
6afcd3b2
GH
565 Returns an object with information about real and processor time.
566 The following procedures accept such an object as an argument and
567 return a selected component:
568
569 `tms:clock'
570 The current real time, expressed as time units relative to an
571 arbitrary base.
572
573 `tms:utime'
574 The CPU time units used by the calling process.
575
576 `tms:stime'
577 The CPU time units used by the system on behalf of the
578 calling process.
579
580 `tms:cutime'
581 The CPU time units used by terminated child processes of the
582 calling process, whose status has been collected (e.g., using
583 `waitpid').
584
585 `tms:cstime'
586 Similarly, the CPU times units used by the system on behalf of
587 terminated child processes.
7ad3c1e7 588
e2d6569c
JB
589** Removed: list-length
590** Removed: list-append, list-append!
591** Removed: list-reverse, list-reverse!
592
593** array-map renamed to array-map!
594
595** serial-array-map renamed to serial-array-map!
596
660f41fa
MD
597** catch doesn't take #f as first argument any longer
598
599Previously, it was possible to pass #f instead of a key to `catch'.
600That would cause `catch' to pass a jump buffer object to the procedure
601passed as second argument. The procedure could then use this jump
602buffer objekt as an argument to throw.
603
604This mechanism has been removed since its utility doesn't motivate the
605extra complexity it introduces.
606
332d00f6
JB
607** The `#/' notation for lists now provokes a warning message from Guile.
608This syntax will be removed from Guile in the near future.
609
610To disable the warning message, set the GUILE_HUSH environment
611variable to any non-empty value.
612
8cd57bd0
JB
613** The newline character now prints as `#\newline', following the
614normal Scheme notation, not `#\nl'.
615
c484bf7f
JB
616* Changes to the gh_ interface
617
8986901b
JB
618** The gh_enter function now takes care of loading the Guile startup files.
619gh_enter works by calling scm_boot_guile; see the remarks below.
620
5424b4f7
MD
621** Function: void gh_write (SCM x)
622
623Write the printed representation of the scheme object x to the current
624output port. Corresponds to the scheme level `write'.
625
3a97e020
MD
626** gh_list_length renamed to gh_length.
627
8d6787b6
MG
628** vector handling routines
629
630Several major changes. In particular, gh_vector() now resembles
631(vector ...) (with a caveat -- see manual), and gh_make_vector() now
956328d2
MG
632exists and behaves like (make-vector ...). gh_vset() and gh_vref()
633have been renamed gh_vector_set_x() and gh_vector_ref(). Some missing
8d6787b6
MG
634vector-related gh_ functions have been implemented.
635
7fee59bd
MG
636** pair and list routines
637
638Implemented several of the R4RS pair and list functions that were
639missing.
640
171422a9
MD
641** gh_scm2doubles, gh_doubles2scm, gh_doubles2dvect
642
643New function. Converts double arrays back and forth between Scheme
644and C.
645
c484bf7f
JB
646* Changes to the scm_ interface
647
8986901b
JB
648** The function scm_boot_guile now takes care of loading the startup files.
649
650Guile's primary initialization function, scm_boot_guile, now takes
651care of loading `boot-9.scm', in the `ice-9' module, to initialize
652Guile, define the module system, and put together some standard
653bindings. It also loads `init.scm', which is intended to hold
654site-specific initialization code.
655
656Since Guile cannot operate properly until boot-9.scm is loaded, there
657is no reason to separate loading boot-9.scm from Guile's other
658initialization processes.
659
660This job used to be done by scm_compile_shell_switches, which didn't
661make much sense; in particular, it meant that people using Guile for
662non-shell-like applications had to jump through hoops to get Guile
663initialized properly.
664
665** The function scm_compile_shell_switches no longer loads the startup files.
666Now, Guile always loads the startup files, whenever it is initialized;
667see the notes above for scm_boot_guile and scm_load_startup_files.
668
669** Function: scm_load_startup_files
670This new function takes care of loading Guile's initialization file
671(`boot-9.scm'), and the site initialization file, `init.scm'. Since
672this is always called by the Guile initialization process, it's
673probably not too useful to call this yourself, but it's there anyway.
674
87148d9e
JB
675** The semantics of smob marking have changed slightly.
676
677The smob marking function (the `mark' member of the scm_smobfuns
678structure) is no longer responsible for setting the mark bit on the
679smob. The generic smob handling code in the garbage collector will
680set this bit. The mark function need only ensure that any other
681objects the smob refers to get marked.
682
683Note that this change means that the smob's GC8MARK bit is typically
684already set upon entry to the mark function. Thus, marking functions
685which look like this:
686
687 {
688 if (SCM_GC8MARKP (ptr))
689 return SCM_BOOL_F;
690 SCM_SETGC8MARK (ptr);
691 ... mark objects to which the smob refers ...
692 }
693
694are now incorrect, since they will return early, and fail to mark any
695other objects the smob refers to. Some code in the Guile library used
696to work this way.
697
1cf84ea5
JB
698** The semantics of the I/O port functions in scm_ptobfuns have changed.
699
700If you have implemented your own I/O port type, by writing the
701functions required by the scm_ptobfuns and then calling scm_newptob,
702you will need to change your functions slightly.
703
704The functions in a scm_ptobfuns structure now expect the port itself
705as their argument; they used to expect the `stream' member of the
706port's scm_port_table structure. This allows functions in an
707scm_ptobfuns structure to easily access the port's cell (and any flags
708it its CAR), and the port's scm_port_table structure.
709
710Guile now passes the I/O port itself as the `port' argument in the
711following scm_ptobfuns functions:
712
713 int (*free) (SCM port);
714 int (*fputc) (int, SCM port);
715 int (*fputs) (char *, SCM port);
716 scm_sizet (*fwrite) SCM_P ((char *ptr,
717 scm_sizet size,
718 scm_sizet nitems,
719 SCM port));
720 int (*fflush) (SCM port);
721 int (*fgetc) (SCM port);
722 int (*fclose) (SCM port);
723
724The interfaces to the `mark', `print', `equalp', and `fgets' methods
725are unchanged.
726
727If you have existing code which defines its own port types, it is easy
728to convert your code to the new interface; simply apply SCM_STREAM to
729the port argument to yield the value you code used to expect.
730
731Note that since both the port and the stream have the same type in the
732C code --- they are both SCM values --- the C compiler will not remind
733you if you forget to update your scm_ptobfuns functions.
734
735
933a7411
MD
736** Function: int scm_internal_select (int fds,
737 SELECT_TYPE *rfds,
738 SELECT_TYPE *wfds,
739 SELECT_TYPE *efds,
740 struct timeval *timeout);
741
742This is a replacement for the `select' function provided by the OS.
743It enables I/O blocking and sleeping to happen for one cooperative
744thread without blocking other threads. It also avoids busy-loops in
745these situations. It is intended that all I/O blocking and sleeping
746will finally go through this function. Currently, this function is
747only available on systems providing `gettimeofday' and `select'.
748
5424b4f7
MD
749** Function: SCM scm_internal_stack_catch (SCM tag,
750 scm_catch_body_t body,
751 void *body_data,
752 scm_catch_handler_t handler,
753 void *handler_data)
754
755A new sibling to the other two C level `catch' functions
756scm_internal_catch and scm_internal_lazy_catch. Use it if you want
757the stack to be saved automatically into the variable `the-last-stack'
758(scm_the_last_stack_var) on error. This is necessary if you want to
759use advanced error reporting, such as calling scm_display_error and
760scm_display_backtrace. (They both take a stack object as argument.)
761
df366c26
MD
762** Function: SCM scm_spawn_thread (scm_catch_body_t body,
763 void *body_data,
764 scm_catch_handler_t handler,
765 void *handler_data)
766
767Spawns a new thread. It does a job similar to
768scm_call_with_new_thread but takes arguments more suitable when
769spawning threads from application C code.
770
88482b31
MD
771** The hook scm_error_callback has been removed. It was originally
772intended as a way for the user to install his own error handler. But
773that method works badly since it intervenes between throw and catch,
774thereby changing the semantics of expressions like (catch #t ...).
775The correct way to do it is to use one of the C level catch functions
776in throw.c: scm_internal_catch/lazy_catch/stack_catch.
777
3a97e020
MD
778** Removed functions:
779
780scm_obj_length, scm_list_length, scm_list_append, scm_list_append_x,
781scm_list_reverse, scm_list_reverse_x
782
783** New macros: SCM_LISTn where n is one of the integers 0-9.
784
785These can be used for pretty list creation from C. The idea is taken
786from Erick Gallesio's STk.
787
298aa6e3
MD
788** scm_array_map renamed to scm_array_map_x
789
527da704
MD
790** mbstrings are now removed
791
792This means that the type codes scm_tc7_mb_string and
793scm_tc7_mb_substring has been removed.
794
8cd57bd0
JB
795** scm_gen_putc, scm_gen_puts, scm_gen_write, and scm_gen_getc have changed.
796
797Since we no longer support multi-byte strings, these I/O functions
798have been simplified, and renamed. Here are their old names, and
799their new names and arguments:
800
801scm_gen_putc -> void scm_putc (int c, SCM port);
802scm_gen_puts -> void scm_puts (char *s, SCM port);
803scm_gen_write -> void scm_lfwrite (char *ptr, scm_sizet size, SCM port);
804scm_gen_getc -> void scm_getc (SCM port);
805
806
527da704
MD
807** The macros SCM_TYP7D and SCM_TYP7SD has been removed.
808
809** The macro SCM_TYP7S has taken the role of the old SCM_TYP7D
810
811SCM_TYP7S now masks away the bit which distinguishes substrings from
812strings.
813
660f41fa
MD
814** scm_catch_body_t: Backward incompatible change!
815
816Body functions to scm_internal_catch and friends do not any longer
817take a second argument. This is because it is no longer possible to
818pass a #f arg to catch.
819
a8e05009
JB
820** Calls to scm_protect_object and scm_unprotect now nest properly.
821
822The function scm_protect_object protects its argument from being freed
823by the garbage collector. scm_unprotect_object removes that
824protection.
825
826These functions now nest properly. That is, for every object O, there
827is a counter which scm_protect_object(O) increments and
828scm_unprotect_object(O) decrements, if the counter is greater than
829zero. Every object's counter is zero when it is first created. If an
830object's counter is greater than zero, the garbage collector will not
831reclaim its storage.
832
833This allows you to use scm_protect_object in your code without
834worrying that some other function you call will call
835scm_unprotect_object, and allow it to be freed. Assuming that the
836functions you call are well-behaved, and unprotect only those objects
837they protect, you can follow the same rule and have confidence that
838objects will be freed only at appropriate times.
839
c484bf7f
JB
840\f
841Changes in Guile 1.2 (released Tuesday, June 24 1997):
cf78e9e8 842
737c9113
JB
843* Changes to the distribution
844
832b09ed
JB
845** Nightly snapshots are now available from ftp.red-bean.com.
846The old server, ftp.cyclic.com, has been relinquished to its rightful
847owner.
848
849Nightly snapshots of the Guile development sources are now available via
850anonymous FTP from ftp.red-bean.com, as /pub/guile/guile-snap.tar.gz.
851
852Via the web, that's: ftp://ftp.red-bean.com/pub/guile/guile-snap.tar.gz
853For getit, that's: ftp.red-bean.com:/pub/guile/guile-snap.tar.gz
854
0fcab5ed
JB
855** To run Guile without installing it, the procedure has changed a bit.
856
857If you used a separate build directory to compile Guile, you'll need
858to include the build directory in SCHEME_LOAD_PATH, as well as the
859source directory. See the `INSTALL' file for examples.
860
737c9113
JB
861* Changes to the procedure for linking libguile with your programs
862
94982a4e
JB
863** The standard Guile load path for Scheme code now includes
864$(datadir)/guile (usually /usr/local/share/guile). This means that
865you can install your own Scheme files there, and Guile will find them.
866(Previous versions of Guile only checked a directory whose name
867contained the Guile version number, so you had to re-install or move
868your Scheme sources each time you installed a fresh version of Guile.)
869
870The load path also includes $(datadir)/guile/site; we recommend
871putting individual Scheme files there. If you want to install a
872package with multiple source files, create a directory for them under
873$(datadir)/guile.
874
875** Guile 1.2 will now use the Rx regular expression library, if it is
876installed on your system. When you are linking libguile into your own
877programs, this means you will have to link against -lguile, -lqt (if
878you configured Guile with thread support), and -lrx.
27590f82
JB
879
880If you are using autoconf to generate configuration scripts for your
881application, the following lines should suffice to add the appropriate
882libraries to your link command:
883
884### Find Rx, quickthreads and libguile.
885AC_CHECK_LIB(rx, main)
886AC_CHECK_LIB(qt, main)
887AC_CHECK_LIB(guile, scm_shell)
888
94982a4e
JB
889The Guile 1.2 distribution does not contain sources for the Rx
890library, as Guile 1.0 did. If you want to use Rx, you'll need to
891retrieve it from a GNU FTP site and install it separately.
892
b83b8bee
JB
893* Changes to Scheme functions and syntax
894
e035e7e6
MV
895** The dynamic linking features of Guile are now enabled by default.
896You can disable them by giving the `--disable-dynamic-linking' option
897to configure.
898
e035e7e6
MV
899 (dynamic-link FILENAME)
900
901 Find the object file denoted by FILENAME (a string) and link it
902 into the running Guile application. When everything works out,
903 return a Scheme object suitable for representing the linked object
904 file. Otherwise an error is thrown. How object files are
905 searched is system dependent.
906
907 (dynamic-object? VAL)
908
909 Determine whether VAL represents a dynamically linked object file.
910
911 (dynamic-unlink DYNOBJ)
912
913 Unlink the indicated object file from the application. DYNOBJ
914 should be one of the values returned by `dynamic-link'.
915
916 (dynamic-func FUNCTION DYNOBJ)
917
918 Search the C function indicated by FUNCTION (a string or symbol)
919 in DYNOBJ and return some Scheme object that can later be used
920 with `dynamic-call' to actually call this function. Right now,
921 these Scheme objects are formed by casting the address of the
922 function to `long' and converting this number to its Scheme
923 representation.
924
925 (dynamic-call FUNCTION DYNOBJ)
926
927 Call the C function indicated by FUNCTION and DYNOBJ. The
928 function is passed no arguments and its return value is ignored.
929 When FUNCTION is something returned by `dynamic-func', call that
930 function and ignore DYNOBJ. When FUNCTION is a string (or symbol,
931 etc.), look it up in DYNOBJ; this is equivalent to
932
933 (dynamic-call (dynamic-func FUNCTION DYNOBJ) #f)
934
935 Interrupts are deferred while the C function is executing (with
936 SCM_DEFER_INTS/SCM_ALLOW_INTS).
937
938 (dynamic-args-call FUNCTION DYNOBJ ARGS)
939
940 Call the C function indicated by FUNCTION and DYNOBJ, but pass it
941 some arguments and return its return value. The C function is
942 expected to take two arguments and return an `int', just like
943 `main':
944
945 int c_func (int argc, char **argv);
946
947 ARGS must be a list of strings and is converted into an array of
948 `char *'. The array is passed in ARGV and its size in ARGC. The
949 return value is converted to a Scheme number and returned from the
950 call to `dynamic-args-call'.
951
0fcab5ed
JB
952When dynamic linking is disabled or not supported on your system,
953the above functions throw errors, but they are still available.
954
e035e7e6
MV
955Here is a small example that works on GNU/Linux:
956
957 (define libc-obj (dynamic-link "libc.so"))
958 (dynamic-args-call 'rand libc-obj '())
959
960See the file `libguile/DYNAMIC-LINKING' for additional comments.
961
27590f82
JB
962** The #/ syntax for module names is depreciated, and will be removed
963in a future version of Guile. Instead of
964
965 #/foo/bar/baz
966
967instead write
968
969 (foo bar baz)
970
971The latter syntax is more consistent with existing Lisp practice.
972
5dade857
MV
973** Guile now does fancier printing of structures. Structures are the
974underlying implementation for records, which in turn are used to
975implement modules, so all of these object now print differently and in
976a more informative way.
977
161029df
JB
978The Scheme printer will examine the builtin variable *struct-printer*
979whenever it needs to print a structure object. When this variable is
980not `#f' it is deemed to be a procedure and will be applied to the
981structure object and the output port. When *struct-printer* is `#f'
982or the procedure return `#f' the structure object will be printed in
983the boring #<struct 80458270> form.
5dade857
MV
984
985This hook is used by some routines in ice-9/boot-9.scm to implement
986type specific printing routines. Please read the comments there about
987"printing structs".
988
989One of the more specific uses of structs are records. The printing
990procedure that could be passed to MAKE-RECORD-TYPE is now actually
991called. It should behave like a *struct-printer* procedure (described
992above).
993
b83b8bee
JB
994** Guile now supports a new R4RS-compliant syntax for keywords. A
995token of the form #:NAME, where NAME has the same syntax as a Scheme
996symbol, is the external representation of the keyword named NAME.
997Keyword objects print using this syntax as well, so values containing
1e5afba0
JB
998keyword objects can be read back into Guile. When used in an
999expression, keywords are self-quoting objects.
b83b8bee
JB
1000
1001Guile suports this read syntax, and uses this print syntax, regardless
1002of the current setting of the `keyword' read option. The `keyword'
1003read option only controls whether Guile recognizes the `:NAME' syntax,
1004which is incompatible with R4RS. (R4RS says such token represent
1005symbols.)
737c9113
JB
1006
1007** Guile has regular expression support again. Guile 1.0 included
1008functions for matching regular expressions, based on the Rx library.
1009In Guile 1.1, the Guile/Rx interface was removed to simplify the
1010distribution, and thus Guile had no regular expression support. Guile
94982a4e
JB
10111.2 again supports the most commonly used functions, and supports all
1012of SCSH's regular expression functions.
2409cdfa 1013
94982a4e
JB
1014If your system does not include a POSIX regular expression library,
1015and you have not linked Guile with a third-party regexp library such as
1016Rx, these functions will not be available. You can tell whether your
1017Guile installation includes regular expression support by checking
1018whether the `*features*' list includes the `regex' symbol.
737c9113 1019
94982a4e 1020*** regexp functions
161029df 1021
94982a4e
JB
1022By default, Guile supports POSIX extended regular expressions. That
1023means that the characters `(', `)', `+' and `?' are special, and must
1024be escaped if you wish to match the literal characters.
e1a191a8 1025
94982a4e
JB
1026This regular expression interface was modeled after that implemented
1027by SCSH, the Scheme Shell. It is intended to be upwardly compatible
1028with SCSH regular expressions.
1029
1030**** Function: string-match PATTERN STR [START]
1031 Compile the string PATTERN into a regular expression and compare
1032 it with STR. The optional numeric argument START specifies the
1033 position of STR at which to begin matching.
1034
1035 `string-match' returns a "match structure" which describes what,
1036 if anything, was matched by the regular expression. *Note Match
1037 Structures::. If STR does not match PATTERN at all,
1038 `string-match' returns `#f'.
1039
1040 Each time `string-match' is called, it must compile its PATTERN
1041argument into a regular expression structure. This operation is
1042expensive, which makes `string-match' inefficient if the same regular
1043expression is used several times (for example, in a loop). For better
1044performance, you can compile a regular expression in advance and then
1045match strings against the compiled regexp.
1046
1047**** Function: make-regexp STR [FLAGS]
1048 Compile the regular expression described by STR, and return the
1049 compiled regexp structure. If STR does not describe a legal
1050 regular expression, `make-regexp' throws a
1051 `regular-expression-syntax' error.
1052
1053 FLAGS may be the bitwise-or of one or more of the following:
1054
1055**** Constant: regexp/extended
1056 Use POSIX Extended Regular Expression syntax when interpreting
1057 STR. If not set, POSIX Basic Regular Expression syntax is used.
1058 If the FLAGS argument is omitted, we assume regexp/extended.
1059
1060**** Constant: regexp/icase
1061 Do not differentiate case. Subsequent searches using the
1062 returned regular expression will be case insensitive.
1063
1064**** Constant: regexp/newline
1065 Match-any-character operators don't match a newline.
1066
1067 A non-matching list ([^...]) not containing a newline matches a
1068 newline.
1069
1070 Match-beginning-of-line operator (^) matches the empty string
1071 immediately after a newline, regardless of whether the FLAGS
1072 passed to regexp-exec contain regexp/notbol.
1073
1074 Match-end-of-line operator ($) matches the empty string
1075 immediately before a newline, regardless of whether the FLAGS
1076 passed to regexp-exec contain regexp/noteol.
1077
1078**** Function: regexp-exec REGEXP STR [START [FLAGS]]
1079 Match the compiled regular expression REGEXP against `str'. If
1080 the optional integer START argument is provided, begin matching
1081 from that position in the string. Return a match structure
1082 describing the results of the match, or `#f' if no match could be
1083 found.
1084
1085 FLAGS may be the bitwise-or of one or more of the following:
1086
1087**** Constant: regexp/notbol
1088 The match-beginning-of-line operator always fails to match (but
1089 see the compilation flag regexp/newline above) This flag may be
1090 used when different portions of a string are passed to
1091 regexp-exec and the beginning of the string should not be
1092 interpreted as the beginning of the line.
1093
1094**** Constant: regexp/noteol
1095 The match-end-of-line operator always fails to match (but see the
1096 compilation flag regexp/newline above)
1097
1098**** Function: regexp? OBJ
1099 Return `#t' if OBJ is a compiled regular expression, or `#f'
1100 otherwise.
1101
1102 Regular expressions are commonly used to find patterns in one string
1103and replace them with the contents of another string.
1104
1105**** Function: regexp-substitute PORT MATCH [ITEM...]
1106 Write to the output port PORT selected contents of the match
1107 structure MATCH. Each ITEM specifies what should be written, and
1108 may be one of the following arguments:
1109
1110 * A string. String arguments are written out verbatim.
1111
1112 * An integer. The submatch with that number is written.
1113
1114 * The symbol `pre'. The portion of the matched string preceding
1115 the regexp match is written.
1116
1117 * The symbol `post'. The portion of the matched string
1118 following the regexp match is written.
1119
1120 PORT may be `#f', in which case nothing is written; instead,
1121 `regexp-substitute' constructs a string from the specified ITEMs
1122 and returns that.
1123
1124**** Function: regexp-substitute/global PORT REGEXP TARGET [ITEM...]
1125 Similar to `regexp-substitute', but can be used to perform global
1126 substitutions on STR. Instead of taking a match structure as an
1127 argument, `regexp-substitute/global' takes two string arguments: a
1128 REGEXP string describing a regular expression, and a TARGET string
1129 which should be matched against this regular expression.
1130
1131 Each ITEM behaves as in REGEXP-SUBSTITUTE, with the following
1132 exceptions:
1133
1134 * A function may be supplied. When this function is called, it
1135 will be passed one argument: a match structure for a given
1136 regular expression match. It should return a string to be
1137 written out to PORT.
1138
1139 * The `post' symbol causes `regexp-substitute/global' to recurse
1140 on the unmatched portion of STR. This *must* be supplied in
1141 order to perform global search-and-replace on STR; if it is
1142 not present among the ITEMs, then `regexp-substitute/global'
1143 will return after processing a single match.
1144
1145*** Match Structures
1146
1147 A "match structure" is the object returned by `string-match' and
1148`regexp-exec'. It describes which portion of a string, if any, matched
1149the given regular expression. Match structures include: a reference to
1150the string that was checked for matches; the starting and ending
1151positions of the regexp match; and, if the regexp included any
1152parenthesized subexpressions, the starting and ending positions of each
1153submatch.
1154
1155 In each of the regexp match functions described below, the `match'
1156argument must be a match structure returned by a previous call to
1157`string-match' or `regexp-exec'. Most of these functions return some
1158information about the original target string that was matched against a
1159regular expression; we will call that string TARGET for easy reference.
1160
1161**** Function: regexp-match? OBJ
1162 Return `#t' if OBJ is a match structure returned by a previous
1163 call to `regexp-exec', or `#f' otherwise.
1164
1165**** Function: match:substring MATCH [N]
1166 Return the portion of TARGET matched by subexpression number N.
1167 Submatch 0 (the default) represents the entire regexp match. If
1168 the regular expression as a whole matched, but the subexpression
1169 number N did not match, return `#f'.
1170
1171**** Function: match:start MATCH [N]
1172 Return the starting position of submatch number N.
1173
1174**** Function: match:end MATCH [N]
1175 Return the ending position of submatch number N.
1176
1177**** Function: match:prefix MATCH
1178 Return the unmatched portion of TARGET preceding the regexp match.
1179
1180**** Function: match:suffix MATCH
1181 Return the unmatched portion of TARGET following the regexp match.
1182
1183**** Function: match:count MATCH
1184 Return the number of parenthesized subexpressions from MATCH.
1185 Note that the entire regular expression match itself counts as a
1186 subexpression, and failed submatches are included in the count.
1187
1188**** Function: match:string MATCH
1189 Return the original TARGET string.
1190
1191*** Backslash Escapes
1192
1193 Sometimes you will want a regexp to match characters like `*' or `$'
1194exactly. For example, to check whether a particular string represents
1195a menu entry from an Info node, it would be useful to match it against
1196a regexp like `^* [^:]*::'. However, this won't work; because the
1197asterisk is a metacharacter, it won't match the `*' at the beginning of
1198the string. In this case, we want to make the first asterisk un-magic.
1199
1200 You can do this by preceding the metacharacter with a backslash
1201character `\'. (This is also called "quoting" the metacharacter, and
1202is known as a "backslash escape".) When Guile sees a backslash in a
1203regular expression, it considers the following glyph to be an ordinary
1204character, no matter what special meaning it would ordinarily have.
1205Therefore, we can make the above example work by changing the regexp to
1206`^\* [^:]*::'. The `\*' sequence tells the regular expression engine
1207to match only a single asterisk in the target string.
1208
1209 Since the backslash is itself a metacharacter, you may force a
1210regexp to match a backslash in the target string by preceding the
1211backslash with itself. For example, to find variable references in a
1212TeX program, you might want to find occurrences of the string `\let\'
1213followed by any number of alphabetic characters. The regular expression
1214`\\let\\[A-Za-z]*' would do this: the double backslashes in the regexp
1215each match a single backslash in the target string.
1216
1217**** Function: regexp-quote STR
1218 Quote each special character found in STR with a backslash, and
1219 return the resulting string.
1220
1221 *Very important:* Using backslash escapes in Guile source code (as
1222in Emacs Lisp or C) can be tricky, because the backslash character has
1223special meaning for the Guile reader. For example, if Guile encounters
1224the character sequence `\n' in the middle of a string while processing
1225Scheme code, it replaces those characters with a newline character.
1226Similarly, the character sequence `\t' is replaced by a horizontal tab.
1227Several of these "escape sequences" are processed by the Guile reader
1228before your code is executed. Unrecognized escape sequences are
1229ignored: if the characters `\*' appear in a string, they will be
1230translated to the single character `*'.
1231
1232 This translation is obviously undesirable for regular expressions,
1233since we want to be able to include backslashes in a string in order to
1234escape regexp metacharacters. Therefore, to make sure that a backslash
1235is preserved in a string in your Guile program, you must use *two*
1236consecutive backslashes:
1237
1238 (define Info-menu-entry-pattern (make-regexp "^\\* [^:]*"))
1239
1240 The string in this example is preprocessed by the Guile reader before
1241any code is executed. The resulting argument to `make-regexp' is the
1242string `^\* [^:]*', which is what we really want.
1243
1244 This also means that in order to write a regular expression that
1245matches a single backslash character, the regular expression string in
1246the source code must include *four* backslashes. Each consecutive pair
1247of backslashes gets translated by the Guile reader to a single
1248backslash, and the resulting double-backslash is interpreted by the
1249regexp engine as matching a single backslash character. Hence:
1250
1251 (define tex-variable-pattern (make-regexp "\\\\let\\\\=[A-Za-z]*"))
1252
1253 The reason for the unwieldiness of this syntax is historical. Both
1254regular expression pattern matchers and Unix string processing systems
1255have traditionally used backslashes with the special meanings described
1256above. The POSIX regular expression specification and ANSI C standard
1257both require these semantics. Attempting to abandon either convention
1258would cause other kinds of compatibility problems, possibly more severe
1259ones. Therefore, without extending the Scheme reader to support
1260strings with different quoting conventions (an ungainly and confusing
1261extension when implemented in other languages), we must adhere to this
1262cumbersome escape syntax.
1263
7ad3c1e7
GH
1264* Changes to the gh_ interface
1265
1266* Changes to the scm_ interface
1267
1268* Changes to system call interfaces:
94982a4e 1269
7ad3c1e7 1270** The value returned by `raise' is now unspecified. It throws an exception
e1a191a8
GH
1271if an error occurs.
1272
94982a4e 1273*** A new procedure `sigaction' can be used to install signal handlers
115b09a5
GH
1274
1275(sigaction signum [action] [flags])
1276
1277signum is the signal number, which can be specified using the value
1278of SIGINT etc.
1279
1280If action is omitted, sigaction returns a pair: the CAR is the current
1281signal hander, which will be either an integer with the value SIG_DFL
1282(default action) or SIG_IGN (ignore), or the Scheme procedure which
1283handles the signal, or #f if a non-Scheme procedure handles the
1284signal. The CDR contains the current sigaction flags for the handler.
1285
1286If action is provided, it is installed as the new handler for signum.
1287action can be a Scheme procedure taking one argument, or the value of
1288SIG_DFL (default action) or SIG_IGN (ignore), or #f to restore
1289whatever signal handler was installed before sigaction was first used.
1290Flags can optionally be specified for the new handler (SA_RESTART is
1291always used if the system provides it, so need not be specified.) The
1292return value is a pair with information about the old handler as
1293described above.
1294
1295This interface does not provide access to the "signal blocking"
1296facility. Maybe this is not needed, since the thread support may
1297provide solutions to the problem of consistent access to data
1298structures.
e1a191a8 1299
94982a4e 1300*** A new procedure `flush-all-ports' is equivalent to running
89ea5b7c
GH
1301`force-output' on every port open for output.
1302
94982a4e
JB
1303** Guile now provides information on how it was built, via the new
1304global variable, %guile-build-info. This variable records the values
1305of the standard GNU makefile directory variables as an assocation
1306list, mapping variable names (symbols) onto directory paths (strings).
1307For example, to find out where the Guile link libraries were
1308installed, you can say:
1309
1310guile -c "(display (assq-ref %guile-build-info 'libdir)) (newline)"
1311
1312
1313* Changes to the scm_ interface
1314
1315** The new function scm_handle_by_message_noexit is just like the
1316existing scm_handle_by_message function, except that it doesn't call
1317exit to terminate the process. Instead, it prints a message and just
1318returns #f. This might be a more appropriate catch-all handler for
1319new dynamic roots and threads.
1320
cf78e9e8 1321\f
c484bf7f 1322Changes in Guile 1.1 (released Friday, May 16 1997):
f3b1485f
JB
1323
1324* Changes to the distribution.
1325
1326The Guile 1.0 distribution has been split up into several smaller
1327pieces:
1328guile-core --- the Guile interpreter itself.
1329guile-tcltk --- the interface between the Guile interpreter and
1330 Tcl/Tk; Tcl is an interpreter for a stringy language, and Tk
1331 is a toolkit for building graphical user interfaces.
1332guile-rgx-ctax --- the interface between Guile and the Rx regular
1333 expression matcher, and the translator for the Ctax
1334 programming language. These are packaged together because the
1335 Ctax translator uses Rx to parse Ctax source code.
1336
095936d2
JB
1337This NEWS file describes the changes made to guile-core since the 1.0
1338release.
1339
48d224d7
JB
1340We no longer distribute the documentation, since it was either out of
1341date, or incomplete. As soon as we have current documentation, we
1342will distribute it.
1343
0fcab5ed
JB
1344
1345
f3b1485f
JB
1346* Changes to the stand-alone interpreter
1347
48d224d7
JB
1348** guile now accepts command-line arguments compatible with SCSH, Olin
1349Shivers' Scheme Shell.
1350
1351In general, arguments are evaluated from left to right, but there are
1352exceptions. The following switches stop argument processing, and
1353stash all remaining command-line arguments as the value returned by
1354the (command-line) function.
1355 -s SCRIPT load Scheme source code from FILE, and exit
1356 -c EXPR evalute Scheme expression EXPR, and exit
1357 -- stop scanning arguments; run interactively
1358
1359The switches below are processed as they are encountered.
1360 -l FILE load Scheme source code from FILE
1361 -e FUNCTION after reading script, apply FUNCTION to
1362 command line arguments
1363 -ds do -s script at this point
1364 --emacs enable Emacs protocol (experimental)
1365 -h, --help display this help and exit
1366 -v, --version display version information and exit
1367 \ read arguments from following script lines
1368
1369So, for example, here is a Guile script named `ekko' (thanks, Olin)
1370which re-implements the traditional "echo" command:
1371
1372#!/usr/local/bin/guile -s
1373!#
1374(define (main args)
1375 (map (lambda (arg) (display arg) (display " "))
1376 (cdr args))
1377 (newline))
1378
1379(main (command-line))
1380
1381Suppose we invoke this script as follows:
1382
1383 ekko a speckled gecko
1384
1385Through the magic of Unix script processing (triggered by the `#!'
1386token at the top of the file), /usr/local/bin/guile receives the
1387following list of command-line arguments:
1388
1389 ("-s" "./ekko" "a" "speckled" "gecko")
1390
1391Unix inserts the name of the script after the argument specified on
1392the first line of the file (in this case, "-s"), and then follows that
1393with the arguments given to the script. Guile loads the script, which
1394defines the `main' function, and then applies it to the list of
1395remaining command-line arguments, ("a" "speckled" "gecko").
1396
095936d2
JB
1397In Unix, the first line of a script file must take the following form:
1398
1399#!INTERPRETER ARGUMENT
1400
1401where INTERPRETER is the absolute filename of the interpreter
1402executable, and ARGUMENT is a single command-line argument to pass to
1403the interpreter.
1404
1405You may only pass one argument to the interpreter, and its length is
1406limited. These restrictions can be annoying to work around, so Guile
1407provides a general mechanism (borrowed from, and compatible with,
1408SCSH) for circumventing them.
1409
1410If the ARGUMENT in a Guile script is a single backslash character,
1411`\', Guile will open the script file, parse arguments from its second
1412and subsequent lines, and replace the `\' with them. So, for example,
1413here is another implementation of the `ekko' script:
1414
1415#!/usr/local/bin/guile \
1416-e main -s
1417!#
1418(define (main args)
1419 (for-each (lambda (arg) (display arg) (display " "))
1420 (cdr args))
1421 (newline))
1422
1423If the user invokes this script as follows:
1424
1425 ekko a speckled gecko
1426
1427Unix expands this into
1428
1429 /usr/local/bin/guile \ ekko a speckled gecko
1430
1431When Guile sees the `\' argument, it replaces it with the arguments
1432read from the second line of the script, producing:
1433
1434 /usr/local/bin/guile -e main -s ekko a speckled gecko
1435
1436This tells Guile to load the `ekko' script, and apply the function
1437`main' to the argument list ("a" "speckled" "gecko").
1438
1439Here is how Guile parses the command-line arguments:
1440- Each space character terminates an argument. This means that two
1441 spaces in a row introduce an empty-string argument.
1442- The tab character is not permitted (unless you quote it with the
1443 backslash character, as described below), to avoid confusion.
1444- The newline character terminates the sequence of arguments, and will
1445 also terminate a final non-empty argument. (However, a newline
1446 following a space will not introduce a final empty-string argument;
1447 it only terminates the argument list.)
1448- The backslash character is the escape character. It escapes
1449 backslash, space, tab, and newline. The ANSI C escape sequences
1450 like \n and \t are also supported. These produce argument
1451 constituents; the two-character combination \n doesn't act like a
1452 terminating newline. The escape sequence \NNN for exactly three
1453 octal digits reads as the character whose ASCII code is NNN. As
1454 above, characters produced this way are argument constituents.
1455 Backslash followed by other characters is not allowed.
1456
48d224d7
JB
1457* Changes to the procedure for linking libguile with your programs
1458
1459** Guile now builds and installs a shared guile library, if your
1460system support shared libraries. (It still builds a static library on
1461all systems.) Guile automatically detects whether your system
1462supports shared libraries. To prevent Guile from buildisg shared
1463libraries, pass the `--disable-shared' flag to the configure script.
1464
1465Guile takes longer to compile when it builds shared libraries, because
1466it must compile every file twice --- once to produce position-
1467independent object code, and once to produce normal object code.
1468
1469** The libthreads library has been merged into libguile.
1470
1471To link a program against Guile, you now need only link against
1472-lguile and -lqt; -lthreads is no longer needed. If you are using
1473autoconf to generate configuration scripts for your application, the
1474following lines should suffice to add the appropriate libraries to
1475your link command:
1476
1477### Find quickthreads and libguile.
1478AC_CHECK_LIB(qt, main)
1479AC_CHECK_LIB(guile, scm_shell)
f3b1485f
JB
1480
1481* Changes to Scheme functions
1482
095936d2
JB
1483** Guile Scheme's special syntax for keyword objects is now optional,
1484and disabled by default.
1485
1486The syntax variation from R4RS made it difficult to port some
1487interesting packages to Guile. The routines which accepted keyword
1488arguments (mostly in the module system) have been modified to also
1489accept symbols whose names begin with `:'.
1490
1491To change the keyword syntax, you must first import the (ice-9 debug)
1492module:
1493 (use-modules (ice-9 debug))
1494
1495Then you can enable the keyword syntax as follows:
1496 (read-set! keywords 'prefix)
1497
1498To disable keyword syntax, do this:
1499 (read-set! keywords #f)
1500
1501** Many more primitive functions accept shared substrings as
1502arguments. In the past, these functions required normal, mutable
1503strings as arguments, although they never made use of this
1504restriction.
1505
1506** The uniform array functions now operate on byte vectors. These
1507functions are `array-fill!', `serial-array-copy!', `array-copy!',
1508`serial-array-map', `array-map', `array-for-each', and
1509`array-index-map!'.
1510
1511** The new functions `trace' and `untrace' implement simple debugging
1512support for Scheme functions.
1513
1514The `trace' function accepts any number of procedures as arguments,
1515and tells the Guile interpreter to display each procedure's name and
1516arguments each time the procedure is invoked. When invoked with no
1517arguments, `trace' returns the list of procedures currently being
1518traced.
1519
1520The `untrace' function accepts any number of procedures as arguments,
1521and tells the Guile interpreter not to trace them any more. When
1522invoked with no arguments, `untrace' untraces all curretly traced
1523procedures.
1524
1525The tracing in Guile has an advantage over most other systems: we
1526don't create new procedure objects, but mark the procedure objects
1527themselves. This means that anonymous and internal procedures can be
1528traced.
1529
1530** The function `assert-repl-prompt' has been renamed to
1531`set-repl-prompt!'. It takes one argument, PROMPT.
1532- If PROMPT is #f, the Guile read-eval-print loop will not prompt.
1533- If PROMPT is a string, we use it as a prompt.
1534- If PROMPT is a procedure accepting no arguments, we call it, and
1535 display the result as a prompt.
1536- Otherwise, we display "> ".
1537
1538** The new function `eval-string' reads Scheme expressions from a
1539string and evaluates them, returning the value of the last expression
1540in the string. If the string contains no expressions, it returns an
1541unspecified value.
1542
1543** The new function `thunk?' returns true iff its argument is a
1544procedure of zero arguments.
1545
1546** `defined?' is now a builtin function, instead of syntax. This
1547means that its argument should be quoted. It returns #t iff its
1548argument is bound in the current module.
1549
1550** The new syntax `use-modules' allows you to add new modules to your
1551environment without re-typing a complete `define-module' form. It
1552accepts any number of module names as arguments, and imports their
1553public bindings into the current module.
1554
1555** The new function (module-defined? NAME MODULE) returns true iff
1556NAME, a symbol, is defined in MODULE, a module object.
1557
1558** The new function `builtin-bindings' creates and returns a hash
1559table containing copies of all the root module's bindings.
1560
1561** The new function `builtin-weak-bindings' does the same as
1562`builtin-bindings', but creates a doubly-weak hash table.
1563
1564** The `equal?' function now considers variable objects to be
1565equivalent if they have the same name and the same value.
1566
1567** The new function `command-line' returns the command-line arguments
1568given to Guile, as a list of strings.
1569
1570When using guile as a script interpreter, `command-line' returns the
1571script's arguments; those processed by the interpreter (like `-s' or
1572`-c') are omitted. (In other words, you get the normal, expected
1573behavior.) Any application that uses scm_shell to process its
1574command-line arguments gets this behavior as well.
1575
1576** The new function `load-user-init' looks for a file called `.guile'
1577in the user's home directory, and loads it if it exists. This is
1578mostly for use by the code generated by scm_compile_shell_switches,
1579but we thought it might also be useful in other circumstances.
1580
1581** The new function `log10' returns the base-10 logarithm of its
1582argument.
1583
1584** Changes to I/O functions
1585
1586*** The functions `read', `primitive-load', `read-and-eval!', and
1587`primitive-load-path' no longer take optional arguments controlling
1588case insensitivity and a `#' parser.
1589
1590Case sensitivity is now controlled by a read option called
1591`case-insensitive'. The user can add new `#' syntaxes with the
1592`read-hash-extend' function (see below).
1593
1594*** The new function `read-hash-extend' allows the user to change the
1595syntax of Guile Scheme in a somewhat controlled way.
1596
1597(read-hash-extend CHAR PROC)
1598 When parsing S-expressions, if we read a `#' character followed by
1599 the character CHAR, use PROC to parse an object from the stream.
1600 If PROC is #f, remove any parsing procedure registered for CHAR.
1601
1602 The reader applies PROC to two arguments: CHAR and an input port.
1603
1604*** The new functions read-delimited and read-delimited! provide a
1605general mechanism for doing delimited input on streams.
1606
1607(read-delimited DELIMS [PORT HANDLE-DELIM])
1608 Read until we encounter one of the characters in DELIMS (a string),
1609 or end-of-file. PORT is the input port to read from; it defaults to
1610 the current input port. The HANDLE-DELIM parameter determines how
1611 the terminating character is handled; it should be one of the
1612 following symbols:
1613
1614 'trim omit delimiter from result
1615 'peek leave delimiter character in input stream
1616 'concat append delimiter character to returned value
1617 'split return a pair: (RESULT . TERMINATOR)
1618
1619 HANDLE-DELIM defaults to 'peek.
1620
1621(read-delimited! DELIMS BUF [PORT HANDLE-DELIM START END])
1622 A side-effecting variant of `read-delimited'.
1623
1624 The data is written into the string BUF at the indices in the
1625 half-open interval [START, END); the default interval is the whole
1626 string: START = 0 and END = (string-length BUF). The values of
1627 START and END must specify a well-defined interval in BUF, i.e.
1628 0 <= START <= END <= (string-length BUF).
1629
1630 It returns NBYTES, the number of bytes read. If the buffer filled
1631 up without a delimiter character being found, it returns #f. If the
1632 port is at EOF when the read starts, it returns the EOF object.
1633
1634 If an integer is returned (i.e., the read is successfully terminated
1635 by reading a delimiter character), then the HANDLE-DELIM parameter
1636 determines how to handle the terminating character. It is described
1637 above, and defaults to 'peek.
1638
1639(The descriptions of these functions were borrowed from the SCSH
1640manual, by Olin Shivers and Brian Carlstrom.)
1641
1642*** The `%read-delimited!' function is the primitive used to implement
1643`read-delimited' and `read-delimited!'.
1644
1645(%read-delimited! DELIMS BUF GOBBLE? [PORT START END])
1646
1647This returns a pair of values: (TERMINATOR . NUM-READ).
1648- TERMINATOR describes why the read was terminated. If it is a
1649 character or the eof object, then that is the value that terminated
1650 the read. If it is #f, the function filled the buffer without finding
1651 a delimiting character.
1652- NUM-READ is the number of characters read into BUF.
1653
1654If the read is successfully terminated by reading a delimiter
1655character, then the gobble? parameter determines what to do with the
1656terminating character. If true, the character is removed from the
1657input stream; if false, the character is left in the input stream
1658where a subsequent read operation will retrieve it. In either case,
1659the character is also the first value returned by the procedure call.
1660
1661(The descriptions of this function was borrowed from the SCSH manual,
1662by Olin Shivers and Brian Carlstrom.)
1663
1664*** The `read-line' and `read-line!' functions have changed; they now
1665trim the terminator by default; previously they appended it to the
1666returned string. For the old behavior, use (read-line PORT 'concat).
1667
1668*** The functions `uniform-array-read!' and `uniform-array-write!' now
1669take new optional START and END arguments, specifying the region of
1670the array to read and write.
1671
f348c807
JB
1672*** The `ungetc-char-ready?' function has been removed. We feel it's
1673inappropriate for an interface to expose implementation details this
1674way.
095936d2
JB
1675
1676** Changes to the Unix library and system call interface
1677
1678*** The new fcntl function provides access to the Unix `fcntl' system
1679call.
1680
1681(fcntl PORT COMMAND VALUE)
1682 Apply COMMAND to PORT's file descriptor, with VALUE as an argument.
1683 Values for COMMAND are:
1684
1685 F_DUPFD duplicate a file descriptor
1686 F_GETFD read the descriptor's close-on-exec flag
1687 F_SETFD set the descriptor's close-on-exec flag to VALUE
1688 F_GETFL read the descriptor's flags, as set on open
1689 F_SETFL set the descriptor's flags, as set on open to VALUE
1690 F_GETOWN return the process ID of a socket's owner, for SIGIO
1691 F_SETOWN set the process that owns a socket to VALUE, for SIGIO
1692 FD_CLOEXEC not sure what this is
1693
1694For details, see the documentation for the fcntl system call.
1695
1696*** The arguments to `select' have changed, for compatibility with
1697SCSH. The TIMEOUT parameter may now be non-integral, yielding the
1698expected behavior. The MILLISECONDS parameter has been changed to
1699MICROSECONDS, to more closely resemble the underlying system call.
1700The RVEC, WVEC, and EVEC arguments can now be vectors; the type of the
1701corresponding return set will be the same.
1702
1703*** The arguments to the `mknod' system call have changed. They are
1704now:
1705
1706(mknod PATH TYPE PERMS DEV)
1707 Create a new file (`node') in the file system. PATH is the name of
1708 the file to create. TYPE is the kind of file to create; it should
1709 be 'fifo, 'block-special, or 'char-special. PERMS specifies the
1710 permission bits to give the newly created file. If TYPE is
1711 'block-special or 'char-special, DEV specifies which device the
1712 special file refers to; its interpretation depends on the kind of
1713 special file being created.
1714
1715*** The `fork' function has been renamed to `primitive-fork', to avoid
1716clashing with various SCSH forks.
1717
1718*** The `recv' and `recvfrom' functions have been renamed to `recv!'
1719and `recvfrom!'. They no longer accept a size for a second argument;
1720you must pass a string to hold the received value. They no longer
1721return the buffer. Instead, `recv' returns the length of the message
1722received, and `recvfrom' returns a pair containing the packet's length
1723and originating address.
1724
1725*** The file descriptor datatype has been removed, as have the
1726`read-fd', `write-fd', `close', `lseek', and `dup' functions.
1727We plan to replace these functions with a SCSH-compatible interface.
1728
1729*** The `create' function has been removed; it's just a special case
1730of `open'.
1731
1732*** There are new functions to break down process termination status
1733values. In the descriptions below, STATUS is a value returned by
1734`waitpid'.
1735
1736(status:exit-val STATUS)
1737 If the child process exited normally, this function returns the exit
1738 code for the child process (i.e., the value passed to exit, or
1739 returned from main). If the child process did not exit normally,
1740 this function returns #f.
1741
1742(status:stop-sig STATUS)
1743 If the child process was suspended by a signal, this function
1744 returns the signal that suspended the child. Otherwise, it returns
1745 #f.
1746
1747(status:term-sig STATUS)
1748 If the child process terminated abnormally, this function returns
1749 the signal that terminated the child. Otherwise, this function
1750 returns false.
1751
1752POSIX promises that exactly one of these functions will return true on
1753a valid STATUS value.
1754
1755These functions are compatible with SCSH.
1756
1757*** There are new accessors and setters for the broken-out time vectors
48d224d7
JB
1758returned by `localtime', `gmtime', and that ilk. They are:
1759
1760 Component Accessor Setter
1761 ========================= ============ ============
1762 seconds tm:sec set-tm:sec
1763 minutes tm:min set-tm:min
1764 hours tm:hour set-tm:hour
1765 day of the month tm:mday set-tm:mday
1766 month tm:mon set-tm:mon
1767 year tm:year set-tm:year
1768 day of the week tm:wday set-tm:wday
1769 day in the year tm:yday set-tm:yday
1770 daylight saving time tm:isdst set-tm:isdst
1771 GMT offset, seconds tm:gmtoff set-tm:gmtoff
1772 name of time zone tm:zone set-tm:zone
1773
095936d2
JB
1774*** There are new accessors for the vectors returned by `uname',
1775describing the host system:
48d224d7
JB
1776
1777 Component Accessor
1778 ============================================== ================
1779 name of the operating system implementation utsname:sysname
1780 network name of this machine utsname:nodename
1781 release level of the operating system utsname:release
1782 version level of the operating system utsname:version
1783 machine hardware platform utsname:machine
1784
095936d2
JB
1785*** There are new accessors for the vectors returned by `getpw',
1786`getpwnam', `getpwuid', and `getpwent', describing entries from the
1787system's user database:
1788
1789 Component Accessor
1790 ====================== =================
1791 user name passwd:name
1792 user password passwd:passwd
1793 user id passwd:uid
1794 group id passwd:gid
1795 real name passwd:gecos
1796 home directory passwd:dir
1797 shell program passwd:shell
1798
1799*** There are new accessors for the vectors returned by `getgr',
1800`getgrnam', `getgrgid', and `getgrent', describing entries from the
1801system's group database:
1802
1803 Component Accessor
1804 ======================= ============
1805 group name group:name
1806 group password group:passwd
1807 group id group:gid
1808 group members group:mem
1809
1810*** There are new accessors for the vectors returned by `gethost',
1811`gethostbyaddr', `gethostbyname', and `gethostent', describing
1812internet hosts:
1813
1814 Component Accessor
1815 ========================= ===============
1816 official name of host hostent:name
1817 alias list hostent:aliases
1818 host address type hostent:addrtype
1819 length of address hostent:length
1820 list of addresses hostent:addr-list
1821
1822*** There are new accessors for the vectors returned by `getnet',
1823`getnetbyaddr', `getnetbyname', and `getnetent', describing internet
1824networks:
1825
1826 Component Accessor
1827 ========================= ===============
1828 official name of net netent:name
1829 alias list netent:aliases
1830 net number type netent:addrtype
1831 net number netent:net
1832
1833*** There are new accessors for the vectors returned by `getproto',
1834`getprotobyname', `getprotobynumber', and `getprotoent', describing
1835internet protocols:
1836
1837 Component Accessor
1838 ========================= ===============
1839 official protocol name protoent:name
1840 alias list protoent:aliases
1841 protocol number protoent:proto
1842
1843*** There are new accessors for the vectors returned by `getserv',
1844`getservbyname', `getservbyport', and `getservent', describing
1845internet protocols:
1846
1847 Component Accessor
1848 ========================= ===============
1849 official service name servent:name
1850 alias list servent:aliases
1851 port number servent:port
1852 protocol to use servent:proto
1853
1854*** There are new accessors for the sockaddr structures returned by
1855`accept', `getsockname', `getpeername', `recvfrom!':
1856
1857 Component Accessor
1858 ======================================== ===============
1859 address format (`family') sockaddr:fam
1860 path, for file domain addresses sockaddr:path
1861 address, for internet domain addresses sockaddr:addr
1862 TCP or UDP port, for internet sockaddr:port
1863
1864*** The `getpwent', `getgrent', `gethostent', `getnetent',
1865`getprotoent', and `getservent' functions now return #f at the end of
1866the user database. (They used to throw an exception.)
1867
1868Note that calling MUMBLEent function is equivalent to calling the
1869corresponding MUMBLE function with no arguments.
1870
1871*** The `setpwent', `setgrent', `sethostent', `setnetent',
1872`setprotoent', and `setservent' routines now take no arguments.
1873
1874*** The `gethost', `getproto', `getnet', and `getserv' functions now
1875provide more useful information when they throw an exception.
1876
1877*** The `lnaof' function has been renamed to `inet-lnaof'.
1878
1879*** Guile now claims to have the `current-time' feature.
1880
1881*** The `mktime' function now takes an optional second argument ZONE,
1882giving the time zone to use for the conversion. ZONE should be a
1883string, in the same format as expected for the "TZ" environment variable.
1884
1885*** The `strptime' function now returns a pair (TIME . COUNT), where
1886TIME is the parsed time as a vector, and COUNT is the number of
1887characters from the string left unparsed. This function used to
1888return the remaining characters as a string.
1889
1890*** The `gettimeofday' function has replaced the old `time+ticks' function.
1891The return value is now (SECONDS . MICROSECONDS); the fractional
1892component is no longer expressed in "ticks".
1893
1894*** The `ticks/sec' constant has been removed, in light of the above change.
6685dc83 1895
ea00ecba
MG
1896* Changes to the gh_ interface
1897
1898** gh_eval_str() now returns an SCM object which is the result of the
1899evaluation
1900
aaef0d2a
MG
1901** gh_scm2str() now copies the Scheme data to a caller-provided C
1902array
1903
1904** gh_scm2newstr() now makes a C array, copies the Scheme data to it,
1905and returns the array
1906
1907** gh_scm2str0() is gone: there is no need to distinguish
1908null-terminated from non-null-terminated, since gh_scm2newstr() allows
1909the user to interpret the data both ways.
1910
f3b1485f
JB
1911* Changes to the scm_ interface
1912
095936d2
JB
1913** The new function scm_symbol_value0 provides an easy way to get a
1914symbol's value from C code:
1915
1916SCM scm_symbol_value0 (char *NAME)
1917 Return the value of the symbol named by the null-terminated string
1918 NAME in the current module. If the symbol named NAME is unbound in
1919 the current module, return SCM_UNDEFINED.
1920
1921** The new function scm_sysintern0 creates new top-level variables,
1922without assigning them a value.
1923
1924SCM scm_sysintern0 (char *NAME)
1925 Create a new Scheme top-level variable named NAME. NAME is a
1926 null-terminated string. Return the variable's value cell.
1927
1928** The function scm_internal_catch is the guts of catch. It handles
1929all the mechanics of setting up a catch target, invoking the catch
1930body, and perhaps invoking the handler if the body does a throw.
1931
1932The function is designed to be usable from C code, but is general
1933enough to implement all the semantics Guile Scheme expects from throw.
1934
1935TAG is the catch tag. Typically, this is a symbol, but this function
1936doesn't actually care about that.
1937
1938BODY is a pointer to a C function which runs the body of the catch;
1939this is the code you can throw from. We call it like this:
1940 BODY (BODY_DATA, JMPBUF)
1941where:
1942 BODY_DATA is just the BODY_DATA argument we received; we pass it
1943 through to BODY as its first argument. The caller can make
1944 BODY_DATA point to anything useful that BODY might need.
1945 JMPBUF is the Scheme jmpbuf object corresponding to this catch,
1946 which we have just created and initialized.
1947
1948HANDLER is a pointer to a C function to deal with a throw to TAG,
1949should one occur. We call it like this:
1950 HANDLER (HANDLER_DATA, THROWN_TAG, THROW_ARGS)
1951where
1952 HANDLER_DATA is the HANDLER_DATA argument we recevied; it's the
1953 same idea as BODY_DATA above.
1954 THROWN_TAG is the tag that the user threw to; usually this is
1955 TAG, but it could be something else if TAG was #t (i.e., a
1956 catch-all), or the user threw to a jmpbuf.
1957 THROW_ARGS is the list of arguments the user passed to the THROW
1958 function.
1959
1960BODY_DATA is just a pointer we pass through to BODY. HANDLER_DATA
1961is just a pointer we pass through to HANDLER. We don't actually
1962use either of those pointers otherwise ourselves. The idea is
1963that, if our caller wants to communicate something to BODY or
1964HANDLER, it can pass a pointer to it as MUMBLE_DATA, which BODY and
1965HANDLER can then use. Think of it as a way to make BODY and
1966HANDLER closures, not just functions; MUMBLE_DATA points to the
1967enclosed variables.
1968
1969Of course, it's up to the caller to make sure that any data a
1970MUMBLE_DATA needs is protected from GC. A common way to do this is
1971to make MUMBLE_DATA a pointer to data stored in an automatic
1972structure variable; since the collector must scan the stack for
1973references anyway, this assures that any references in MUMBLE_DATA
1974will be found.
1975
1976** The new function scm_internal_lazy_catch is exactly like
1977scm_internal_catch, except:
1978
1979- It does not unwind the stack (this is the major difference).
1980- If handler returns, its value is returned from the throw.
1981- BODY always receives #f as its JMPBUF argument (since there's no
1982 jmpbuf associated with a lazy catch, because we don't unwind the
1983 stack.)
1984
1985** scm_body_thunk is a new body function you can pass to
1986scm_internal_catch if you want the body to be like Scheme's `catch'
1987--- a thunk, or a function of one argument if the tag is #f.
1988
1989BODY_DATA is a pointer to a scm_body_thunk_data structure, which
1990contains the Scheme procedure to invoke as the body, and the tag
1991we're catching. If the tag is #f, then we pass JMPBUF (created by
1992scm_internal_catch) to the body procedure; otherwise, the body gets
1993no arguments.
1994
1995** scm_handle_by_proc is a new handler function you can pass to
1996scm_internal_catch if you want the handler to act like Scheme's catch
1997--- call a procedure with the tag and the throw arguments.
1998
1999If the user does a throw to this catch, this function runs a handler
2000procedure written in Scheme. HANDLER_DATA is a pointer to an SCM
2001variable holding the Scheme procedure object to invoke. It ought to
2002be a pointer to an automatic variable (i.e., one living on the stack),
2003or the procedure object should be otherwise protected from GC.
2004
2005** scm_handle_by_message is a new handler function to use with
2006`scm_internal_catch' if you want Guile to print a message and die.
2007It's useful for dealing with throws to uncaught keys at the top level.
2008
2009HANDLER_DATA, if non-zero, is assumed to be a char * pointing to a
2010message header to print; if zero, we use "guile" instead. That
2011text is followed by a colon, then the message described by ARGS.
2012
2013** The return type of scm_boot_guile is now void; the function does
2014not return a value, and indeed, never returns at all.
2015
f3b1485f
JB
2016** The new function scm_shell makes it easy for user applications to
2017process command-line arguments in a way that is compatible with the
2018stand-alone guile interpreter (which is in turn compatible with SCSH,
2019the Scheme shell).
2020
2021To use the scm_shell function, first initialize any guile modules
2022linked into your application, and then call scm_shell with the values
7ed46dc8 2023of ARGC and ARGV your `main' function received. scm_shell will add
f3b1485f
JB
2024any SCSH-style meta-arguments from the top of the script file to the
2025argument vector, and then process the command-line arguments. This
2026generally means loading a script file or starting up an interactive
2027command interpreter. For details, see "Changes to the stand-alone
2028interpreter" above.
2029
095936d2
JB
2030** The new functions scm_get_meta_args and scm_count_argv help you
2031implement the SCSH-style meta-argument, `\'.
2032
2033char **scm_get_meta_args (int ARGC, char **ARGV)
2034 If the second element of ARGV is a string consisting of a single
2035 backslash character (i.e. "\\" in Scheme notation), open the file
2036 named by the following argument, parse arguments from it, and return
2037 the spliced command line. The returned array is terminated by a
2038 null pointer.
2039
2040 For details of argument parsing, see above, under "guile now accepts
2041 command-line arguments compatible with SCSH..."
2042
2043int scm_count_argv (char **ARGV)
2044 Count the arguments in ARGV, assuming it is terminated by a null
2045 pointer.
2046
2047For an example of how these functions might be used, see the source
2048code for the function scm_shell in libguile/script.c.
2049
2050You will usually want to use scm_shell instead of calling this
2051function yourself.
2052
2053** The new function scm_compile_shell_switches turns an array of
2054command-line arguments into Scheme code to carry out the actions they
2055describe. Given ARGC and ARGV, it returns a Scheme expression to
2056evaluate, and calls scm_set_program_arguments to make any remaining
2057command-line arguments available to the Scheme code. For example,
2058given the following arguments:
2059
2060 -e main -s ekko a speckled gecko
2061
2062scm_set_program_arguments will return the following expression:
2063
2064 (begin (load "ekko") (main (command-line)) (quit))
2065
2066You will usually want to use scm_shell instead of calling this
2067function yourself.
2068
2069** The function scm_shell_usage prints a usage message appropriate for
2070an interpreter that uses scm_compile_shell_switches to handle its
2071command-line arguments.
2072
2073void scm_shell_usage (int FATAL, char *MESSAGE)
2074 Print a usage message to the standard error output. If MESSAGE is
2075 non-zero, write it before the usage message, followed by a newline.
2076 If FATAL is non-zero, exit the process, using FATAL as the
2077 termination status. (If you want to be compatible with Guile,
2078 always use 1 as the exit status when terminating due to command-line
2079 usage problems.)
2080
2081You will usually want to use scm_shell instead of calling this
2082function yourself.
48d224d7
JB
2083
2084** scm_eval_0str now returns SCM_UNSPECIFIED if the string contains no
095936d2
JB
2085expressions. It used to return SCM_EOL. Earth-shattering.
2086
2087** The macros for declaring scheme objects in C code have been
2088rearranged slightly. They are now:
2089
2090SCM_SYMBOL (C_NAME, SCHEME_NAME)
2091 Declare a static SCM variable named C_NAME, and initialize it to
2092 point to the Scheme symbol whose name is SCHEME_NAME. C_NAME should
2093 be a C identifier, and SCHEME_NAME should be a C string.
2094
2095SCM_GLOBAL_SYMBOL (C_NAME, SCHEME_NAME)
2096 Just like SCM_SYMBOL, but make C_NAME globally visible.
2097
2098SCM_VCELL (C_NAME, SCHEME_NAME)
2099 Create a global variable at the Scheme level named SCHEME_NAME.
2100 Declare a static SCM variable named C_NAME, and initialize it to
2101 point to the Scheme variable's value cell.
2102
2103SCM_GLOBAL_VCELL (C_NAME, SCHEME_NAME)
2104 Just like SCM_VCELL, but make C_NAME globally visible.
2105
2106The `guile-snarf' script writes initialization code for these macros
2107to its standard output, given C source code as input.
2108
2109The SCM_GLOBAL macro is gone.
2110
2111** The scm_read_line and scm_read_line_x functions have been replaced
2112by Scheme code based on the %read-delimited! procedure (known to C
2113code as scm_read_delimited_x). See its description above for more
2114information.
48d224d7 2115
095936d2
JB
2116** The function scm_sys_open has been renamed to scm_open. It now
2117returns a port instead of an FD object.
ea00ecba 2118
095936d2
JB
2119* The dynamic linking support has changed. For more information, see
2120libguile/DYNAMIC-LINKING.
ea00ecba 2121
f7b47737
JB
2122\f
2123Guile 1.0b3
3065a62a 2124
f3b1485f
JB
2125User-visible changes from Thursday, September 5, 1996 until Guile 1.0
2126(Sun 5 Jan 1997):
3065a62a 2127
4b521edb 2128* Changes to the 'guile' program:
3065a62a 2129
4b521edb
JB
2130** Guile now loads some new files when it starts up. Guile first
2131searches the load path for init.scm, and loads it if found. Then, if
2132Guile is not being used to execute a script, and the user's home
2133directory contains a file named `.guile', Guile loads that.
c6486f8a 2134
4b521edb 2135** You can now use Guile as a shell script interpreter.
3065a62a
JB
2136
2137To paraphrase the SCSH manual:
2138
2139 When Unix tries to execute an executable file whose first two
2140 characters are the `#!', it treats the file not as machine code to
2141 be directly executed by the native processor, but as source code
2142 to be executed by some interpreter. The interpreter to use is
2143 specified immediately after the #! sequence on the first line of
2144 the source file. The kernel reads in the name of the interpreter,
2145 and executes that instead. It passes the interpreter the source
2146 filename as its first argument, with the original arguments
2147 following. Consult the Unix man page for the `exec' system call
2148 for more information.
2149
1a1945be
JB
2150Now you can use Guile as an interpreter, using a mechanism which is a
2151compatible subset of that provided by SCSH.
2152
3065a62a
JB
2153Guile now recognizes a '-s' command line switch, whose argument is the
2154name of a file of Scheme code to load. It also treats the two
2155characters `#!' as the start of a comment, terminated by `!#'. Thus,
2156to make a file of Scheme code directly executable by Unix, insert the
2157following two lines at the top of the file:
2158
2159#!/usr/local/bin/guile -s
2160!#
2161
2162Guile treats the argument of the `-s' command-line switch as the name
2163of a file of Scheme code to load, and treats the sequence `#!' as the
2164start of a block comment, terminated by `!#'.
2165
2166For example, here's a version of 'echo' written in Scheme:
2167
2168#!/usr/local/bin/guile -s
2169!#
2170(let loop ((args (cdr (program-arguments))))
2171 (if (pair? args)
2172 (begin
2173 (display (car args))
2174 (if (pair? (cdr args))
2175 (display " "))
2176 (loop (cdr args)))))
2177(newline)
2178
2179Why does `#!' start a block comment terminated by `!#', instead of the
2180end of the line? That is the notation SCSH uses, and although we
2181don't yet support the other SCSH features that motivate that choice,
2182we would like to be backward-compatible with any existing Guile
3763761c
JB
2183scripts once we do. Furthermore, if the path to Guile on your system
2184is too long for your kernel, you can start the script with this
2185horrible hack:
2186
2187#!/bin/sh
2188exec /really/long/path/to/guile -s "$0" ${1+"$@"}
2189!#
3065a62a
JB
2190
2191Note that some very old Unix systems don't support the `#!' syntax.
2192
c6486f8a 2193
4b521edb 2194** You can now run Guile without installing it.
6685dc83
JB
2195
2196Previous versions of the interactive Guile interpreter (`guile')
2197couldn't start up unless Guile's Scheme library had been installed;
2198they used the value of the environment variable `SCHEME_LOAD_PATH'
2199later on in the startup process, but not to find the startup code
2200itself. Now Guile uses `SCHEME_LOAD_PATH' in all searches for Scheme
2201code.
2202
2203To run Guile without installing it, build it in the normal way, and
2204then set the environment variable `SCHEME_LOAD_PATH' to a
2205colon-separated list of directories, including the top-level directory
2206of the Guile sources. For example, if you unpacked Guile so that the
2207full filename of this NEWS file is /home/jimb/guile-1.0b3/NEWS, then
2208you might say
2209
2210 export SCHEME_LOAD_PATH=/home/jimb/my-scheme:/home/jimb/guile-1.0b3
2211
c6486f8a 2212
4b521edb
JB
2213** Guile's read-eval-print loop no longer prints #<unspecified>
2214results. If the user wants to see this, she can evaluate the
2215expression (assert-repl-print-unspecified #t), perhaps in her startup
48d224d7 2216file.
6685dc83 2217
4b521edb
JB
2218** Guile no longer shows backtraces by default when an error occurs;
2219however, it does display a message saying how to get one, and how to
2220request that they be displayed by default. After an error, evaluate
2221 (backtrace)
2222to see a backtrace, and
2223 (debug-enable 'backtrace)
2224to see them by default.
6685dc83 2225
6685dc83 2226
d9fb83d9 2227
4b521edb
JB
2228* Changes to Guile Scheme:
2229
2230** Guile now distinguishes between #f and the empty list.
2231
2232This is for compatibility with the IEEE standard, the (possibly)
2233upcoming Revised^5 Report on Scheme, and many extant Scheme
2234implementations.
2235
2236Guile used to have #f and '() denote the same object, to make Scheme's
2237type system more compatible with Emacs Lisp's. However, the change
2238caused too much trouble for Scheme programmers, and we found another
2239way to reconcile Emacs Lisp with Scheme that didn't require this.
2240
2241
2242** Guile's delq, delv, delete functions, and their destructive
c6486f8a
JB
2243counterparts, delq!, delv!, and delete!, now remove all matching
2244elements from the list, not just the first. This matches the behavior
2245of the corresponding Emacs Lisp functions, and (I believe) the Maclisp
2246functions which inspired them.
2247
2248I recognize that this change may break code in subtle ways, but it
2249seems best to make the change before the FSF's first Guile release,
2250rather than after.
2251
2252
4b521edb 2253** The compiled-library-path function has been deleted from libguile.
6685dc83 2254
4b521edb 2255** The facilities for loading Scheme source files have changed.
c6486f8a 2256
4b521edb 2257*** The variable %load-path now tells Guile which directories to search
6685dc83
JB
2258for Scheme code. Its value is a list of strings, each of which names
2259a directory.
2260
4b521edb
JB
2261*** The variable %load-extensions now tells Guile which extensions to
2262try appending to a filename when searching the load path. Its value
2263is a list of strings. Its default value is ("" ".scm").
2264
2265*** (%search-load-path FILENAME) searches the directories listed in the
2266value of the %load-path variable for a Scheme file named FILENAME,
2267with all the extensions listed in %load-extensions. If it finds a
2268match, then it returns its full filename. If FILENAME is absolute, it
2269returns it unchanged. Otherwise, it returns #f.
6685dc83 2270
4b521edb
JB
2271%search-load-path will not return matches that refer to directories.
2272
2273*** (primitive-load FILENAME :optional CASE-INSENSITIVE-P SHARP)
2274uses %seach-load-path to find a file named FILENAME, and loads it if
2275it finds it. If it can't read FILENAME for any reason, it throws an
2276error.
6685dc83
JB
2277
2278The arguments CASE-INSENSITIVE-P and SHARP are interpreted as by the
4b521edb
JB
2279`read' function.
2280
2281*** load uses the same searching semantics as primitive-load.
2282
2283*** The functions %try-load, try-load-with-path, %load, load-with-path,
2284basic-try-load-with-path, basic-load-with-path, try-load-module-with-
2285path, and load-module-with-path have been deleted. The functions
2286above should serve their purposes.
2287
2288*** If the value of the variable %load-hook is a procedure,
2289`primitive-load' applies its value to the name of the file being
2290loaded (without the load path directory name prepended). If its value
2291is #f, it is ignored. Otherwise, an error occurs.
2292
2293This is mostly useful for printing load notification messages.
2294
2295
2296** The function `eval!' is no longer accessible from the scheme level.
2297We can't allow operations which introduce glocs into the scheme level,
2298because Guile's type system can't handle these as data. Use `eval' or
2299`read-and-eval!' (see below) as replacement.
2300
2301** The new function read-and-eval! reads an expression from PORT,
2302evaluates it, and returns the result. This is more efficient than
2303simply calling `read' and `eval', since it is not necessary to make a
2304copy of the expression for the evaluator to munge.
2305
2306Its optional arguments CASE_INSENSITIVE_P and SHARP are interpreted as
2307for the `read' function.
2308
2309
2310** The function `int?' has been removed; its definition was identical
2311to that of `integer?'.
2312
2313** The functions `<?', `<?', `<=?', `=?', `>?', and `>=?'. Code should
2314use the R4RS names for these functions.
2315
2316** The function object-properties no longer returns the hash handle;
2317it simply returns the object's property list.
2318
2319** Many functions have been changed to throw errors, instead of
2320returning #f on failure. The point of providing exception handling in
2321the language is to simplify the logic of user code, but this is less
2322useful if Guile's primitives don't throw exceptions.
2323
2324** The function `fileno' has been renamed from `%fileno'.
2325
2326** The function primitive-mode->fdes returns #t or #f now, not 1 or 0.
2327
2328
2329* Changes to Guile's C interface:
2330
2331** The library's initialization procedure has been simplified.
2332scm_boot_guile now has the prototype:
2333
2334void scm_boot_guile (int ARGC,
2335 char **ARGV,
2336 void (*main_func) (),
2337 void *closure);
2338
2339scm_boot_guile calls MAIN_FUNC, passing it CLOSURE, ARGC, and ARGV.
2340MAIN_FUNC should do all the work of the program (initializing other
2341packages, reading user input, etc.) before returning. When MAIN_FUNC
2342returns, call exit (0); this function never returns. If you want some
2343other exit value, MAIN_FUNC may call exit itself.
2344
2345scm_boot_guile arranges for program-arguments to return the strings
2346given by ARGC and ARGV. If MAIN_FUNC modifies ARGC/ARGV, should call
2347scm_set_program_arguments with the final list, so Scheme code will
2348know which arguments have been processed.
2349
2350scm_boot_guile establishes a catch-all catch handler which prints an
2351error message and exits the process. This means that Guile exits in a
2352coherent way when system errors occur and the user isn't prepared to
2353handle it. If the user doesn't like this behavior, they can establish
2354their own universal catcher in MAIN_FUNC to shadow this one.
2355
2356Why must the caller do all the real work from MAIN_FUNC? The garbage
2357collector assumes that all local variables of type SCM will be above
2358scm_boot_guile's stack frame on the stack. If you try to manipulate
2359SCM values after this function returns, it's the luck of the draw
2360whether the GC will be able to find the objects you allocate. So,
2361scm_boot_guile function exits, rather than returning, to discourage
2362people from making that mistake.
2363
2364The IN, OUT, and ERR arguments were removed; there are other
2365convenient ways to override these when desired.
2366
2367The RESULT argument was deleted; this function should never return.
2368
2369The BOOT_CMD argument was deleted; the MAIN_FUNC argument is more
2370general.
2371
2372
2373** Guile's header files should no longer conflict with your system's
2374header files.
2375
2376In order to compile code which #included <libguile.h>, previous
2377versions of Guile required you to add a directory containing all the
2378Guile header files to your #include path. This was a problem, since
2379Guile's header files have names which conflict with many systems'
2380header files.
2381
2382Now only <libguile.h> need appear in your #include path; you must
2383refer to all Guile's other header files as <libguile/mumble.h>.
2384Guile's installation procedure puts libguile.h in $(includedir), and
2385the rest in $(includedir)/libguile.
2386
2387
2388** Two new C functions, scm_protect_object and scm_unprotect_object,
2389have been added to the Guile library.
2390
2391scm_protect_object (OBJ) protects OBJ from the garbage collector.
2392OBJ will not be freed, even if all other references are dropped,
2393until someone does scm_unprotect_object (OBJ). Both functions
2394return OBJ.
2395
2396Note that calls to scm_protect_object do not nest. You can call
2397scm_protect_object any number of times on a given object, and the
2398next call to scm_unprotect_object will unprotect it completely.
2399
2400Basically, scm_protect_object and scm_unprotect_object just
2401maintain a list of references to things. Since the GC knows about
2402this list, all objects it mentions stay alive. scm_protect_object
2403adds its argument to the list; scm_unprotect_object remove its
2404argument from the list.
2405
2406
2407** scm_eval_0str now returns the value of the last expression
2408evaluated.
2409
2410** The new function scm_read_0str reads an s-expression from a
2411null-terminated string, and returns it.
2412
2413** The new function `scm_stdio_to_port' converts a STDIO file pointer
2414to a Scheme port object.
2415
2416** The new function `scm_set_program_arguments' allows C code to set
e80c8fea 2417the value returned by the Scheme `program-arguments' function.
6685dc83 2418
6685dc83 2419\f
1a1945be
JB
2420Older changes:
2421
2422* Guile no longer includes sophisticated Tcl/Tk support.
2423
2424The old Tcl/Tk support was unsatisfying to us, because it required the
2425user to link against the Tcl library, as well as Tk and Guile. The
2426interface was also un-lispy, in that it preserved Tcl/Tk's practice of
2427referring to widgets by names, rather than exporting widgets to Scheme
2428code as a special datatype.
2429
2430In the Usenix Tk Developer's Workshop held in July 1996, the Tcl/Tk
2431maintainers described some very interesting changes in progress to the
2432Tcl/Tk internals, which would facilitate clean interfaces between lone
2433Tk and other interpreters --- even for garbage-collected languages
2434like Scheme. They expected the new Tk to be publicly available in the
2435fall of 1996.
2436
2437Since it seems that Guile might soon have a new, cleaner interface to
2438lone Tk, and that the old Guile/Tk glue code would probably need to be
2439completely rewritten, we (Jim Blandy and Richard Stallman) have
2440decided not to support the old code. We'll spend the time instead on
2441a good interface to the newer Tk, as soon as it is available.
5c54da76 2442
8512dea6 2443Until then, gtcltk-lib provides trivial, low-maintenance functionality.
deb95d71 2444
5c54da76
JB
2445\f
2446Copyright information:
2447
ea00ecba 2448Copyright (C) 1996,1997 Free Software Foundation, Inc.
5c54da76
JB
2449
2450 Permission is granted to anyone to make or distribute verbatim copies
2451 of this document as received, in any medium, provided that the
2452 copyright notice and this permission notice are preserved,
2453 thus giving the recipient permission to redistribute in turn.
2454
2455 Permission is granted to distribute modified versions
2456 of this document, or of portions of it,
2457 under the above conditions, provided also that they
2458 carry prominent notices stating who last changed them.
2459
48d224d7
JB
2460\f
2461Local variables:
2462mode: outline
2463paragraph-separate: "[ \f]*$"
2464end:
2465