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