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 |
f7b47737 | 7 | Changes since Guile 1.0 (Sun 5 Jan 1997): |
6685dc83 | 8 | |
f7b47737 JB |
9 | \f |
10 | Guile 1.0b3 | |
3065a62a | 11 | |
f7b47737 | 12 | User-visible changes from Thursday, September 5, 1996 until Guile 1.0: |
3065a62a | 13 | |
4b521edb | 14 | * Changes to the 'guile' program: |
3065a62a | 15 | |
4b521edb JB |
16 | ** Guile now loads some new files when it starts up. Guile first |
17 | searches the load path for init.scm, and loads it if found. Then, if | |
18 | Guile is not being used to execute a script, and the user's home | |
19 | directory contains a file named `.guile', Guile loads that. | |
c6486f8a | 20 | |
4b521edb | 21 | ** You can now use Guile as a shell script interpreter. |
3065a62a JB |
22 | |
23 | To paraphrase the SCSH manual: | |
24 | ||
25 | When Unix tries to execute an executable file whose first two | |
26 | characters are the `#!', it treats the file not as machine code to | |
27 | be directly executed by the native processor, but as source code | |
28 | to be executed by some interpreter. The interpreter to use is | |
29 | specified immediately after the #! sequence on the first line of | |
30 | the source file. The kernel reads in the name of the interpreter, | |
31 | and executes that instead. It passes the interpreter the source | |
32 | filename as its first argument, with the original arguments | |
33 | following. Consult the Unix man page for the `exec' system call | |
34 | for more information. | |
35 | ||
1a1945be JB |
36 | Now you can use Guile as an interpreter, using a mechanism which is a |
37 | compatible subset of that provided by SCSH. | |
38 | ||
3065a62a JB |
39 | Guile now recognizes a '-s' command line switch, whose argument is the |
40 | name of a file of Scheme code to load. It also treats the two | |
41 | characters `#!' as the start of a comment, terminated by `!#'. Thus, | |
42 | to make a file of Scheme code directly executable by Unix, insert the | |
43 | following two lines at the top of the file: | |
44 | ||
45 | #!/usr/local/bin/guile -s | |
46 | !# | |
47 | ||
48 | Guile treats the argument of the `-s' command-line switch as the name | |
49 | of a file of Scheme code to load, and treats the sequence `#!' as the | |
50 | start of a block comment, terminated by `!#'. | |
51 | ||
52 | For example, here's a version of 'echo' written in Scheme: | |
53 | ||
54 | #!/usr/local/bin/guile -s | |
55 | !# | |
56 | (let loop ((args (cdr (program-arguments)))) | |
57 | (if (pair? args) | |
58 | (begin | |
59 | (display (car args)) | |
60 | (if (pair? (cdr args)) | |
61 | (display " ")) | |
62 | (loop (cdr args))))) | |
63 | (newline) | |
64 | ||
65 | Why does `#!' start a block comment terminated by `!#', instead of the | |
66 | end of the line? That is the notation SCSH uses, and although we | |
67 | don't yet support the other SCSH features that motivate that choice, | |
68 | we would like to be backward-compatible with any existing Guile | |
3763761c JB |
69 | scripts once we do. Furthermore, if the path to Guile on your system |
70 | is too long for your kernel, you can start the script with this | |
71 | horrible hack: | |
72 | ||
73 | #!/bin/sh | |
74 | exec /really/long/path/to/guile -s "$0" ${1+"$@"} | |
75 | !# | |
3065a62a JB |
76 | |
77 | Note that some very old Unix systems don't support the `#!' syntax. | |
78 | ||
c6486f8a | 79 | |
4b521edb | 80 | ** You can now run Guile without installing it. |
6685dc83 JB |
81 | |
82 | Previous versions of the interactive Guile interpreter (`guile') | |
83 | couldn't start up unless Guile's Scheme library had been installed; | |
84 | they used the value of the environment variable `SCHEME_LOAD_PATH' | |
85 | later on in the startup process, but not to find the startup code | |
86 | itself. Now Guile uses `SCHEME_LOAD_PATH' in all searches for Scheme | |
87 | code. | |
88 | ||
89 | To run Guile without installing it, build it in the normal way, and | |
90 | then set the environment variable `SCHEME_LOAD_PATH' to a | |
91 | colon-separated list of directories, including the top-level directory | |
92 | of the Guile sources. For example, if you unpacked Guile so that the | |
93 | full filename of this NEWS file is /home/jimb/guile-1.0b3/NEWS, then | |
94 | you might say | |
95 | ||
96 | export SCHEME_LOAD_PATH=/home/jimb/my-scheme:/home/jimb/guile-1.0b3 | |
97 | ||
c6486f8a | 98 | |
4b521edb JB |
99 | ** Guile's read-eval-print loop no longer prints #<unspecified> |
100 | results. If the user wants to see this, she can evaluate the | |
101 | expression (assert-repl-print-unspecified #t), perhaps in her startup | |
102 | file. | |
6685dc83 | 103 | |
4b521edb JB |
104 | ** Guile no longer shows backtraces by default when an error occurs; |
105 | however, it does display a message saying how to get one, and how to | |
106 | request that they be displayed by default. After an error, evaluate | |
107 | (backtrace) | |
108 | to see a backtrace, and | |
109 | (debug-enable 'backtrace) | |
110 | to see them by default. | |
6685dc83 | 111 | |
6685dc83 | 112 | |
d9fb83d9 | 113 | |
4b521edb JB |
114 | * Changes to Guile Scheme: |
115 | ||
116 | ** Guile now distinguishes between #f and the empty list. | |
117 | ||
118 | This is for compatibility with the IEEE standard, the (possibly) | |
119 | upcoming Revised^5 Report on Scheme, and many extant Scheme | |
120 | implementations. | |
121 | ||
122 | Guile used to have #f and '() denote the same object, to make Scheme's | |
123 | type system more compatible with Emacs Lisp's. However, the change | |
124 | caused too much trouble for Scheme programmers, and we found another | |
125 | way to reconcile Emacs Lisp with Scheme that didn't require this. | |
126 | ||
127 | ||
128 | ** Guile's delq, delv, delete functions, and their destructive | |
c6486f8a JB |
129 | counterparts, delq!, delv!, and delete!, now remove all matching |
130 | elements from the list, not just the first. This matches the behavior | |
131 | of the corresponding Emacs Lisp functions, and (I believe) the Maclisp | |
132 | functions which inspired them. | |
133 | ||
134 | I recognize that this change may break code in subtle ways, but it | |
135 | seems best to make the change before the FSF's first Guile release, | |
136 | rather than after. | |
137 | ||
138 | ||
4b521edb | 139 | ** The compiled-library-path function has been deleted from libguile. |
6685dc83 | 140 | |
4b521edb | 141 | ** The facilities for loading Scheme source files have changed. |
c6486f8a | 142 | |
4b521edb | 143 | *** The variable %load-path now tells Guile which directories to search |
6685dc83 JB |
144 | for Scheme code. Its value is a list of strings, each of which names |
145 | a directory. | |
146 | ||
4b521edb JB |
147 | *** The variable %load-extensions now tells Guile which extensions to |
148 | try appending to a filename when searching the load path. Its value | |
149 | is a list of strings. Its default value is ("" ".scm"). | |
150 | ||
151 | *** (%search-load-path FILENAME) searches the directories listed in the | |
152 | value of the %load-path variable for a Scheme file named FILENAME, | |
153 | with all the extensions listed in %load-extensions. If it finds a | |
154 | match, then it returns its full filename. If FILENAME is absolute, it | |
155 | returns it unchanged. Otherwise, it returns #f. | |
6685dc83 | 156 | |
4b521edb JB |
157 | %search-load-path will not return matches that refer to directories. |
158 | ||
159 | *** (primitive-load FILENAME :optional CASE-INSENSITIVE-P SHARP) | |
160 | uses %seach-load-path to find a file named FILENAME, and loads it if | |
161 | it finds it. If it can't read FILENAME for any reason, it throws an | |
162 | error. | |
6685dc83 JB |
163 | |
164 | The arguments CASE-INSENSITIVE-P and SHARP are interpreted as by the | |
4b521edb JB |
165 | `read' function. |
166 | ||
167 | *** load uses the same searching semantics as primitive-load. | |
168 | ||
169 | *** The functions %try-load, try-load-with-path, %load, load-with-path, | |
170 | basic-try-load-with-path, basic-load-with-path, try-load-module-with- | |
171 | path, and load-module-with-path have been deleted. The functions | |
172 | above should serve their purposes. | |
173 | ||
174 | *** If the value of the variable %load-hook is a procedure, | |
175 | `primitive-load' applies its value to the name of the file being | |
176 | loaded (without the load path directory name prepended). If its value | |
177 | is #f, it is ignored. Otherwise, an error occurs. | |
178 | ||
179 | This is mostly useful for printing load notification messages. | |
180 | ||
181 | ||
182 | ** The function `eval!' is no longer accessible from the scheme level. | |
183 | We can't allow operations which introduce glocs into the scheme level, | |
184 | because Guile's type system can't handle these as data. Use `eval' or | |
185 | `read-and-eval!' (see below) as replacement. | |
186 | ||
187 | ** The new function read-and-eval! reads an expression from PORT, | |
188 | evaluates it, and returns the result. This is more efficient than | |
189 | simply calling `read' and `eval', since it is not necessary to make a | |
190 | copy of the expression for the evaluator to munge. | |
191 | ||
192 | Its optional arguments CASE_INSENSITIVE_P and SHARP are interpreted as | |
193 | for the `read' function. | |
194 | ||
195 | ||
196 | ** The function `int?' has been removed; its definition was identical | |
197 | to that of `integer?'. | |
198 | ||
199 | ** The functions `<?', `<?', `<=?', `=?', `>?', and `>=?'. Code should | |
200 | use the R4RS names for these functions. | |
201 | ||
202 | ** The function object-properties no longer returns the hash handle; | |
203 | it simply returns the object's property list. | |
204 | ||
205 | ** Many functions have been changed to throw errors, instead of | |
206 | returning #f on failure. The point of providing exception handling in | |
207 | the language is to simplify the logic of user code, but this is less | |
208 | useful if Guile's primitives don't throw exceptions. | |
209 | ||
210 | ** The function `fileno' has been renamed from `%fileno'. | |
211 | ||
212 | ** The function primitive-mode->fdes returns #t or #f now, not 1 or 0. | |
213 | ||
214 | ||
215 | * Changes to Guile's C interface: | |
216 | ||
217 | ** The library's initialization procedure has been simplified. | |
218 | scm_boot_guile now has the prototype: | |
219 | ||
220 | void scm_boot_guile (int ARGC, | |
221 | char **ARGV, | |
222 | void (*main_func) (), | |
223 | void *closure); | |
224 | ||
225 | scm_boot_guile calls MAIN_FUNC, passing it CLOSURE, ARGC, and ARGV. | |
226 | MAIN_FUNC should do all the work of the program (initializing other | |
227 | packages, reading user input, etc.) before returning. When MAIN_FUNC | |
228 | returns, call exit (0); this function never returns. If you want some | |
229 | other exit value, MAIN_FUNC may call exit itself. | |
230 | ||
231 | scm_boot_guile arranges for program-arguments to return the strings | |
232 | given by ARGC and ARGV. If MAIN_FUNC modifies ARGC/ARGV, should call | |
233 | scm_set_program_arguments with the final list, so Scheme code will | |
234 | know which arguments have been processed. | |
235 | ||
236 | scm_boot_guile establishes a catch-all catch handler which prints an | |
237 | error message and exits the process. This means that Guile exits in a | |
238 | coherent way when system errors occur and the user isn't prepared to | |
239 | handle it. If the user doesn't like this behavior, they can establish | |
240 | their own universal catcher in MAIN_FUNC to shadow this one. | |
241 | ||
242 | Why must the caller do all the real work from MAIN_FUNC? The garbage | |
243 | collector assumes that all local variables of type SCM will be above | |
244 | scm_boot_guile's stack frame on the stack. If you try to manipulate | |
245 | SCM values after this function returns, it's the luck of the draw | |
246 | whether the GC will be able to find the objects you allocate. So, | |
247 | scm_boot_guile function exits, rather than returning, to discourage | |
248 | people from making that mistake. | |
249 | ||
250 | The IN, OUT, and ERR arguments were removed; there are other | |
251 | convenient ways to override these when desired. | |
252 | ||
253 | The RESULT argument was deleted; this function should never return. | |
254 | ||
255 | The BOOT_CMD argument was deleted; the MAIN_FUNC argument is more | |
256 | general. | |
257 | ||
258 | ||
259 | ** Guile's header files should no longer conflict with your system's | |
260 | header files. | |
261 | ||
262 | In order to compile code which #included <libguile.h>, previous | |
263 | versions of Guile required you to add a directory containing all the | |
264 | Guile header files to your #include path. This was a problem, since | |
265 | Guile's header files have names which conflict with many systems' | |
266 | header files. | |
267 | ||
268 | Now only <libguile.h> need appear in your #include path; you must | |
269 | refer to all Guile's other header files as <libguile/mumble.h>. | |
270 | Guile's installation procedure puts libguile.h in $(includedir), and | |
271 | the rest in $(includedir)/libguile. | |
272 | ||
273 | ||
274 | ** Two new C functions, scm_protect_object and scm_unprotect_object, | |
275 | have been added to the Guile library. | |
276 | ||
277 | scm_protect_object (OBJ) protects OBJ from the garbage collector. | |
278 | OBJ will not be freed, even if all other references are dropped, | |
279 | until someone does scm_unprotect_object (OBJ). Both functions | |
280 | return OBJ. | |
281 | ||
282 | Note that calls to scm_protect_object do not nest. You can call | |
283 | scm_protect_object any number of times on a given object, and the | |
284 | next call to scm_unprotect_object will unprotect it completely. | |
285 | ||
286 | Basically, scm_protect_object and scm_unprotect_object just | |
287 | maintain a list of references to things. Since the GC knows about | |
288 | this list, all objects it mentions stay alive. scm_protect_object | |
289 | adds its argument to the list; scm_unprotect_object remove its | |
290 | argument from the list. | |
291 | ||
292 | ||
293 | ** scm_eval_0str now returns the value of the last expression | |
294 | evaluated. | |
295 | ||
296 | ** The new function scm_read_0str reads an s-expression from a | |
297 | null-terminated string, and returns it. | |
298 | ||
299 | ** The new function `scm_stdio_to_port' converts a STDIO file pointer | |
300 | to a Scheme port object. | |
301 | ||
302 | ** The new function `scm_set_program_arguments' allows C code to set | |
303 | the value teruturned by the Scheme `program-arguments' function. | |
6685dc83 | 304 | |
6685dc83 | 305 | \f |
1a1945be JB |
306 | Older changes: |
307 | ||
308 | * Guile no longer includes sophisticated Tcl/Tk support. | |
309 | ||
310 | The old Tcl/Tk support was unsatisfying to us, because it required the | |
311 | user to link against the Tcl library, as well as Tk and Guile. The | |
312 | interface was also un-lispy, in that it preserved Tcl/Tk's practice of | |
313 | referring to widgets by names, rather than exporting widgets to Scheme | |
314 | code as a special datatype. | |
315 | ||
316 | In the Usenix Tk Developer's Workshop held in July 1996, the Tcl/Tk | |
317 | maintainers described some very interesting changes in progress to the | |
318 | Tcl/Tk internals, which would facilitate clean interfaces between lone | |
319 | Tk and other interpreters --- even for garbage-collected languages | |
320 | like Scheme. They expected the new Tk to be publicly available in the | |
321 | fall of 1996. | |
322 | ||
323 | Since it seems that Guile might soon have a new, cleaner interface to | |
324 | lone Tk, and that the old Guile/Tk glue code would probably need to be | |
325 | completely rewritten, we (Jim Blandy and Richard Stallman) have | |
326 | decided not to support the old code. We'll spend the time instead on | |
327 | a good interface to the newer Tk, as soon as it is available. | |
5c54da76 | 328 | |
8512dea6 | 329 | Until then, gtcltk-lib provides trivial, low-maintenance functionality. |
deb95d71 | 330 | |
5c54da76 JB |
331 | \f |
332 | Copyright information: | |
333 | ||
334 | Copyright (C) 1996 Free Software Foundation, Inc. | |
335 | ||
336 | Permission is granted to anyone to make or distribute verbatim copies | |
337 | of this document as received, in any medium, provided that the | |
338 | copyright notice and this permission notice are preserved, | |
339 | thus giving the recipient permission to redistribute in turn. | |
340 | ||
341 | Permission is granted to distribute modified versions | |
342 | of this document, or of portions of it, | |
343 | under the above conditions, provided also that they | |
344 | carry prominent notices stating who last changed them. | |
345 |