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