scm_array_map & co
[bpt/guile.git] / NEWS
1 Guile NEWS --- history of user-visible changes. -*- text -*-
2 Copyright (C) 1996, 1997 Free Software Foundation, Inc.
3 See the end for copying conditions.
4
5 Please send Guile bug reports to bug-guile@prep.ai.mit.edu.
6 \f
7 Changes since Guile 1.2:
8
9 * Changes to the distribution
10
11 ** libguile/append.h, libguile/append.c, libguile/sequences.h,
12 libguile/sequences.c removed.
13
14 * Changes to the stand-alone interpreter
15
16 * Changes to the procedure for linking libguile with your programs
17
18 * Changes to Scheme functions and syntax
19
20 ** The detection of circular references has been extended to structs.
21 That is, a structure that -- in the process of being printed -- prints
22 itself does not lead to infinite recursion.
23
24 ** There is now some basic support for fluids. Please read
25 "libguile/fluid.h" to find out more. It is accessible from Scheme with
26 the following functions and macros:
27
28 Function: make-fluid
29
30 Create a new fluid object. Fluids are not special variables or
31 some other extension to the semantics of Scheme, but rather
32 ordinary Scheme objects. You can store them into variables (that
33 are still lexically scoped, of course) or into any other place you
34 like. Every fluid has a initial value of `#f'.
35
36 Function: fluid? OBJ
37
38 Test whether OBJ is a fluid.
39
40 Function: fluid-ref FLUID
41 Function: fluid-set! FLUID VAL
42
43 Access/modify the fluid FLUID. Modifications are only visible
44 within the current dynamic root (that includes threads).
45
46 Function: with-fluids* FLUIDS VALUES THUNK
47
48 FLUIDS is a list of fluids and VALUES a corresponding list of
49 values for these fluids. Before THUNK gets called the values are
50 installed in the fluids and the old values of the fluids are
51 saved in the VALUES list. When the flow of control leaves THUNK
52 or reenters it, the values get swapped again. You might think of
53 this as a `safe-fluid-excursion'. Note that the VALUES list is
54 modified by `with-fluids*'.
55
56 Macro: with-fluids ((FLUID VALUE) ...) FORM ...
57
58 The same as `with-fluids*' but with a different syntax. It looks
59 just like `let', but both FLUID and VALUE are evaluated. Remember,
60 fluids are not special variables but ordinary objects. FLUID
61 should evaluate to a fluid.
62
63 ** Removed procedures:
64
65 list-length, list-append, list-append!, list-reverse, list-reverse!
66
67 ** array-map renamed to array-map!
68
69 ** serial-array-map renamed to serial-array-map!
70
71 * Changes to system call interfaces:
72
73 ** close-port, close-input-port and close-output-port now return a
74 boolean instead of an `unspecified' object. #t means that the port
75 was successfully closed, while #f means it was already closed. It is
76 also now possible for these procedures to raise an exception if an
77 error occurs (some errors from write can be delayed until close.)
78
79 ** the first argument to chmod, fcntl, ftell and fseek can now be a
80 file descriptor.
81
82 ** the third argument to fcntl is now optional.
83
84 ** the first argument to chown can now be a file descriptor or a port.
85
86 ** the argument to stat can now be a port.
87
88 ** The following new procedures have been added (most use scsh
89 interfaces):
90
91 ** close PORT/FD
92 Similar to close-port, but also works on file descriptors. A side
93 effect of closing a file descriptor is that any ports using that file
94 descriptor are moved to a different file descriptor and have
95 their revealed counts set to zero.
96
97 The next five procedures perform a dup2 system call, if NEWFD (an
98 integer) is supplied, otherwise a dup. The file descriptor to be
99 duplicated can be supplied as an integer or wrapped in a port. The
100 type of value returned varies depending on which procedure is used.
101
102 All procedures also have the side effect when performing dup2 that any
103 ports using NEWFD are moved to a different file descriptor and have
104 their revealed counts set to zero.
105
106 ** dup->fdes PORT/FD [NEWFD]
107 Returns an integer file descriptor.
108
109 ** dup->inport PORT/FD [NEWFD]
110 Returns a new input port using the new file descriptor.
111
112 ** dup->outport PORT/FD [NEWFD]
113 Returns a new output port using the new file descriptor.
114
115 ** dup PORT/FD [NEWFD]
116 Returns a new port if PORT/FD is a port, with the same mode as the
117 supplied port, otherwise returns an integer file descriptor.
118
119 ** dup->port PORT/FD MODE [NEWFD]
120 Returns a new port using the new file descriptor. MODE supplies a
121 mode string for the port (as for `open-file').
122
123 ** port->fdes PORT
124 Returns the integer file descriptor underlying PORT. As a
125 side effect the revealed count of PORT is incremented.
126
127 ** fdes->inport FDES
128 Returns an existing input port which has FDES as its underlying file
129 descriptor, if one exists, and increments its revealed count.
130 Otherwise, returns a new input port with a revealed count of 1.
131
132 ** fdes->outport FDES
133 Returns an existing output port which has FDES as its underlying file
134 descriptor, if one exists, and increments its revealed count.
135 Otherwise, returns a new output port with a revealed count of 1.
136
137 ** setenv NAME VALUE
138 If VALUE is `#f', removes NAME from the environment. Otherwise
139 adds the string NAME=VALUE to the environment, replacing any previous
140 value for NAME.
141
142 ** truncate-file OBJ SIZE
143 Truncates the file referred to by OBJ to at most SIZE bytes. OBJ
144 can be a string containing a file name or an integer file
145 descriptor or port open for output on the file. The underlying
146 system calls are `truncate' and `ftruncate'.
147
148 The return value is unspecified.
149
150 ** setvbuf PORT MODE [SIZE]
151 Set the buffering mode for PORT. MODE can be:
152 `_IONBF'
153 non-buffered
154
155 `_IOLBF'
156 line buffered
157
158 `_IOFBF'
159 block buffered, using a newly allocated buffer of SIZE bytes.
160 However if SIZE is zero or unspecified, the port will be made
161 non-buffered.
162
163 This procedure should not be used after I/O has been performed with
164 the port.
165
166 Ports are usually block buffered by default, with a default buffer
167 size. Procedures e.g., *Note open-file: File Ports, which accept a
168 mode string allow `0' to be added to request an unbuffered port.
169
170 ** fsync PORT/FD
171 Copies any unwritten data for the specified output file descriptor
172 to disk. If PORT/FD is a port, its buffer is flushed before the
173 underlying file descriptor is fsync'd. The return value is
174 unspecified.
175
176 ** open-fdes PATH FLAGS [MODES]
177 Similar to `open' but returns a file descriptor instead of a port.
178
179 ** procedure: execle PATH ENV [ARG] ...
180 Similar to `execl', but the environment of the new process is
181 specified by ENV, which must be a list of strings as returned by
182 the `environ' procedure.
183
184 This procedure is currently implemented using the `execve' system
185 call, but we call it `execle' because of its Scheme calling
186 interface.
187
188 ** procedure: primitive-exit [STATUS]
189 Terminate the current process without unwinding the Scheme stack.
190 This is would typically be useful after a fork. The exit status
191 is STATUS if supplied, otherwise zero.
192
193 ** procedure: times
194 Returns an object with information about real and processor time.
195 The following procedures accept such an object as an argument and
196 return a selected component:
197
198 `tms:clock'
199 The current real time, expressed as time units relative to an
200 arbitrary base.
201
202 `tms:utime'
203 The CPU time units used by the calling process.
204
205 `tms:stime'
206 The CPU time units used by the system on behalf of the
207 calling process.
208
209 `tms:cutime'
210 The CPU time units used by terminated child processes of the
211 calling process, whose status has been collected (e.g., using
212 `waitpid').
213
214 `tms:cstime'
215 Similarly, the CPU times units used by the system on behalf of
216 terminated child processes.
217
218 * Changes to the gh_ interface
219
220 ** Function: void gh_write (SCM x)
221
222 Write the printed representation of the scheme object x to the current
223 output port. Corresponds to the scheme level `write'.
224
225 ** gh_list_length renamed to gh_length.
226
227 * Changes to the scm_ interface
228
229 ** Function: SCM scm_internal_stack_catch (SCM tag,
230 scm_catch_body_t body,
231 void *body_data,
232 scm_catch_handler_t handler,
233 void *handler_data)
234
235 A new sibling to the other two C level `catch' functions
236 scm_internal_catch and scm_internal_lazy_catch. Use it if you want
237 the stack to be saved automatically into the variable `the-last-stack'
238 (scm_the_last_stack_var) on error. This is necessary if you want to
239 use advanced error reporting, such as calling scm_display_error and
240 scm_display_backtrace. (They both take a stack object as argument.)
241
242 ** The hook scm_error_callback has been removed. It was originally
243 intended as a way for the user to install his own error handler. But
244 that method works badly since it intervenes between throw and catch,
245 thereby changing the semantics of expressions like (catch #t ...).
246 The correct way to do it is to use one of the C level catch functions
247 in throw.c: scm_internal_catch/lazy_catch/stack_catch.
248
249 ** Removed functions:
250
251 scm_obj_length, scm_list_length, scm_list_append, scm_list_append_x,
252 scm_list_reverse, scm_list_reverse_x
253
254 ** New macros: SCM_LISTn where n is one of the integers 0-9.
255
256 These can be used for pretty list creation from C. The idea is taken
257 from Erick Gallesio's STk.
258
259 ** scm_array_map renamed to scm_array_map_x
260
261 \f
262 Changes in Guile 1.2 (released Tuesday, June 24 1997):
263
264 * Changes to the distribution
265
266 ** Nightly snapshots are now available from ftp.red-bean.com.
267 The old server, ftp.cyclic.com, has been relinquished to its rightful
268 owner.
269
270 Nightly snapshots of the Guile development sources are now available via
271 anonymous FTP from ftp.red-bean.com, as /pub/guile/guile-snap.tar.gz.
272
273 Via the web, that's: ftp://ftp.red-bean.com/pub/guile/guile-snap.tar.gz
274 For getit, that's: ftp.red-bean.com:/pub/guile/guile-snap.tar.gz
275
276 ** To run Guile without installing it, the procedure has changed a bit.
277
278 If you used a separate build directory to compile Guile, you'll need
279 to include the build directory in SCHEME_LOAD_PATH, as well as the
280 source directory. See the `INSTALL' file for examples.
281
282 * Changes to the procedure for linking libguile with your programs
283
284 ** The standard Guile load path for Scheme code now includes
285 $(datadir)/guile (usually /usr/local/share/guile). This means that
286 you can install your own Scheme files there, and Guile will find them.
287 (Previous versions of Guile only checked a directory whose name
288 contained the Guile version number, so you had to re-install or move
289 your Scheme sources each time you installed a fresh version of Guile.)
290
291 The load path also includes $(datadir)/guile/site; we recommend
292 putting individual Scheme files there. If you want to install a
293 package with multiple source files, create a directory for them under
294 $(datadir)/guile.
295
296 ** Guile 1.2 will now use the Rx regular expression library, if it is
297 installed on your system. When you are linking libguile into your own
298 programs, this means you will have to link against -lguile, -lqt (if
299 you configured Guile with thread support), and -lrx.
300
301 If you are using autoconf to generate configuration scripts for your
302 application, the following lines should suffice to add the appropriate
303 libraries to your link command:
304
305 ### Find Rx, quickthreads and libguile.
306 AC_CHECK_LIB(rx, main)
307 AC_CHECK_LIB(qt, main)
308 AC_CHECK_LIB(guile, scm_shell)
309
310 The Guile 1.2 distribution does not contain sources for the Rx
311 library, as Guile 1.0 did. If you want to use Rx, you'll need to
312 retrieve it from a GNU FTP site and install it separately.
313
314 * Changes to Scheme functions and syntax
315
316 ** The dynamic linking features of Guile are now enabled by default.
317 You can disable them by giving the `--disable-dynamic-linking' option
318 to configure.
319
320 (dynamic-link FILENAME)
321
322 Find the object file denoted by FILENAME (a string) and link it
323 into the running Guile application. When everything works out,
324 return a Scheme object suitable for representing the linked object
325 file. Otherwise an error is thrown. How object files are
326 searched is system dependent.
327
328 (dynamic-object? VAL)
329
330 Determine whether VAL represents a dynamically linked object file.
331
332 (dynamic-unlink DYNOBJ)
333
334 Unlink the indicated object file from the application. DYNOBJ
335 should be one of the values returned by `dynamic-link'.
336
337 (dynamic-func FUNCTION DYNOBJ)
338
339 Search the C function indicated by FUNCTION (a string or symbol)
340 in DYNOBJ and return some Scheme object that can later be used
341 with `dynamic-call' to actually call this function. Right now,
342 these Scheme objects are formed by casting the address of the
343 function to `long' and converting this number to its Scheme
344 representation.
345
346 (dynamic-call FUNCTION DYNOBJ)
347
348 Call the C function indicated by FUNCTION and DYNOBJ. The
349 function is passed no arguments and its return value is ignored.
350 When FUNCTION is something returned by `dynamic-func', call that
351 function and ignore DYNOBJ. When FUNCTION is a string (or symbol,
352 etc.), look it up in DYNOBJ; this is equivalent to
353
354 (dynamic-call (dynamic-func FUNCTION DYNOBJ) #f)
355
356 Interrupts are deferred while the C function is executing (with
357 SCM_DEFER_INTS/SCM_ALLOW_INTS).
358
359 (dynamic-args-call FUNCTION DYNOBJ ARGS)
360
361 Call the C function indicated by FUNCTION and DYNOBJ, but pass it
362 some arguments and return its return value. The C function is
363 expected to take two arguments and return an `int', just like
364 `main':
365
366 int c_func (int argc, char **argv);
367
368 ARGS must be a list of strings and is converted into an array of
369 `char *'. The array is passed in ARGV and its size in ARGC. The
370 return value is converted to a Scheme number and returned from the
371 call to `dynamic-args-call'.
372
373 When dynamic linking is disabled or not supported on your system,
374 the above functions throw errors, but they are still available.
375
376 Here is a small example that works on GNU/Linux:
377
378 (define libc-obj (dynamic-link "libc.so"))
379 (dynamic-args-call 'rand libc-obj '())
380
381 See the file `libguile/DYNAMIC-LINKING' for additional comments.
382
383 ** The #/ syntax for module names is depreciated, and will be removed
384 in a future version of Guile. Instead of
385
386 #/foo/bar/baz
387
388 instead write
389
390 (foo bar baz)
391
392 The latter syntax is more consistent with existing Lisp practice.
393
394 ** Guile now does fancier printing of structures. Structures are the
395 underlying implementation for records, which in turn are used to
396 implement modules, so all of these object now print differently and in
397 a more informative way.
398
399 The Scheme printer will examine the builtin variable *struct-printer*
400 whenever it needs to print a structure object. When this variable is
401 not `#f' it is deemed to be a procedure and will be applied to the
402 structure object and the output port. When *struct-printer* is `#f'
403 or the procedure return `#f' the structure object will be printed in
404 the boring #<struct 80458270> form.
405
406 This hook is used by some routines in ice-9/boot-9.scm to implement
407 type specific printing routines. Please read the comments there about
408 "printing structs".
409
410 One of the more specific uses of structs are records. The printing
411 procedure that could be passed to MAKE-RECORD-TYPE is now actually
412 called. It should behave like a *struct-printer* procedure (described
413 above).
414
415 ** Guile now supports a new R4RS-compliant syntax for keywords. A
416 token of the form #:NAME, where NAME has the same syntax as a Scheme
417 symbol, is the external representation of the keyword named NAME.
418 Keyword objects print using this syntax as well, so values containing
419 keyword objects can be read back into Guile. When used in an
420 expression, keywords are self-quoting objects.
421
422 Guile suports this read syntax, and uses this print syntax, regardless
423 of the current setting of the `keyword' read option. The `keyword'
424 read option only controls whether Guile recognizes the `:NAME' syntax,
425 which is incompatible with R4RS. (R4RS says such token represent
426 symbols.)
427
428 ** Guile has regular expression support again. Guile 1.0 included
429 functions for matching regular expressions, based on the Rx library.
430 In Guile 1.1, the Guile/Rx interface was removed to simplify the
431 distribution, and thus Guile had no regular expression support. Guile
432 1.2 again supports the most commonly used functions, and supports all
433 of SCSH's regular expression functions.
434
435 If your system does not include a POSIX regular expression library,
436 and you have not linked Guile with a third-party regexp library such as
437 Rx, these functions will not be available. You can tell whether your
438 Guile installation includes regular expression support by checking
439 whether the `*features*' list includes the `regex' symbol.
440
441 *** regexp functions
442
443 By default, Guile supports POSIX extended regular expressions. That
444 means that the characters `(', `)', `+' and `?' are special, and must
445 be escaped if you wish to match the literal characters.
446
447 This regular expression interface was modeled after that implemented
448 by SCSH, the Scheme Shell. It is intended to be upwardly compatible
449 with SCSH regular expressions.
450
451 **** Function: string-match PATTERN STR [START]
452 Compile the string PATTERN into a regular expression and compare
453 it with STR. The optional numeric argument START specifies the
454 position of STR at which to begin matching.
455
456 `string-match' returns a "match structure" which describes what,
457 if anything, was matched by the regular expression. *Note Match
458 Structures::. If STR does not match PATTERN at all,
459 `string-match' returns `#f'.
460
461 Each time `string-match' is called, it must compile its PATTERN
462 argument into a regular expression structure. This operation is
463 expensive, which makes `string-match' inefficient if the same regular
464 expression is used several times (for example, in a loop). For better
465 performance, you can compile a regular expression in advance and then
466 match strings against the compiled regexp.
467
468 **** Function: make-regexp STR [FLAGS]
469 Compile the regular expression described by STR, and return the
470 compiled regexp structure. If STR does not describe a legal
471 regular expression, `make-regexp' throws a
472 `regular-expression-syntax' error.
473
474 FLAGS may be the bitwise-or of one or more of the following:
475
476 **** Constant: regexp/extended
477 Use POSIX Extended Regular Expression syntax when interpreting
478 STR. If not set, POSIX Basic Regular Expression syntax is used.
479 If the FLAGS argument is omitted, we assume regexp/extended.
480
481 **** Constant: regexp/icase
482 Do not differentiate case. Subsequent searches using the
483 returned regular expression will be case insensitive.
484
485 **** Constant: regexp/newline
486 Match-any-character operators don't match a newline.
487
488 A non-matching list ([^...]) not containing a newline matches a
489 newline.
490
491 Match-beginning-of-line operator (^) matches the empty string
492 immediately after a newline, regardless of whether the FLAGS
493 passed to regexp-exec contain regexp/notbol.
494
495 Match-end-of-line operator ($) matches the empty string
496 immediately before a newline, regardless of whether the FLAGS
497 passed to regexp-exec contain regexp/noteol.
498
499 **** Function: regexp-exec REGEXP STR [START [FLAGS]]
500 Match the compiled regular expression REGEXP against `str'. If
501 the optional integer START argument is provided, begin matching
502 from that position in the string. Return a match structure
503 describing the results of the match, or `#f' if no match could be
504 found.
505
506 FLAGS may be the bitwise-or of one or more of the following:
507
508 **** Constant: regexp/notbol
509 The match-beginning-of-line operator always fails to match (but
510 see the compilation flag regexp/newline above) This flag may be
511 used when different portions of a string are passed to
512 regexp-exec and the beginning of the string should not be
513 interpreted as the beginning of the line.
514
515 **** Constant: regexp/noteol
516 The match-end-of-line operator always fails to match (but see the
517 compilation flag regexp/newline above)
518
519 **** Function: regexp? OBJ
520 Return `#t' if OBJ is a compiled regular expression, or `#f'
521 otherwise.
522
523 Regular expressions are commonly used to find patterns in one string
524 and replace them with the contents of another string.
525
526 **** Function: regexp-substitute PORT MATCH [ITEM...]
527 Write to the output port PORT selected contents of the match
528 structure MATCH. Each ITEM specifies what should be written, and
529 may be one of the following arguments:
530
531 * A string. String arguments are written out verbatim.
532
533 * An integer. The submatch with that number is written.
534
535 * The symbol `pre'. The portion of the matched string preceding
536 the regexp match is written.
537
538 * The symbol `post'. The portion of the matched string
539 following the regexp match is written.
540
541 PORT may be `#f', in which case nothing is written; instead,
542 `regexp-substitute' constructs a string from the specified ITEMs
543 and returns that.
544
545 **** Function: regexp-substitute/global PORT REGEXP TARGET [ITEM...]
546 Similar to `regexp-substitute', but can be used to perform global
547 substitutions on STR. Instead of taking a match structure as an
548 argument, `regexp-substitute/global' takes two string arguments: a
549 REGEXP string describing a regular expression, and a TARGET string
550 which should be matched against this regular expression.
551
552 Each ITEM behaves as in REGEXP-SUBSTITUTE, with the following
553 exceptions:
554
555 * A function may be supplied. When this function is called, it
556 will be passed one argument: a match structure for a given
557 regular expression match. It should return a string to be
558 written out to PORT.
559
560 * The `post' symbol causes `regexp-substitute/global' to recurse
561 on the unmatched portion of STR. This *must* be supplied in
562 order to perform global search-and-replace on STR; if it is
563 not present among the ITEMs, then `regexp-substitute/global'
564 will return after processing a single match.
565
566 *** Match Structures
567
568 A "match structure" is the object returned by `string-match' and
569 `regexp-exec'. It describes which portion of a string, if any, matched
570 the given regular expression. Match structures include: a reference to
571 the string that was checked for matches; the starting and ending
572 positions of the regexp match; and, if the regexp included any
573 parenthesized subexpressions, the starting and ending positions of each
574 submatch.
575
576 In each of the regexp match functions described below, the `match'
577 argument must be a match structure returned by a previous call to
578 `string-match' or `regexp-exec'. Most of these functions return some
579 information about the original target string that was matched against a
580 regular expression; we will call that string TARGET for easy reference.
581
582 **** Function: regexp-match? OBJ
583 Return `#t' if OBJ is a match structure returned by a previous
584 call to `regexp-exec', or `#f' otherwise.
585
586 **** Function: match:substring MATCH [N]
587 Return the portion of TARGET matched by subexpression number N.
588 Submatch 0 (the default) represents the entire regexp match. If
589 the regular expression as a whole matched, but the subexpression
590 number N did not match, return `#f'.
591
592 **** Function: match:start MATCH [N]
593 Return the starting position of submatch number N.
594
595 **** Function: match:end MATCH [N]
596 Return the ending position of submatch number N.
597
598 **** Function: match:prefix MATCH
599 Return the unmatched portion of TARGET preceding the regexp match.
600
601 **** Function: match:suffix MATCH
602 Return the unmatched portion of TARGET following the regexp match.
603
604 **** Function: match:count MATCH
605 Return the number of parenthesized subexpressions from MATCH.
606 Note that the entire regular expression match itself counts as a
607 subexpression, and failed submatches are included in the count.
608
609 **** Function: match:string MATCH
610 Return the original TARGET string.
611
612 *** Backslash Escapes
613
614 Sometimes you will want a regexp to match characters like `*' or `$'
615 exactly. For example, to check whether a particular string represents
616 a menu entry from an Info node, it would be useful to match it against
617 a regexp like `^* [^:]*::'. However, this won't work; because the
618 asterisk is a metacharacter, it won't match the `*' at the beginning of
619 the string. In this case, we want to make the first asterisk un-magic.
620
621 You can do this by preceding the metacharacter with a backslash
622 character `\'. (This is also called "quoting" the metacharacter, and
623 is known as a "backslash escape".) When Guile sees a backslash in a
624 regular expression, it considers the following glyph to be an ordinary
625 character, no matter what special meaning it would ordinarily have.
626 Therefore, we can make the above example work by changing the regexp to
627 `^\* [^:]*::'. The `\*' sequence tells the regular expression engine
628 to match only a single asterisk in the target string.
629
630 Since the backslash is itself a metacharacter, you may force a
631 regexp to match a backslash in the target string by preceding the
632 backslash with itself. For example, to find variable references in a
633 TeX program, you might want to find occurrences of the string `\let\'
634 followed by any number of alphabetic characters. The regular expression
635 `\\let\\[A-Za-z]*' would do this: the double backslashes in the regexp
636 each match a single backslash in the target string.
637
638 **** Function: regexp-quote STR
639 Quote each special character found in STR with a backslash, and
640 return the resulting string.
641
642 *Very important:* Using backslash escapes in Guile source code (as
643 in Emacs Lisp or C) can be tricky, because the backslash character has
644 special meaning for the Guile reader. For example, if Guile encounters
645 the character sequence `\n' in the middle of a string while processing
646 Scheme code, it replaces those characters with a newline character.
647 Similarly, the character sequence `\t' is replaced by a horizontal tab.
648 Several of these "escape sequences" are processed by the Guile reader
649 before your code is executed. Unrecognized escape sequences are
650 ignored: if the characters `\*' appear in a string, they will be
651 translated to the single character `*'.
652
653 This translation is obviously undesirable for regular expressions,
654 since we want to be able to include backslashes in a string in order to
655 escape regexp metacharacters. Therefore, to make sure that a backslash
656 is preserved in a string in your Guile program, you must use *two*
657 consecutive backslashes:
658
659 (define Info-menu-entry-pattern (make-regexp "^\\* [^:]*"))
660
661 The string in this example is preprocessed by the Guile reader before
662 any code is executed. The resulting argument to `make-regexp' is the
663 string `^\* [^:]*', which is what we really want.
664
665 This also means that in order to write a regular expression that
666 matches a single backslash character, the regular expression string in
667 the source code must include *four* backslashes. Each consecutive pair
668 of backslashes gets translated by the Guile reader to a single
669 backslash, and the resulting double-backslash is interpreted by the
670 regexp engine as matching a single backslash character. Hence:
671
672 (define tex-variable-pattern (make-regexp "\\\\let\\\\=[A-Za-z]*"))
673
674 The reason for the unwieldiness of this syntax is historical. Both
675 regular expression pattern matchers and Unix string processing systems
676 have traditionally used backslashes with the special meanings described
677 above. The POSIX regular expression specification and ANSI C standard
678 both require these semantics. Attempting to abandon either convention
679 would cause other kinds of compatibility problems, possibly more severe
680 ones. Therefore, without extending the Scheme reader to support
681 strings with different quoting conventions (an ungainly and confusing
682 extension when implemented in other languages), we must adhere to this
683 cumbersome escape syntax.
684
685 * Changes to the gh_ interface
686
687 * Changes to the scm_ interface
688
689 * Changes to system call interfaces:
690
691 ** The value returned by `raise' is now unspecified. It throws an exception
692 if an error occurs.
693
694 *** A new procedure `sigaction' can be used to install signal handlers
695
696 (sigaction signum [action] [flags])
697
698 signum is the signal number, which can be specified using the value
699 of SIGINT etc.
700
701 If action is omitted, sigaction returns a pair: the CAR is the current
702 signal hander, which will be either an integer with the value SIG_DFL
703 (default action) or SIG_IGN (ignore), or the Scheme procedure which
704 handles the signal, or #f if a non-Scheme procedure handles the
705 signal. The CDR contains the current sigaction flags for the handler.
706
707 If action is provided, it is installed as the new handler for signum.
708 action can be a Scheme procedure taking one argument, or the value of
709 SIG_DFL (default action) or SIG_IGN (ignore), or #f to restore
710 whatever signal handler was installed before sigaction was first used.
711 Flags can optionally be specified for the new handler (SA_RESTART is
712 always used if the system provides it, so need not be specified.) The
713 return value is a pair with information about the old handler as
714 described above.
715
716 This interface does not provide access to the "signal blocking"
717 facility. Maybe this is not needed, since the thread support may
718 provide solutions to the problem of consistent access to data
719 structures.
720
721 *** A new procedure `flush-all-ports' is equivalent to running
722 `force-output' on every port open for output.
723
724 ** Guile now provides information on how it was built, via the new
725 global variable, %guile-build-info. This variable records the values
726 of the standard GNU makefile directory variables as an assocation
727 list, mapping variable names (symbols) onto directory paths (strings).
728 For example, to find out where the Guile link libraries were
729 installed, you can say:
730
731 guile -c "(display (assq-ref %guile-build-info 'libdir)) (newline)"
732
733
734 * Changes to the scm_ interface
735
736 ** The new function scm_handle_by_message_noexit is just like the
737 existing scm_handle_by_message function, except that it doesn't call
738 exit to terminate the process. Instead, it prints a message and just
739 returns #f. This might be a more appropriate catch-all handler for
740 new dynamic roots and threads.
741
742 \f
743 Changes in Guile 1.1 (released Friday, May 16 1997):
744
745 * Changes to the distribution.
746
747 The Guile 1.0 distribution has been split up into several smaller
748 pieces:
749 guile-core --- the Guile interpreter itself.
750 guile-tcltk --- the interface between the Guile interpreter and
751 Tcl/Tk; Tcl is an interpreter for a stringy language, and Tk
752 is a toolkit for building graphical user interfaces.
753 guile-rgx-ctax --- the interface between Guile and the Rx regular
754 expression matcher, and the translator for the Ctax
755 programming language. These are packaged together because the
756 Ctax translator uses Rx to parse Ctax source code.
757
758 This NEWS file describes the changes made to guile-core since the 1.0
759 release.
760
761 We no longer distribute the documentation, since it was either out of
762 date, or incomplete. As soon as we have current documentation, we
763 will distribute it.
764
765
766
767 * Changes to the stand-alone interpreter
768
769 ** guile now accepts command-line arguments compatible with SCSH, Olin
770 Shivers' Scheme Shell.
771
772 In general, arguments are evaluated from left to right, but there are
773 exceptions. The following switches stop argument processing, and
774 stash all remaining command-line arguments as the value returned by
775 the (command-line) function.
776 -s SCRIPT load Scheme source code from FILE, and exit
777 -c EXPR evalute Scheme expression EXPR, and exit
778 -- stop scanning arguments; run interactively
779
780 The switches below are processed as they are encountered.
781 -l FILE load Scheme source code from FILE
782 -e FUNCTION after reading script, apply FUNCTION to
783 command line arguments
784 -ds do -s script at this point
785 --emacs enable Emacs protocol (experimental)
786 -h, --help display this help and exit
787 -v, --version display version information and exit
788 \ read arguments from following script lines
789
790 So, for example, here is a Guile script named `ekko' (thanks, Olin)
791 which re-implements the traditional "echo" command:
792
793 #!/usr/local/bin/guile -s
794 !#
795 (define (main args)
796 (map (lambda (arg) (display arg) (display " "))
797 (cdr args))
798 (newline))
799
800 (main (command-line))
801
802 Suppose we invoke this script as follows:
803
804 ekko a speckled gecko
805
806 Through the magic of Unix script processing (triggered by the `#!'
807 token at the top of the file), /usr/local/bin/guile receives the
808 following list of command-line arguments:
809
810 ("-s" "./ekko" "a" "speckled" "gecko")
811
812 Unix inserts the name of the script after the argument specified on
813 the first line of the file (in this case, "-s"), and then follows that
814 with the arguments given to the script. Guile loads the script, which
815 defines the `main' function, and then applies it to the list of
816 remaining command-line arguments, ("a" "speckled" "gecko").
817
818 In Unix, the first line of a script file must take the following form:
819
820 #!INTERPRETER ARGUMENT
821
822 where INTERPRETER is the absolute filename of the interpreter
823 executable, and ARGUMENT is a single command-line argument to pass to
824 the interpreter.
825
826 You may only pass one argument to the interpreter, and its length is
827 limited. These restrictions can be annoying to work around, so Guile
828 provides a general mechanism (borrowed from, and compatible with,
829 SCSH) for circumventing them.
830
831 If the ARGUMENT in a Guile script is a single backslash character,
832 `\', Guile will open the script file, parse arguments from its second
833 and subsequent lines, and replace the `\' with them. So, for example,
834 here is another implementation of the `ekko' script:
835
836 #!/usr/local/bin/guile \
837 -e main -s
838 !#
839 (define (main args)
840 (for-each (lambda (arg) (display arg) (display " "))
841 (cdr args))
842 (newline))
843
844 If the user invokes this script as follows:
845
846 ekko a speckled gecko
847
848 Unix expands this into
849
850 /usr/local/bin/guile \ ekko a speckled gecko
851
852 When Guile sees the `\' argument, it replaces it with the arguments
853 read from the second line of the script, producing:
854
855 /usr/local/bin/guile -e main -s ekko a speckled gecko
856
857 This tells Guile to load the `ekko' script, and apply the function
858 `main' to the argument list ("a" "speckled" "gecko").
859
860 Here is how Guile parses the command-line arguments:
861 - Each space character terminates an argument. This means that two
862 spaces in a row introduce an empty-string argument.
863 - The tab character is not permitted (unless you quote it with the
864 backslash character, as described below), to avoid confusion.
865 - The newline character terminates the sequence of arguments, and will
866 also terminate a final non-empty argument. (However, a newline
867 following a space will not introduce a final empty-string argument;
868 it only terminates the argument list.)
869 - The backslash character is the escape character. It escapes
870 backslash, space, tab, and newline. The ANSI C escape sequences
871 like \n and \t are also supported. These produce argument
872 constituents; the two-character combination \n doesn't act like a
873 terminating newline. The escape sequence \NNN for exactly three
874 octal digits reads as the character whose ASCII code is NNN. As
875 above, characters produced this way are argument constituents.
876 Backslash followed by other characters is not allowed.
877
878 * Changes to the procedure for linking libguile with your programs
879
880 ** Guile now builds and installs a shared guile library, if your
881 system support shared libraries. (It still builds a static library on
882 all systems.) Guile automatically detects whether your system
883 supports shared libraries. To prevent Guile from buildisg shared
884 libraries, pass the `--disable-shared' flag to the configure script.
885
886 Guile takes longer to compile when it builds shared libraries, because
887 it must compile every file twice --- once to produce position-
888 independent object code, and once to produce normal object code.
889
890 ** The libthreads library has been merged into libguile.
891
892 To link a program against Guile, you now need only link against
893 -lguile and -lqt; -lthreads is no longer needed. If you are using
894 autoconf to generate configuration scripts for your application, the
895 following lines should suffice to add the appropriate libraries to
896 your link command:
897
898 ### Find quickthreads and libguile.
899 AC_CHECK_LIB(qt, main)
900 AC_CHECK_LIB(guile, scm_shell)
901
902 * Changes to Scheme functions
903
904 ** Guile Scheme's special syntax for keyword objects is now optional,
905 and disabled by default.
906
907 The syntax variation from R4RS made it difficult to port some
908 interesting packages to Guile. The routines which accepted keyword
909 arguments (mostly in the module system) have been modified to also
910 accept symbols whose names begin with `:'.
911
912 To change the keyword syntax, you must first import the (ice-9 debug)
913 module:
914 (use-modules (ice-9 debug))
915
916 Then you can enable the keyword syntax as follows:
917 (read-set! keywords 'prefix)
918
919 To disable keyword syntax, do this:
920 (read-set! keywords #f)
921
922 ** Many more primitive functions accept shared substrings as
923 arguments. In the past, these functions required normal, mutable
924 strings as arguments, although they never made use of this
925 restriction.
926
927 ** The uniform array functions now operate on byte vectors. These
928 functions are `array-fill!', `serial-array-copy!', `array-copy!',
929 `serial-array-map', `array-map', `array-for-each', and
930 `array-index-map!'.
931
932 ** The new functions `trace' and `untrace' implement simple debugging
933 support for Scheme functions.
934
935 The `trace' function accepts any number of procedures as arguments,
936 and tells the Guile interpreter to display each procedure's name and
937 arguments each time the procedure is invoked. When invoked with no
938 arguments, `trace' returns the list of procedures currently being
939 traced.
940
941 The `untrace' function accepts any number of procedures as arguments,
942 and tells the Guile interpreter not to trace them any more. When
943 invoked with no arguments, `untrace' untraces all curretly traced
944 procedures.
945
946 The tracing in Guile has an advantage over most other systems: we
947 don't create new procedure objects, but mark the procedure objects
948 themselves. This means that anonymous and internal procedures can be
949 traced.
950
951 ** The function `assert-repl-prompt' has been renamed to
952 `set-repl-prompt!'. It takes one argument, PROMPT.
953 - If PROMPT is #f, the Guile read-eval-print loop will not prompt.
954 - If PROMPT is a string, we use it as a prompt.
955 - If PROMPT is a procedure accepting no arguments, we call it, and
956 display the result as a prompt.
957 - Otherwise, we display "> ".
958
959 ** The new function `eval-string' reads Scheme expressions from a
960 string and evaluates them, returning the value of the last expression
961 in the string. If the string contains no expressions, it returns an
962 unspecified value.
963
964 ** The new function `thunk?' returns true iff its argument is a
965 procedure of zero arguments.
966
967 ** `defined?' is now a builtin function, instead of syntax. This
968 means that its argument should be quoted. It returns #t iff its
969 argument is bound in the current module.
970
971 ** The new syntax `use-modules' allows you to add new modules to your
972 environment without re-typing a complete `define-module' form. It
973 accepts any number of module names as arguments, and imports their
974 public bindings into the current module.
975
976 ** The new function (module-defined? NAME MODULE) returns true iff
977 NAME, a symbol, is defined in MODULE, a module object.
978
979 ** The new function `builtin-bindings' creates and returns a hash
980 table containing copies of all the root module's bindings.
981
982 ** The new function `builtin-weak-bindings' does the same as
983 `builtin-bindings', but creates a doubly-weak hash table.
984
985 ** The `equal?' function now considers variable objects to be
986 equivalent if they have the same name and the same value.
987
988 ** The new function `command-line' returns the command-line arguments
989 given to Guile, as a list of strings.
990
991 When using guile as a script interpreter, `command-line' returns the
992 script's arguments; those processed by the interpreter (like `-s' or
993 `-c') are omitted. (In other words, you get the normal, expected
994 behavior.) Any application that uses scm_shell to process its
995 command-line arguments gets this behavior as well.
996
997 ** The new function `load-user-init' looks for a file called `.guile'
998 in the user's home directory, and loads it if it exists. This is
999 mostly for use by the code generated by scm_compile_shell_switches,
1000 but we thought it might also be useful in other circumstances.
1001
1002 ** The new function `log10' returns the base-10 logarithm of its
1003 argument.
1004
1005 ** Changes to I/O functions
1006
1007 *** The functions `read', `primitive-load', `read-and-eval!', and
1008 `primitive-load-path' no longer take optional arguments controlling
1009 case insensitivity and a `#' parser.
1010
1011 Case sensitivity is now controlled by a read option called
1012 `case-insensitive'. The user can add new `#' syntaxes with the
1013 `read-hash-extend' function (see below).
1014
1015 *** The new function `read-hash-extend' allows the user to change the
1016 syntax of Guile Scheme in a somewhat controlled way.
1017
1018 (read-hash-extend CHAR PROC)
1019 When parsing S-expressions, if we read a `#' character followed by
1020 the character CHAR, use PROC to parse an object from the stream.
1021 If PROC is #f, remove any parsing procedure registered for CHAR.
1022
1023 The reader applies PROC to two arguments: CHAR and an input port.
1024
1025 *** The new functions read-delimited and read-delimited! provide a
1026 general mechanism for doing delimited input on streams.
1027
1028 (read-delimited DELIMS [PORT HANDLE-DELIM])
1029 Read until we encounter one of the characters in DELIMS (a string),
1030 or end-of-file. PORT is the input port to read from; it defaults to
1031 the current input port. The HANDLE-DELIM parameter determines how
1032 the terminating character is handled; it should be one of the
1033 following symbols:
1034
1035 'trim omit delimiter from result
1036 'peek leave delimiter character in input stream
1037 'concat append delimiter character to returned value
1038 'split return a pair: (RESULT . TERMINATOR)
1039
1040 HANDLE-DELIM defaults to 'peek.
1041
1042 (read-delimited! DELIMS BUF [PORT HANDLE-DELIM START END])
1043 A side-effecting variant of `read-delimited'.
1044
1045 The data is written into the string BUF at the indices in the
1046 half-open interval [START, END); the default interval is the whole
1047 string: START = 0 and END = (string-length BUF). The values of
1048 START and END must specify a well-defined interval in BUF, i.e.
1049 0 <= START <= END <= (string-length BUF).
1050
1051 It returns NBYTES, the number of bytes read. If the buffer filled
1052 up without a delimiter character being found, it returns #f. If the
1053 port is at EOF when the read starts, it returns the EOF object.
1054
1055 If an integer is returned (i.e., the read is successfully terminated
1056 by reading a delimiter character), then the HANDLE-DELIM parameter
1057 determines how to handle the terminating character. It is described
1058 above, and defaults to 'peek.
1059
1060 (The descriptions of these functions were borrowed from the SCSH
1061 manual, by Olin Shivers and Brian Carlstrom.)
1062
1063 *** The `%read-delimited!' function is the primitive used to implement
1064 `read-delimited' and `read-delimited!'.
1065
1066 (%read-delimited! DELIMS BUF GOBBLE? [PORT START END])
1067
1068 This returns a pair of values: (TERMINATOR . NUM-READ).
1069 - TERMINATOR describes why the read was terminated. If it is a
1070 character or the eof object, then that is the value that terminated
1071 the read. If it is #f, the function filled the buffer without finding
1072 a delimiting character.
1073 - NUM-READ is the number of characters read into BUF.
1074
1075 If the read is successfully terminated by reading a delimiter
1076 character, then the gobble? parameter determines what to do with the
1077 terminating character. If true, the character is removed from the
1078 input stream; if false, the character is left in the input stream
1079 where a subsequent read operation will retrieve it. In either case,
1080 the character is also the first value returned by the procedure call.
1081
1082 (The descriptions of this function was borrowed from the SCSH manual,
1083 by Olin Shivers and Brian Carlstrom.)
1084
1085 *** The `read-line' and `read-line!' functions have changed; they now
1086 trim the terminator by default; previously they appended it to the
1087 returned string. For the old behavior, use (read-line PORT 'concat).
1088
1089 *** The functions `uniform-array-read!' and `uniform-array-write!' now
1090 take new optional START and END arguments, specifying the region of
1091 the array to read and write.
1092
1093 *** The `ungetc-char-ready?' function has been removed. We feel it's
1094 inappropriate for an interface to expose implementation details this
1095 way.
1096
1097 ** Changes to the Unix library and system call interface
1098
1099 *** The new fcntl function provides access to the Unix `fcntl' system
1100 call.
1101
1102 (fcntl PORT COMMAND VALUE)
1103 Apply COMMAND to PORT's file descriptor, with VALUE as an argument.
1104 Values for COMMAND are:
1105
1106 F_DUPFD duplicate a file descriptor
1107 F_GETFD read the descriptor's close-on-exec flag
1108 F_SETFD set the descriptor's close-on-exec flag to VALUE
1109 F_GETFL read the descriptor's flags, as set on open
1110 F_SETFL set the descriptor's flags, as set on open to VALUE
1111 F_GETOWN return the process ID of a socket's owner, for SIGIO
1112 F_SETOWN set the process that owns a socket to VALUE, for SIGIO
1113 FD_CLOEXEC not sure what this is
1114
1115 For details, see the documentation for the fcntl system call.
1116
1117 *** The arguments to `select' have changed, for compatibility with
1118 SCSH. The TIMEOUT parameter may now be non-integral, yielding the
1119 expected behavior. The MILLISECONDS parameter has been changed to
1120 MICROSECONDS, to more closely resemble the underlying system call.
1121 The RVEC, WVEC, and EVEC arguments can now be vectors; the type of the
1122 corresponding return set will be the same.
1123
1124 *** The arguments to the `mknod' system call have changed. They are
1125 now:
1126
1127 (mknod PATH TYPE PERMS DEV)
1128 Create a new file (`node') in the file system. PATH is the name of
1129 the file to create. TYPE is the kind of file to create; it should
1130 be 'fifo, 'block-special, or 'char-special. PERMS specifies the
1131 permission bits to give the newly created file. If TYPE is
1132 'block-special or 'char-special, DEV specifies which device the
1133 special file refers to; its interpretation depends on the kind of
1134 special file being created.
1135
1136 *** The `fork' function has been renamed to `primitive-fork', to avoid
1137 clashing with various SCSH forks.
1138
1139 *** The `recv' and `recvfrom' functions have been renamed to `recv!'
1140 and `recvfrom!'. They no longer accept a size for a second argument;
1141 you must pass a string to hold the received value. They no longer
1142 return the buffer. Instead, `recv' returns the length of the message
1143 received, and `recvfrom' returns a pair containing the packet's length
1144 and originating address.
1145
1146 *** The file descriptor datatype has been removed, as have the
1147 `read-fd', `write-fd', `close', `lseek', and `dup' functions.
1148 We plan to replace these functions with a SCSH-compatible interface.
1149
1150 *** The `create' function has been removed; it's just a special case
1151 of `open'.
1152
1153 *** There are new functions to break down process termination status
1154 values. In the descriptions below, STATUS is a value returned by
1155 `waitpid'.
1156
1157 (status:exit-val STATUS)
1158 If the child process exited normally, this function returns the exit
1159 code for the child process (i.e., the value passed to exit, or
1160 returned from main). If the child process did not exit normally,
1161 this function returns #f.
1162
1163 (status:stop-sig STATUS)
1164 If the child process was suspended by a signal, this function
1165 returns the signal that suspended the child. Otherwise, it returns
1166 #f.
1167
1168 (status:term-sig STATUS)
1169 If the child process terminated abnormally, this function returns
1170 the signal that terminated the child. Otherwise, this function
1171 returns false.
1172
1173 POSIX promises that exactly one of these functions will return true on
1174 a valid STATUS value.
1175
1176 These functions are compatible with SCSH.
1177
1178 *** There are new accessors and setters for the broken-out time vectors
1179 returned by `localtime', `gmtime', and that ilk. They are:
1180
1181 Component Accessor Setter
1182 ========================= ============ ============
1183 seconds tm:sec set-tm:sec
1184 minutes tm:min set-tm:min
1185 hours tm:hour set-tm:hour
1186 day of the month tm:mday set-tm:mday
1187 month tm:mon set-tm:mon
1188 year tm:year set-tm:year
1189 day of the week tm:wday set-tm:wday
1190 day in the year tm:yday set-tm:yday
1191 daylight saving time tm:isdst set-tm:isdst
1192 GMT offset, seconds tm:gmtoff set-tm:gmtoff
1193 name of time zone tm:zone set-tm:zone
1194
1195 *** There are new accessors for the vectors returned by `uname',
1196 describing the host system:
1197
1198 Component Accessor
1199 ============================================== ================
1200 name of the operating system implementation utsname:sysname
1201 network name of this machine utsname:nodename
1202 release level of the operating system utsname:release
1203 version level of the operating system utsname:version
1204 machine hardware platform utsname:machine
1205
1206 *** There are new accessors for the vectors returned by `getpw',
1207 `getpwnam', `getpwuid', and `getpwent', describing entries from the
1208 system's user database:
1209
1210 Component Accessor
1211 ====================== =================
1212 user name passwd:name
1213 user password passwd:passwd
1214 user id passwd:uid
1215 group id passwd:gid
1216 real name passwd:gecos
1217 home directory passwd:dir
1218 shell program passwd:shell
1219
1220 *** There are new accessors for the vectors returned by `getgr',
1221 `getgrnam', `getgrgid', and `getgrent', describing entries from the
1222 system's group database:
1223
1224 Component Accessor
1225 ======================= ============
1226 group name group:name
1227 group password group:passwd
1228 group id group:gid
1229 group members group:mem
1230
1231 *** There are new accessors for the vectors returned by `gethost',
1232 `gethostbyaddr', `gethostbyname', and `gethostent', describing
1233 internet hosts:
1234
1235 Component Accessor
1236 ========================= ===============
1237 official name of host hostent:name
1238 alias list hostent:aliases
1239 host address type hostent:addrtype
1240 length of address hostent:length
1241 list of addresses hostent:addr-list
1242
1243 *** There are new accessors for the vectors returned by `getnet',
1244 `getnetbyaddr', `getnetbyname', and `getnetent', describing internet
1245 networks:
1246
1247 Component Accessor
1248 ========================= ===============
1249 official name of net netent:name
1250 alias list netent:aliases
1251 net number type netent:addrtype
1252 net number netent:net
1253
1254 *** There are new accessors for the vectors returned by `getproto',
1255 `getprotobyname', `getprotobynumber', and `getprotoent', describing
1256 internet protocols:
1257
1258 Component Accessor
1259 ========================= ===============
1260 official protocol name protoent:name
1261 alias list protoent:aliases
1262 protocol number protoent:proto
1263
1264 *** There are new accessors for the vectors returned by `getserv',
1265 `getservbyname', `getservbyport', and `getservent', describing
1266 internet protocols:
1267
1268 Component Accessor
1269 ========================= ===============
1270 official service name servent:name
1271 alias list servent:aliases
1272 port number servent:port
1273 protocol to use servent:proto
1274
1275 *** There are new accessors for the sockaddr structures returned by
1276 `accept', `getsockname', `getpeername', `recvfrom!':
1277
1278 Component Accessor
1279 ======================================== ===============
1280 address format (`family') sockaddr:fam
1281 path, for file domain addresses sockaddr:path
1282 address, for internet domain addresses sockaddr:addr
1283 TCP or UDP port, for internet sockaddr:port
1284
1285 *** The `getpwent', `getgrent', `gethostent', `getnetent',
1286 `getprotoent', and `getservent' functions now return #f at the end of
1287 the user database. (They used to throw an exception.)
1288
1289 Note that calling MUMBLEent function is equivalent to calling the
1290 corresponding MUMBLE function with no arguments.
1291
1292 *** The `setpwent', `setgrent', `sethostent', `setnetent',
1293 `setprotoent', and `setservent' routines now take no arguments.
1294
1295 *** The `gethost', `getproto', `getnet', and `getserv' functions now
1296 provide more useful information when they throw an exception.
1297
1298 *** The `lnaof' function has been renamed to `inet-lnaof'.
1299
1300 *** Guile now claims to have the `current-time' feature.
1301
1302 *** The `mktime' function now takes an optional second argument ZONE,
1303 giving the time zone to use for the conversion. ZONE should be a
1304 string, in the same format as expected for the "TZ" environment variable.
1305
1306 *** The `strptime' function now returns a pair (TIME . COUNT), where
1307 TIME is the parsed time as a vector, and COUNT is the number of
1308 characters from the string left unparsed. This function used to
1309 return the remaining characters as a string.
1310
1311 *** The `gettimeofday' function has replaced the old `time+ticks' function.
1312 The return value is now (SECONDS . MICROSECONDS); the fractional
1313 component is no longer expressed in "ticks".
1314
1315 *** The `ticks/sec' constant has been removed, in light of the above change.
1316
1317 * Changes to the gh_ interface
1318
1319 ** gh_eval_str() now returns an SCM object which is the result of the
1320 evaluation
1321
1322 ** gh_scm2str() now copies the Scheme data to a caller-provided C
1323 array
1324
1325 ** gh_scm2newstr() now makes a C array, copies the Scheme data to it,
1326 and returns the array
1327
1328 ** gh_scm2str0() is gone: there is no need to distinguish
1329 null-terminated from non-null-terminated, since gh_scm2newstr() allows
1330 the user to interpret the data both ways.
1331
1332 * Changes to the scm_ interface
1333
1334 ** The new function scm_symbol_value0 provides an easy way to get a
1335 symbol's value from C code:
1336
1337 SCM scm_symbol_value0 (char *NAME)
1338 Return the value of the symbol named by the null-terminated string
1339 NAME in the current module. If the symbol named NAME is unbound in
1340 the current module, return SCM_UNDEFINED.
1341
1342 ** The new function scm_sysintern0 creates new top-level variables,
1343 without assigning them a value.
1344
1345 SCM scm_sysintern0 (char *NAME)
1346 Create a new Scheme top-level variable named NAME. NAME is a
1347 null-terminated string. Return the variable's value cell.
1348
1349 ** The function scm_internal_catch is the guts of catch. It handles
1350 all the mechanics of setting up a catch target, invoking the catch
1351 body, and perhaps invoking the handler if the body does a throw.
1352
1353 The function is designed to be usable from C code, but is general
1354 enough to implement all the semantics Guile Scheme expects from throw.
1355
1356 TAG is the catch tag. Typically, this is a symbol, but this function
1357 doesn't actually care about that.
1358
1359 BODY is a pointer to a C function which runs the body of the catch;
1360 this is the code you can throw from. We call it like this:
1361 BODY (BODY_DATA, JMPBUF)
1362 where:
1363 BODY_DATA is just the BODY_DATA argument we received; we pass it
1364 through to BODY as its first argument. The caller can make
1365 BODY_DATA point to anything useful that BODY might need.
1366 JMPBUF is the Scheme jmpbuf object corresponding to this catch,
1367 which we have just created and initialized.
1368
1369 HANDLER is a pointer to a C function to deal with a throw to TAG,
1370 should one occur. We call it like this:
1371 HANDLER (HANDLER_DATA, THROWN_TAG, THROW_ARGS)
1372 where
1373 HANDLER_DATA is the HANDLER_DATA argument we recevied; it's the
1374 same idea as BODY_DATA above.
1375 THROWN_TAG is the tag that the user threw to; usually this is
1376 TAG, but it could be something else if TAG was #t (i.e., a
1377 catch-all), or the user threw to a jmpbuf.
1378 THROW_ARGS is the list of arguments the user passed to the THROW
1379 function.
1380
1381 BODY_DATA is just a pointer we pass through to BODY. HANDLER_DATA
1382 is just a pointer we pass through to HANDLER. We don't actually
1383 use either of those pointers otherwise ourselves. The idea is
1384 that, if our caller wants to communicate something to BODY or
1385 HANDLER, it can pass a pointer to it as MUMBLE_DATA, which BODY and
1386 HANDLER can then use. Think of it as a way to make BODY and
1387 HANDLER closures, not just functions; MUMBLE_DATA points to the
1388 enclosed variables.
1389
1390 Of course, it's up to the caller to make sure that any data a
1391 MUMBLE_DATA needs is protected from GC. A common way to do this is
1392 to make MUMBLE_DATA a pointer to data stored in an automatic
1393 structure variable; since the collector must scan the stack for
1394 references anyway, this assures that any references in MUMBLE_DATA
1395 will be found.
1396
1397 ** The new function scm_internal_lazy_catch is exactly like
1398 scm_internal_catch, except:
1399
1400 - It does not unwind the stack (this is the major difference).
1401 - If handler returns, its value is returned from the throw.
1402 - BODY always receives #f as its JMPBUF argument (since there's no
1403 jmpbuf associated with a lazy catch, because we don't unwind the
1404 stack.)
1405
1406 ** scm_body_thunk is a new body function you can pass to
1407 scm_internal_catch if you want the body to be like Scheme's `catch'
1408 --- a thunk, or a function of one argument if the tag is #f.
1409
1410 BODY_DATA is a pointer to a scm_body_thunk_data structure, which
1411 contains the Scheme procedure to invoke as the body, and the tag
1412 we're catching. If the tag is #f, then we pass JMPBUF (created by
1413 scm_internal_catch) to the body procedure; otherwise, the body gets
1414 no arguments.
1415
1416 ** scm_handle_by_proc is a new handler function you can pass to
1417 scm_internal_catch if you want the handler to act like Scheme's catch
1418 --- call a procedure with the tag and the throw arguments.
1419
1420 If the user does a throw to this catch, this function runs a handler
1421 procedure written in Scheme. HANDLER_DATA is a pointer to an SCM
1422 variable holding the Scheme procedure object to invoke. It ought to
1423 be a pointer to an automatic variable (i.e., one living on the stack),
1424 or the procedure object should be otherwise protected from GC.
1425
1426 ** scm_handle_by_message is a new handler function to use with
1427 `scm_internal_catch' if you want Guile to print a message and die.
1428 It's useful for dealing with throws to uncaught keys at the top level.
1429
1430 HANDLER_DATA, if non-zero, is assumed to be a char * pointing to a
1431 message header to print; if zero, we use "guile" instead. That
1432 text is followed by a colon, then the message described by ARGS.
1433
1434 ** The return type of scm_boot_guile is now void; the function does
1435 not return a value, and indeed, never returns at all.
1436
1437 ** The new function scm_shell makes it easy for user applications to
1438 process command-line arguments in a way that is compatible with the
1439 stand-alone guile interpreter (which is in turn compatible with SCSH,
1440 the Scheme shell).
1441
1442 To use the scm_shell function, first initialize any guile modules
1443 linked into your application, and then call scm_shell with the values
1444 of ARGC and ARGV your `main' function received. scm_shell will adding
1445 any SCSH-style meta-arguments from the top of the script file to the
1446 argument vector, and then process the command-line arguments. This
1447 generally means loading a script file or starting up an interactive
1448 command interpreter. For details, see "Changes to the stand-alone
1449 interpreter" above.
1450
1451 ** The new functions scm_get_meta_args and scm_count_argv help you
1452 implement the SCSH-style meta-argument, `\'.
1453
1454 char **scm_get_meta_args (int ARGC, char **ARGV)
1455 If the second element of ARGV is a string consisting of a single
1456 backslash character (i.e. "\\" in Scheme notation), open the file
1457 named by the following argument, parse arguments from it, and return
1458 the spliced command line. The returned array is terminated by a
1459 null pointer.
1460
1461 For details of argument parsing, see above, under "guile now accepts
1462 command-line arguments compatible with SCSH..."
1463
1464 int scm_count_argv (char **ARGV)
1465 Count the arguments in ARGV, assuming it is terminated by a null
1466 pointer.
1467
1468 For an example of how these functions might be used, see the source
1469 code for the function scm_shell in libguile/script.c.
1470
1471 You will usually want to use scm_shell instead of calling this
1472 function yourself.
1473
1474 ** The new function scm_compile_shell_switches turns an array of
1475 command-line arguments into Scheme code to carry out the actions they
1476 describe. Given ARGC and ARGV, it returns a Scheme expression to
1477 evaluate, and calls scm_set_program_arguments to make any remaining
1478 command-line arguments available to the Scheme code. For example,
1479 given the following arguments:
1480
1481 -e main -s ekko a speckled gecko
1482
1483 scm_set_program_arguments will return the following expression:
1484
1485 (begin (load "ekko") (main (command-line)) (quit))
1486
1487 You will usually want to use scm_shell instead of calling this
1488 function yourself.
1489
1490 ** The function scm_shell_usage prints a usage message appropriate for
1491 an interpreter that uses scm_compile_shell_switches to handle its
1492 command-line arguments.
1493
1494 void scm_shell_usage (int FATAL, char *MESSAGE)
1495 Print a usage message to the standard error output. If MESSAGE is
1496 non-zero, write it before the usage message, followed by a newline.
1497 If FATAL is non-zero, exit the process, using FATAL as the
1498 termination status. (If you want to be compatible with Guile,
1499 always use 1 as the exit status when terminating due to command-line
1500 usage problems.)
1501
1502 You will usually want to use scm_shell instead of calling this
1503 function yourself.
1504
1505 ** scm_eval_0str now returns SCM_UNSPECIFIED if the string contains no
1506 expressions. It used to return SCM_EOL. Earth-shattering.
1507
1508 ** The macros for declaring scheme objects in C code have been
1509 rearranged slightly. They are now:
1510
1511 SCM_SYMBOL (C_NAME, SCHEME_NAME)
1512 Declare a static SCM variable named C_NAME, and initialize it to
1513 point to the Scheme symbol whose name is SCHEME_NAME. C_NAME should
1514 be a C identifier, and SCHEME_NAME should be a C string.
1515
1516 SCM_GLOBAL_SYMBOL (C_NAME, SCHEME_NAME)
1517 Just like SCM_SYMBOL, but make C_NAME globally visible.
1518
1519 SCM_VCELL (C_NAME, SCHEME_NAME)
1520 Create a global variable at the Scheme level named SCHEME_NAME.
1521 Declare a static SCM variable named C_NAME, and initialize it to
1522 point to the Scheme variable's value cell.
1523
1524 SCM_GLOBAL_VCELL (C_NAME, SCHEME_NAME)
1525 Just like SCM_VCELL, but make C_NAME globally visible.
1526
1527 The `guile-snarf' script writes initialization code for these macros
1528 to its standard output, given C source code as input.
1529
1530 The SCM_GLOBAL macro is gone.
1531
1532 ** The scm_read_line and scm_read_line_x functions have been replaced
1533 by Scheme code based on the %read-delimited! procedure (known to C
1534 code as scm_read_delimited_x). See its description above for more
1535 information.
1536
1537 ** The function scm_sys_open has been renamed to scm_open. It now
1538 returns a port instead of an FD object.
1539
1540 * The dynamic linking support has changed. For more information, see
1541 libguile/DYNAMIC-LINKING.
1542
1543 \f
1544 Guile 1.0b3
1545
1546 User-visible changes from Thursday, September 5, 1996 until Guile 1.0
1547 (Sun 5 Jan 1997):
1548
1549 * Changes to the 'guile' program:
1550
1551 ** Guile now loads some new files when it starts up. Guile first
1552 searches the load path for init.scm, and loads it if found. Then, if
1553 Guile is not being used to execute a script, and the user's home
1554 directory contains a file named `.guile', Guile loads that.
1555
1556 ** You can now use Guile as a shell script interpreter.
1557
1558 To paraphrase the SCSH manual:
1559
1560 When Unix tries to execute an executable file whose first two
1561 characters are the `#!', it treats the file not as machine code to
1562 be directly executed by the native processor, but as source code
1563 to be executed by some interpreter. The interpreter to use is
1564 specified immediately after the #! sequence on the first line of
1565 the source file. The kernel reads in the name of the interpreter,
1566 and executes that instead. It passes the interpreter the source
1567 filename as its first argument, with the original arguments
1568 following. Consult the Unix man page for the `exec' system call
1569 for more information.
1570
1571 Now you can use Guile as an interpreter, using a mechanism which is a
1572 compatible subset of that provided by SCSH.
1573
1574 Guile now recognizes a '-s' command line switch, whose argument is the
1575 name of a file of Scheme code to load. It also treats the two
1576 characters `#!' as the start of a comment, terminated by `!#'. Thus,
1577 to make a file of Scheme code directly executable by Unix, insert the
1578 following two lines at the top of the file:
1579
1580 #!/usr/local/bin/guile -s
1581 !#
1582
1583 Guile treats the argument of the `-s' command-line switch as the name
1584 of a file of Scheme code to load, and treats the sequence `#!' as the
1585 start of a block comment, terminated by `!#'.
1586
1587 For example, here's a version of 'echo' written in Scheme:
1588
1589 #!/usr/local/bin/guile -s
1590 !#
1591 (let loop ((args (cdr (program-arguments))))
1592 (if (pair? args)
1593 (begin
1594 (display (car args))
1595 (if (pair? (cdr args))
1596 (display " "))
1597 (loop (cdr args)))))
1598 (newline)
1599
1600 Why does `#!' start a block comment terminated by `!#', instead of the
1601 end of the line? That is the notation SCSH uses, and although we
1602 don't yet support the other SCSH features that motivate that choice,
1603 we would like to be backward-compatible with any existing Guile
1604 scripts once we do. Furthermore, if the path to Guile on your system
1605 is too long for your kernel, you can start the script with this
1606 horrible hack:
1607
1608 #!/bin/sh
1609 exec /really/long/path/to/guile -s "$0" ${1+"$@"}
1610 !#
1611
1612 Note that some very old Unix systems don't support the `#!' syntax.
1613
1614
1615 ** You can now run Guile without installing it.
1616
1617 Previous versions of the interactive Guile interpreter (`guile')
1618 couldn't start up unless Guile's Scheme library had been installed;
1619 they used the value of the environment variable `SCHEME_LOAD_PATH'
1620 later on in the startup process, but not to find the startup code
1621 itself. Now Guile uses `SCHEME_LOAD_PATH' in all searches for Scheme
1622 code.
1623
1624 To run Guile without installing it, build it in the normal way, and
1625 then set the environment variable `SCHEME_LOAD_PATH' to a
1626 colon-separated list of directories, including the top-level directory
1627 of the Guile sources. For example, if you unpacked Guile so that the
1628 full filename of this NEWS file is /home/jimb/guile-1.0b3/NEWS, then
1629 you might say
1630
1631 export SCHEME_LOAD_PATH=/home/jimb/my-scheme:/home/jimb/guile-1.0b3
1632
1633
1634 ** Guile's read-eval-print loop no longer prints #<unspecified>
1635 results. If the user wants to see this, she can evaluate the
1636 expression (assert-repl-print-unspecified #t), perhaps in her startup
1637 file.
1638
1639 ** Guile no longer shows backtraces by default when an error occurs;
1640 however, it does display a message saying how to get one, and how to
1641 request that they be displayed by default. After an error, evaluate
1642 (backtrace)
1643 to see a backtrace, and
1644 (debug-enable 'backtrace)
1645 to see them by default.
1646
1647
1648
1649 * Changes to Guile Scheme:
1650
1651 ** Guile now distinguishes between #f and the empty list.
1652
1653 This is for compatibility with the IEEE standard, the (possibly)
1654 upcoming Revised^5 Report on Scheme, and many extant Scheme
1655 implementations.
1656
1657 Guile used to have #f and '() denote the same object, to make Scheme's
1658 type system more compatible with Emacs Lisp's. However, the change
1659 caused too much trouble for Scheme programmers, and we found another
1660 way to reconcile Emacs Lisp with Scheme that didn't require this.
1661
1662
1663 ** Guile's delq, delv, delete functions, and their destructive
1664 counterparts, delq!, delv!, and delete!, now remove all matching
1665 elements from the list, not just the first. This matches the behavior
1666 of the corresponding Emacs Lisp functions, and (I believe) the Maclisp
1667 functions which inspired them.
1668
1669 I recognize that this change may break code in subtle ways, but it
1670 seems best to make the change before the FSF's first Guile release,
1671 rather than after.
1672
1673
1674 ** The compiled-library-path function has been deleted from libguile.
1675
1676 ** The facilities for loading Scheme source files have changed.
1677
1678 *** The variable %load-path now tells Guile which directories to search
1679 for Scheme code. Its value is a list of strings, each of which names
1680 a directory.
1681
1682 *** The variable %load-extensions now tells Guile which extensions to
1683 try appending to a filename when searching the load path. Its value
1684 is a list of strings. Its default value is ("" ".scm").
1685
1686 *** (%search-load-path FILENAME) searches the directories listed in the
1687 value of the %load-path variable for a Scheme file named FILENAME,
1688 with all the extensions listed in %load-extensions. If it finds a
1689 match, then it returns its full filename. If FILENAME is absolute, it
1690 returns it unchanged. Otherwise, it returns #f.
1691
1692 %search-load-path will not return matches that refer to directories.
1693
1694 *** (primitive-load FILENAME :optional CASE-INSENSITIVE-P SHARP)
1695 uses %seach-load-path to find a file named FILENAME, and loads it if
1696 it finds it. If it can't read FILENAME for any reason, it throws an
1697 error.
1698
1699 The arguments CASE-INSENSITIVE-P and SHARP are interpreted as by the
1700 `read' function.
1701
1702 *** load uses the same searching semantics as primitive-load.
1703
1704 *** The functions %try-load, try-load-with-path, %load, load-with-path,
1705 basic-try-load-with-path, basic-load-with-path, try-load-module-with-
1706 path, and load-module-with-path have been deleted. The functions
1707 above should serve their purposes.
1708
1709 *** If the value of the variable %load-hook is a procedure,
1710 `primitive-load' applies its value to the name of the file being
1711 loaded (without the load path directory name prepended). If its value
1712 is #f, it is ignored. Otherwise, an error occurs.
1713
1714 This is mostly useful for printing load notification messages.
1715
1716
1717 ** The function `eval!' is no longer accessible from the scheme level.
1718 We can't allow operations which introduce glocs into the scheme level,
1719 because Guile's type system can't handle these as data. Use `eval' or
1720 `read-and-eval!' (see below) as replacement.
1721
1722 ** The new function read-and-eval! reads an expression from PORT,
1723 evaluates it, and returns the result. This is more efficient than
1724 simply calling `read' and `eval', since it is not necessary to make a
1725 copy of the expression for the evaluator to munge.
1726
1727 Its optional arguments CASE_INSENSITIVE_P and SHARP are interpreted as
1728 for the `read' function.
1729
1730
1731 ** The function `int?' has been removed; its definition was identical
1732 to that of `integer?'.
1733
1734 ** The functions `<?', `<?', `<=?', `=?', `>?', and `>=?'. Code should
1735 use the R4RS names for these functions.
1736
1737 ** The function object-properties no longer returns the hash handle;
1738 it simply returns the object's property list.
1739
1740 ** Many functions have been changed to throw errors, instead of
1741 returning #f on failure. The point of providing exception handling in
1742 the language is to simplify the logic of user code, but this is less
1743 useful if Guile's primitives don't throw exceptions.
1744
1745 ** The function `fileno' has been renamed from `%fileno'.
1746
1747 ** The function primitive-mode->fdes returns #t or #f now, not 1 or 0.
1748
1749
1750 * Changes to Guile's C interface:
1751
1752 ** The library's initialization procedure has been simplified.
1753 scm_boot_guile now has the prototype:
1754
1755 void scm_boot_guile (int ARGC,
1756 char **ARGV,
1757 void (*main_func) (),
1758 void *closure);
1759
1760 scm_boot_guile calls MAIN_FUNC, passing it CLOSURE, ARGC, and ARGV.
1761 MAIN_FUNC should do all the work of the program (initializing other
1762 packages, reading user input, etc.) before returning. When MAIN_FUNC
1763 returns, call exit (0); this function never returns. If you want some
1764 other exit value, MAIN_FUNC may call exit itself.
1765
1766 scm_boot_guile arranges for program-arguments to return the strings
1767 given by ARGC and ARGV. If MAIN_FUNC modifies ARGC/ARGV, should call
1768 scm_set_program_arguments with the final list, so Scheme code will
1769 know which arguments have been processed.
1770
1771 scm_boot_guile establishes a catch-all catch handler which prints an
1772 error message and exits the process. This means that Guile exits in a
1773 coherent way when system errors occur and the user isn't prepared to
1774 handle it. If the user doesn't like this behavior, they can establish
1775 their own universal catcher in MAIN_FUNC to shadow this one.
1776
1777 Why must the caller do all the real work from MAIN_FUNC? The garbage
1778 collector assumes that all local variables of type SCM will be above
1779 scm_boot_guile's stack frame on the stack. If you try to manipulate
1780 SCM values after this function returns, it's the luck of the draw
1781 whether the GC will be able to find the objects you allocate. So,
1782 scm_boot_guile function exits, rather than returning, to discourage
1783 people from making that mistake.
1784
1785 The IN, OUT, and ERR arguments were removed; there are other
1786 convenient ways to override these when desired.
1787
1788 The RESULT argument was deleted; this function should never return.
1789
1790 The BOOT_CMD argument was deleted; the MAIN_FUNC argument is more
1791 general.
1792
1793
1794 ** Guile's header files should no longer conflict with your system's
1795 header files.
1796
1797 In order to compile code which #included <libguile.h>, previous
1798 versions of Guile required you to add a directory containing all the
1799 Guile header files to your #include path. This was a problem, since
1800 Guile's header files have names which conflict with many systems'
1801 header files.
1802
1803 Now only <libguile.h> need appear in your #include path; you must
1804 refer to all Guile's other header files as <libguile/mumble.h>.
1805 Guile's installation procedure puts libguile.h in $(includedir), and
1806 the rest in $(includedir)/libguile.
1807
1808
1809 ** Two new C functions, scm_protect_object and scm_unprotect_object,
1810 have been added to the Guile library.
1811
1812 scm_protect_object (OBJ) protects OBJ from the garbage collector.
1813 OBJ will not be freed, even if all other references are dropped,
1814 until someone does scm_unprotect_object (OBJ). Both functions
1815 return OBJ.
1816
1817 Note that calls to scm_protect_object do not nest. You can call
1818 scm_protect_object any number of times on a given object, and the
1819 next call to scm_unprotect_object will unprotect it completely.
1820
1821 Basically, scm_protect_object and scm_unprotect_object just
1822 maintain a list of references to things. Since the GC knows about
1823 this list, all objects it mentions stay alive. scm_protect_object
1824 adds its argument to the list; scm_unprotect_object remove its
1825 argument from the list.
1826
1827
1828 ** scm_eval_0str now returns the value of the last expression
1829 evaluated.
1830
1831 ** The new function scm_read_0str reads an s-expression from a
1832 null-terminated string, and returns it.
1833
1834 ** The new function `scm_stdio_to_port' converts a STDIO file pointer
1835 to a Scheme port object.
1836
1837 ** The new function `scm_set_program_arguments' allows C code to set
1838 the value teruturned by the Scheme `program-arguments' function.
1839
1840 \f
1841 Older changes:
1842
1843 * Guile no longer includes sophisticated Tcl/Tk support.
1844
1845 The old Tcl/Tk support was unsatisfying to us, because it required the
1846 user to link against the Tcl library, as well as Tk and Guile. The
1847 interface was also un-lispy, in that it preserved Tcl/Tk's practice of
1848 referring to widgets by names, rather than exporting widgets to Scheme
1849 code as a special datatype.
1850
1851 In the Usenix Tk Developer's Workshop held in July 1996, the Tcl/Tk
1852 maintainers described some very interesting changes in progress to the
1853 Tcl/Tk internals, which would facilitate clean interfaces between lone
1854 Tk and other interpreters --- even for garbage-collected languages
1855 like Scheme. They expected the new Tk to be publicly available in the
1856 fall of 1996.
1857
1858 Since it seems that Guile might soon have a new, cleaner interface to
1859 lone Tk, and that the old Guile/Tk glue code would probably need to be
1860 completely rewritten, we (Jim Blandy and Richard Stallman) have
1861 decided not to support the old code. We'll spend the time instead on
1862 a good interface to the newer Tk, as soon as it is available.
1863
1864 Until then, gtcltk-lib provides trivial, low-maintenance functionality.
1865
1866 \f
1867 Copyright information:
1868
1869 Copyright (C) 1996,1997 Free Software Foundation, Inc.
1870
1871 Permission is granted to anyone to make or distribute verbatim copies
1872 of this document as received, in any medium, provided that the
1873 copyright notice and this permission notice are preserved,
1874 thus giving the recipient permission to redistribute in turn.
1875
1876 Permission is granted to distribute modified versions
1877 of this document, or of portions of it,
1878 under the above conditions, provided also that they
1879 carry prominent notices stating who last changed them.
1880
1881 \f
1882 Local variables:
1883 mode: outline
1884 paragraph-separate: "[ \f]*$"
1885 end:
1886