*** empty log message ***
[bpt/guile.git] / libguile / ChangeLog
CommitLineData
aad827f4
JB
11999-06-09 Jim Blandy <jimb@savonarola.red-bean.com>
2
3 * gc.c (scm_igc): Check for scm_mallocated underflow. Otherwise,
4 it shows up as terrible performance, as we GC constantly.
5
6 * ioext.c (scm_do_read_line): Rewritten to use memchr to find the
7 newline. A bit faster, and definitely hairier.
8 (scm_read_line): Count newlines here instead.
9
10 * strings.c (scm_take_str): New function.
11 (scm_take0str): Reimplement in terms of scm_take_str. * strings.h
12 (scm_take_str): New declaration. * ioext.c (scm_read_line): Use
13 scm_take_str, to avoid copying the string.
14
15 Add some simple-minded support for line buffered ports.
16 * ports.h (SCM_BUFLINE): New flag for ports.
17 * init.c (scm_init_standard_ports): Request line-buffering on
18 the standard output port.
19* * ports.c (scm_mode_bits): Recognize 'l' as a request for line
20 buffering.
21 (scm_putc, scm_puts, scm_lfwrite): If the port is line-buffered,
22 and there's a newline to be written, flush the port.
23
24 Gary Houston's open-buffer port patches:
25
26 1999-04-26 Gary Houston <ghouston@easynet.co.uk>
27
28 * ports.c: (scm_lseek): clear buffers even if just reading current
29 position.
30
31 * fports.c (local_fclose): call local_fflush unconditionally.
32 (various): don't use the scm_must... memory procs.
33
34 1999-04-25 Gary Houston <ghouston@easynet.co.uk>
35
36 * ports.h (scm_port): make read_pos a pointer to const.
37 strports.c: take care of rw_active and rw_randow.
38 fports.c: scm_fport_drain_input: removed. do it all in ports.c.
39 strports.c (scm_mkstrport): check that pos is reasonable.
40 ioext.c (scm_ftell, scm_fseek): use lseek.
41 (SCM_CLEAR_BUFFERS): macro deleted.
42 ioext.c (redirect_port: use ptob fflush, read_flush.
43 ports.h (scm_ptobfuns): add ftruncate.
44 ports.c (scm_newptob): set ftruncate.
45 adjust ptob tables.
46* ports.c (scm_ftruncate): new procedure.
47 fports.c (local_ftrunate), strports.c (str_ftruncate): new procs.
48 strports.c (st_seek, st_grow_port): new procs.
49 fports.h (scm_port): change size types from int to off_t.
50 ports.c (scm_init_ports): initialise the seek symbols here
51 instead of in ioext.c.
52 strports.c (scm_call_with_output_string): start with an empty
53 string, so seek and ftruncate can be used.
54
55 gdbint.c: adjust string port usage.
56
57 1999-04-24 Gary Houston <ghouston@easynet.co.uk>
58
59 * ports.h (scm_ptobfuns): add a read_flush procedure which is the
60 equivalent to fflush for the read buffer.
61 * ports.c (scm_newptob): set read_flush.
62 ports.c (void_port_ptob): set read_flush.
63 fports.c (local_read_flush): new proc. add to ptob.
64 strport.c (st_read_flush): likewise.
65 vport.c (sf_read_flush): likewise.
66 fports.h (struct scm_fport): remove random member. there's nothing
67 left but fdes. leaving it as a struct to allow for future changes.
68 fports.c: replace usage of scm_fport::random with scm_port::rw_random.
69 ports.c: (scm_putc, scm_puts, scm_lfwrite): call the read_flush
70 ptob proc if the read buffer is filled.
71
72 1999-04-23 Gary Houston <ghouston@easynet.co.uk>
73
74 * ports.h (scm_port): add a rw_random member and replace
75 reading and writing members with rw_active member.
76 SCM_PORT_READ/SCM_PORT_WRITE: new values.
77
78 1999-04-22 Gary Houston <ghouston@easynet.co.uk>
79
80 * ports.h (struct scm_port_table): add writing and reading members
81 to replace write_needs_seek: it isn't good enough for non-fports.
82 ports.c, ioext.c, fports.c: corresponding changes.
83 (struct scm_port_table): give it a typedef and rename to scm_port.
84 ports.c, fports.c, strports.c, vports.c, ioext.c, ports.h:
85 corresponding changes.
86
87 1999-04-20 Gary Houston <ghouston@easynet.co.uk>
88
89 * ports.c (scm_newptob): bugfix: set seek member.
90* * (scm_lseek): new procedure, using code from ioext.c:scm_fseek
91 and generalised to all port types.
92
93 1999-04-18 Gary Houston <ghouston@easynet.co.uk>
94
95 * scmsigs.c (scm_init_scmsigs): set the SA_RESTART flag for all
96 signals (it was only being done for handlers installed from Scheme).
97 Otherwise (for example) SIGSTOP followed by SIGCONT on an interpreter
98 waiting for input caused an EINTR error from read.
99
100 1999-04-07 Gary Houston <ghouston@easynet.co.uk>
101
102 * ports.h (struct scm_port_table): make all the char members
103 unsigned, so they convert to int without becoming negative if large.
104
105 1999-03-14 Gary Houston <ghouston@easynet.co.uk>
106
107 * fports.c (scm_fdes_wait_for_input): forgot to check compilation
108 with threads enabled. rename this procedure to
109 fport_wait_for_input and take a port instead of a fdes.
110 use scm_fport_input_waiting_p instead of scm_fdes_waiting_p.
111
112 * readline.c (scm_readline): Applied a patch from Greg Harvey to
113 get readline support working again: use fdopen to get FILE objects.
114
115 1999-02-26 Gary Houston <ghouston@easynet.co.uk>
116
117 * gc.c (scm_init_storage): install an atexit proc to flush the
118 ports.
119 (cleanup): the new proc. it sets a global variable which can be
120 checked by the ptob flush procs to avoid trying to throw
121 exceptions during exit. not very pleasant but it seems more reliable.
122 * fports.c (local_fflush): check terminating variable and if set
123 don't throw exception.
124 * CHECKME: that the atexit proc is installed if unexec used.
125
126 * throw.c (scm_handle_by_message): don't flush all ports here.
127 it still causes bus errors.
128
129 * fports.h (SCM_FPORT_CLEAR_BUFFERS): rename to SCM_CLEAR_BUFFERS
130 and move to ioext.c.
131
132 * fports.c (scm_fdes_waiting_p): merged into fport_input_waiting_p.
133
134 * ports.c (scm_char_ready_p): check the port buffer and call the
135 ptob entry if needed.
136
137 * ports.h (scm_ptobfuns): input_waiting_p added. change all the
138 ptob initialisers. use it in char-ready
139
140 * ioext.c (scm_do_read_line): moved from ports.c. make it static.
141
142 * vports.c (sfflush): modified to write a char (since softports
143 currently use shortbuf.)
144
145 * fports.c (scm_standard_stream_to_port): moved to init.c and
146 made static.
147
148 * init.c (scm_init_standard_ports): make stdout and stderr
149 unbuffered if connected to a terminal. with stdio they
150 were line-buffered by default.
151
152 (scm_ptobfuns): fputc, fputs, fwrite, fgetc, fgets removed.
153 update ptob tables.
154
155 * ports.h (scm_ptobfuns): change fflush return to void.
156 change flush proc definitions.
157
158 * strports.c (scm_call_with_output_string): get size from
159 buffer instead of port stream.
160 (scm_strprint_obj): likewise.
161 (st_flush): new proc.
162
163 * ports.h (struct scm_port_table): added write_end member,
164 as an optimisation. set it where write_buf_size is set.
165
166 * ports.h (struct scm_port_table): change stream from void *
167 back to SCM. SCM presumably must be large enough to hold a
168 pointer (and probably vice versa but who knows.)
169 (SCM_SSTREAM): deleted. change users back to SCM_STREAM.
170
171 (scm_puts): rewritten
172 * fports.c (local_ffwrite, local_fputs): removed.
173 * strports.c (stputc, stputs, stwrite): dyked out (FIXME)
174 * vports.c (sfputc, sfputs, sfwrite) likewise.
175 * ports.c (write_void_port, puts_void_port): removed.
176 (putc_void_port, getc_void_port, fgets_void_port): likewise.
177
178 * ports.c (scm_lfwrite): rewritten using fport.c version.
179
180 * fports.c (local_fputc): deleted.
181
182 * ports.c (scm_add_to_port_table): initialise write_needs_seek.
183
184 * ports.h (scm_ptobfuns): add seek function pointer.
185 * fports.c: set it to local_seek, new procedure.
186
187
188 * fports.h (SCM_MAYBE_DRAIN_INPUT): moved to ports.c.
189 use ptob for seek. take ptob instead of fport arg.
190
191 * ports.h (struct scm_port_table): new member write_needs_seek,
192 replaces reading member in fport struct.
193
194 * vports.c (sfgetc): store the getted char into the buffer.
195 rename to sf_fill_buffer and install it for fill-buffer in ptob.
196 the Scheme interface is still a procedure that gets a char.
197 (scm_make_soft_port): set up the port buffer (shortbuf).
198
199 * fports.c (local_fgetc, local_fgets): deleted.
200 * strports.c (stgetc): likewise.
201 * ports.c: scm_generic_fgets: likewise.
202
203 * ports.h (scm_ptobfuns): add fill_buffer.
204 * ports.c (scm_newptob): assign it.
205 * strports.c (scm_mkstrport): set up the buffer.
206 put just the string into the stream, not cons (pos stream).
207 (stfill_buffer): new proc.
208
209 * ports.h: fport buffer moved into port table: to be
210 used for all port types.
211
212 1998-12-20 Gary Houston <ghouston@easynet.co.uk>
213
214 * throw.c (scm_handle_by_message): flush ports at exit.
215
216 * socket.c (scm_sock_fd_to_port): use scm_fdes_to_port.
217 (scm_getsockopt, scm_setsockopt, scm_shutdown, scm_connect,
218 scm_bind, scm_listen, scm_accept, scm_getsockname,
219 scm_getpeername, scm_recv, scm_send, scm_recvfrom,
220 scm_sendto,
221 use SCM_FPORT_FDES. use SCM_OPFPORTP not SCM_FPORTP.
222
223 * posix.c (scm_getgroups): use SCM_ALLOW/DEFER_INTS.
224 (scm_ttyname): use SCM_FPORT_FDES.
225 (scm_tcgetpgrp, scm_tcsetpgrp): likewise.
226
227 * filesys.c (scm_chown): use SCM_FPORT_FDES.
228 (scm_chmod, scm_stat, scm_truncate_file: likewise.
229
230 * ioext.c (scm_isatty_p): use SCM_FPORT_FDES.
231 (scm_fdes_to_ports): modified.
232 (scm_fdopen): use scm_fdes_to_port.
233
234 * ports.c (scm_init_ports): don't try to flush ports using
235 atexit(). it's too late, errors will cause SEGV.
236
237 * fports.c (scm_fport_buffer_add): new procedure.
238
239 * fports.h (SCM_FDES_RANDOM_P): new macro. use it in
240 scm_fdes_to_port and scm_redirect_port.
241
242 * ioext.c (scm_redirect_port): use setvbuf to set buffers in the
243 new port. reset fp->random.
244
245 * fports.c (scm_fdes_to_port), ports.c (scm_void_port),
246 filesys.c (scm_opendir):
247 restore defer interrupts while the port is constructed.
248* (scm_setvbuf): if mode is _IOFBF and size is not supplied,
249 derive buffer size from fdes or use a default.
250 (scm_fdes_to_port): use setvbuf instead of creating the buffers
251 directly.
252
253 vports.c (various places): use SCM_SSTREAM.
254 strports.c: likewise.
255 * gdbint.c: likewise.
256 * ports.h (SCM_SSTREAM): new macro.
257
258 * fports.c (scm_input_waiting_p): use scm_return_first, since port
259 may be removed from the stack by the tail call to scm_fdes_waiting_p.
260
261 * fports.h (SCM_CLEAR_BUFFERS): new macro.
262
263 * filesys.c (scm_fsync): use SCM_FDES.
264
265 * ports.c (scm_force_output): call scm_fflush.
266
267 * print.c (scm_newline): don't check errno for EPIPE (it wouldn't
268* reach this point.) don't flush port (if scm_cur_outp).
269
270 * fports.h (SCM_FPORT_FDES): new macro.
271
272 * filesys.c (scm_fcntl): get fdes from fport.
273 (set_element, get_element): likewise.
274
275 * vports.c (sfflush): don't need to set errno.
276
277 * ports.c: install scm_flush_all_ports to be run on exit.
278
279 * filesys.c (scm_open): adjust port_mode for O_APPEND and O_CREAT.
280
281 ports.c fports.c ioext.c posix.c socket.c net_db.c filesys.c:
282 removed all uses of SCM_DEFER/ALLOW ints for now. they were mainly
283 just protecting errno. some may need to be put back.
284
285 * scmsigs.c (take_signal): save and restore errno while this
286 proc runs.
287
288 *fports.c (print_pipe_port, local_pclose, scm_pipob): deleted.
289* open-pipe, close-pipe are emulated in (ice-9 popen)
290 ports.c (scm_ports_prehistory): don't init scm_pipob.
291 ports.h (scm_tc16_pipe): deleted.
292 posix.c (scm_open_pipe, scm_close_pipe): deleted.
293
294 * ioext.c (scm_primitive_move_to_fdes): use fport.
295 * fport.c (scm_fport_fill_buffer): flush write buffer if needed.
296 change arg type from scm_fport to SCM port.
297 fport.h (SCM_SETFDES): removed.
298 (SCM_MAYBE_DRAIN_INPUT): new macro.
299
300 * fport.h (struct scm_fport): added 'random'.
301 fport.c (scm_open_file): set random if lseek works.
302
303 * ioext.c (scm_dup_to_fdes): use SCM_FSTREAM.
304 (scm_ftell): always use lseek and account for the buffer.
305 (scm_fileno): use fport buffer.
306 (scm_fseek): clear fport buffers. always use lseek.
307
308 * posix.c (scm_pipe): use fport buffer.
309 * unif.c: include fports.h instead of genio.h.
310 * fports.c (scm_fdes_wait_for_input, scm_fport_fill_buffer): new
311 procedures.
312 (local_fgetc): use them.
313 (local_ffwrite): use buffer.
314 (local_fgets): use buffer.
315 (scm_setbuf0): deleted.
316 (scm_setvbuf): set the buffer.
317 (scm_setfileno): deleted.
318 (scm_evict_ports): set fdes directly.
319* (scm_freopen): deleted. doesn't seem useful in Guile.
320 (scm_stdio_to_port): deleted.
321 fports.h (struct scm_fport): add shortbuf member to avoid separate
322 code for unbuffered ports.
323 (SCM_FPORTP, SCM_OPFPORTP, SCM_OPINFPORTP, SCM_OPOUTFPORTP): moved
324 from ports.h.
325
326 * genio.c, genio.h: move contents into ports.c, ports.h. The
327 division wasn't useful.
328
329 * fports.c, fports.h (scm_fport_drain_input): new procedure.
330 * ports.c (scm_drain_input): call scm_fport_drain_input.
331 * scm_fdes_waiting_p: new procedure.
332 * fports.c (scm_fdes_to_port): allocate read and/or write buffers.
333 (scm_input_waiting_p): check the buffer.
334 (local_fgetc, local_fflush, local_fputc): likewise.
335
336 * fports.h (scm_fport): read/write_buf,_pos,_buf_end,,_buf_size:
337 new members.
338 * init.c (scm_init_standard_ports): pass fdes instead of FILE *.
339
340* * ports.c (scm_drain_input): new procedure.
341 ports.h: prototype.
342 * fports.c (FPORT_READ_SAFE, FPORT_WRITE_SAFE, FPORT_ALL_OKAY,
343 pre_read, pre_write): removed.
344 (local_fputc, local_fputs, local_ffwrite): use write, not stdio.
345 (scm_standard_stream_to_port): change first arg from FILE * to
346 int fdes.
347 (local_fflush): flush fdes, not FILE *.
348 * fports.h (SCM_NOFTELL): removed.
349 * genio.c, ports.c: don't include filesys.h.
350 * genio.c (scm_getc): don't use scm_internal_select if FPORT.
351 do it in fports.c:local_fgetc.
352 * genio.c: don't use SCM_SYSCALL when calling ptob procedures.
353 do it where it's needed in the port smobs.
354 * filesys.c (scm_input_waiting_p): moved to fports.c, stdio
355 buffer support removed. take SCM arg, not FILE *.
356 * filesys.h: prototype moved too.
357 * fports.c (scm_fdes_to_port): new procedure.
358 (local_fgetc): use read not fgetc.
359 (local_fclose): use close, not fclose.
360 (local_fgets): use read, not fgets
361 * fports.h: prototype for scm_fdes_to_port.
362 * fports.h (scm_fport): new struct.
363 * fports.c (scm_open_file): use open, not fopen.
364 #include fcntl.h
365 * ports.h (struct scm_port_table): change stream from SCM to void *.
366 * ports.c (scm_add_to_port_table): check for memory allocation error.
367 (scm_prinport): remove MSDOS hair.
368 (scm_void_port): set stream to 0 instead of SCM_BOOL_F.
369 (scm_close_port): don't throw errors: do it in fports.c.
370
15631a33
MD
3711999-06-04 Mikael Djurfeldt <mdj@mdj-pc.nada.kth.se>
372
373 * numbers.c: Added #include "feature.h".
374
b88c9601
MD
3751999-05-23 Mikael Djurfeldt <mdj@barbara.nada.kth.se>
376
377 * smob.c, smob.h (scm_make_smob_type): New interface to smob
378 types (supersedes scm_newsmob).
379 (scm_set_smob_mark, scm_set_smob_free, scm_set_smob_print,
380 scm_set_smob_equalp): New functions. Sets smob functions.
381 (SCM_NEWSMOB): New macro. Creates smob objects.
382 (scm_make_smob): New function. Creates smob objects and
383 mallocates memory.
384 (scm_smob_free, scm_smob_print): Default free and print
385 functions.
386
387 * Makefile.am: Removed markers.c, markers.x, markers.h.
388
389 * markers.c, markers.h: Removed. (Contents moved to smob.c,
390 smob.h.)
391
392 * arbiters.c, async.c, regex-posix.c: Use new smob interface.
393
394 * eval.c, fports.c, libguile.h, ports.c: Removed #include
395 "markers.h".
396
397 * fluids.c, guardians.c, srcprop.c, threads.c: Added #include
398 "genio.h".
399
400 * regex-posix.c, regex-posix.h: Renamed scm_tc16_regex_t -->
401 scm_tc16_regex.
402
7c1ce4ee
JB
4031999-05-09 Jim Blandy <jimb@savonarola.red-bean.com>
404
e7d37b0a
JB
405 * strop.c (scm_string_capitalize_x): Use the SCM object `s' in
406 error messages, not the uninitialized string `str'. Love that
407 typechecking.
408
409 * strop.c (scm_substring_move_x): New function, which can handle
410 arbitrary overlapping substrings.
411 (substring-move-left!, substring-move-right!): These are
412 now just synonyms for substring-move!.
413 * strop.h (scm_substring_move_x): New prototype.
414 (scm_substring_move_left_x, scm_substring_move_right_x):
415 #define these as synonyms for scm_substring_move_x.
416
7c1ce4ee
JB
417 Fixes, cleanups, and new functions from Greg Harvey.
418
419 1999-05-03 Greg Harvey <Greg.Harvey@thezone.net>
420
421 * strop.c (scm_string_capitalize_x, scm_string_capitalize): new
422 functions; capitalize the first letter of each word in the
423 argument string, and downcase the rest.
424 (scm_string_ci_to_symbol): string->symbol, such that the same
425 symbol is returned for any argument where the only difference
426 between strings is in capitalization.
427 (scm_string_upcase, scm_string_downcase): non-destructive
428 versions.
429
430 1999-01-13 Greg Harvey <Greg.Harvey@thezone.net>
431
432 * strop.c (scm_substring_move_left_x, scm_substring_move_right_x):
433 changed to use memmove.
434 * strop.c (scm_i_index): removed the pos arguments (it's only
435 called twice, and each time it's SCM_ARG1, SCM_ARG2, SCM_ARG3,
436 SCM_ARG4).
437
438 1999-01-11 Greg Harvey <Greg.Harvey@thezone.net>
439
440 * strop.h: fixed prototypes.
441
e7d37b0a 442 * strop.c (scm_substring_move_left_x, scm_substring_move_right_x):
7c1ce4ee
JB
443 changed to have 5 required args, rather than 2 required, and 3 required
444 rest args. Also modified to allow str1 & str2 to overlap.
445 (scm_substring_fill_x): changed to 4 args, rather than 2 args and
446 2 required rest args.
447
b7e13f65
JB
4481999-05-02 Jim Blandy <jimb@savonarola.red-bean.com>
449
450 * procs.h: Doc fix.
451
452 * Makefile.am (modinclude_HEADERS): Add kw.h, so the new version
453 gets installed.
454 * Makefile.in: Regenerated.
455
456 * numbers.c: If we're supporting floating-point, provide the
457 feature "inexact".
458
459 * scmconfig.h.in: Regenerated; see today's change to
460 ../configure.in.
461
ef0615e4
JB
4621999-04-17 Jim Blandy <jimb@savonarola.red-bean.com>
463
cceae55d
JB
464 * Makefile.in: Regenerated.
465
ef0615e4 466 Remove readline support, to avoid copyright confusion.
cceae55d 467 * Makefile.am: Remove readline files from lists.
ef0615e4
JB
468 * init.c: Don't initialize readline.
469 * scmconfig.h.in: Regenerated.
470
471 * numbers.c (s_bignum): Renamed to s_bignum, and made static.
472 Libguile should not be exporting random little strings.
473 * numbers.h (s_bignum): Extern declaration removed.
474
475 More const changes from Ken Raeburn.
476 * numbers.c (scm_s_bignum, fx): Now const.
477 (scm_logtab, scm_ilentab, s_adjbig): Now static and const.
478 * numbers.h (scm_s_bignum): Update declaration.
479 * eval.c (bodycheck): Argument WHAT now points to const.
480 * snarf.h (SCM_SYNTAX): Name is const.
481
482 * eval.c (scm_i_let): Make this globally visible, to avoid dynamic
483 linking crashes on NetBSD. (Thanks to Ken Raeburn.)
484
488325ae
MD
4851999-03-26 Mikael Djurfeldt <mdj@mdj.nada.kth.se>
486
487 * numbers.c (isfinite): Define this macro if not defined: Return a
488 non-zero value if X is finite. (From ISO C 9x standard.)
489 (scm_inexact_to_exact): Bugfix: Don't pass NaNs to scm_dbl2big.
490 (Thanks to Jon Trowbridge and Greg Harvey.)
491
e7367a17
MD
4921999-03-22 Mikael Djurfeldt <mdj@barbara.nada.kth.se>
493
494 * keywords.c (scm_tc16_kw): Added for backward compatibility.
495 Will be removed in next release.
496
497 * Makefile.am (modinclude_HEADERS): Added kw.h;
498
499 * kw.h: New file.
500
501 * libguile.h: #include "libguile/kw.h"
502
46d83025
MD
5031999-03-22 Mikael Djurfeldt <mdj@mdj.nada.kth.se>
504
505 * pairs.c (scm_set_car_x, scm_set_cdr_x): Return SCM_UNSPECIFIED.
506
e059c0b7
MD
5071999-03-21 Mikael Djurfeldt <mdj@mdj.nada.kth.se>
508
437bc84d
MD
509 * print.c (scm_isymnames): Added #@dispatch and #@hash-dispatch.
510
e059c0b7
MD
511 * hashtab.c, hashtab.h (scm_hash_fold, scm_internal_hash_fold):
512 Place the table argument last.
513
7e68f448
MD
5141999-03-19 Mikael Djurfeldt <mdj@barbara.nada.kth.se>
515
516 * modules.c: #include "procprop.h"
517 (scm_system_module_env_p): Assume root environment is no lookup
518 closure is found.
519
4177648e
MD
520 * debug.c, eval.c, evalext.c, gdbint.c stacks.c:
521 #include "modules.h".
7e68f448
MD
522
523 * modules.c, modules.h, eval.c, eval.h (scm_env_top_level,
524 scm_top_level_env, scm_system_module_env_p): Moved to modules.c.
525
526 * eval.c, eval.h (scm_top_level_lookup_closure): Removed.
527
cd713a06
MD
5281999-03-18 Mikael Djurfeldt <mdj@barbara.nada.kth.se>
529
530 * error.c (scm_wta): Pass SCM_LIST1 (arg) instead of SCM_EOL to
531 scm_misc_error when pos is a string. This allows for dispatching
532 arbitrary error messages with one argument via SCM_ASSERT:
533 SCM_ASSERT (<cond>, obj, "Undigestable object: %S", <subr>);
534
64af44a3
MD
5351999-03-17 Mikael Djurfeldt <mdj@barbara.nada.kth.se>
536
537 * list.c (scm_reverse): Report an error if given a circular list
538 instead of filling memory.
539 * list.c (scm_reverse_x): Check args.
540
6ee350ad
MD
5411999-03-14 Mikael Djurfeldt <mdj@barbara.nada.kth.se>
542
543 Most of this batch of changes is about how to deal with extended
544 types when an object system is loaded into Guile. A nice object
545 system is capable of representing Guile's types as class objects.
546
547 For example, we want a regular expression to be of class <regex>.
548 But regular expressions are smobs which aren't under direct
549 control of the object system, so there has to be some mechanism
550 which informs the object system that a new class should be created
551 which can represent the smob type. I call this a "wrapper class".
552
553 * objects.c: #include "smob.h";
554 (scm_class_keyword): Removed. (Class is automatically created by
555 make_smob_classes.)
556 (scm_smob_class): Array of smob classes indexed by smobnum.
557 (scm_make_extended_class): "Plugin" function pointer for creation
558 of wrapper classes for smob and struct types.
559 (scm_class_of): Handle compiled closures. (Currently regarded as
560 <procedure>.);
561 Use scm_smob_class to handle smob types;
562 Handle scm_tc16_bigpos, scm_tc16_bigneg, and, scm_tc16_keyword
563 through scm_smob_class;
564 Handle structs.
565
566 * smob.c (scm_newsmob): Also create a wrapper class if
567 scm_smob_class has been initialized.
568
569 * smob.h (SCM_TC2SMOBNUM): New macro for conversion between tc16
570 type code and smobnum.
571
572 * struct.c: #include "alist.h", "weaks.h", "hashtab.h";
573 (scm_struct_table): Weak key table with auxilliary information for
574 struct types. Currently used for names and wrapper classes.
575 (scm_struct_ihashq): Hash function for structs.
576 (scm_struct_create_handle): Get/create entry in scm_struct_table.
577 (scm_struct_vtable_name, scm_set_struct_vtable_name_x): Procedures
578 for accessing names of vtables. The record implementation in
579 boot-9.scm currently uses the setter to record the name of record
580 types. When the object system is initialized, it can use this
581 information to create wrapper classes with suitable names.
582 (scm_init_struct): Allocate scm_struct_table.
583 (scm_alloc_struct): Don't initialize scm_struct_i_tag here.
584 (struct tags are a finite resource and we might want to restrict
585 the use of tags to vtables only. E.g., Goops only uses tags for
586 classes.)
587 (scm_make_struct): Use scm_struct_entity_n_extra_words instead of
588 magic number 5.
589 (scm_struct_vtable_tag): Use scm_struct_i_tag instead of magic
590 number -1.
591
592 * struct.h (SCM_STRUCT_TABLE_NAME, SCM_SET_STRUCT_TABLE_NAME,
593 SCM_STRUCT_TABLE_CLASS, SCM_SET_STRUCT_TABLE_CLASS): New macros.
594 Used for access of struct table entries.
595
596 * hashtab.c, hashtab.h (scm_internal_hash_fold): New function.
597 (scm_hash_fold): New procedure. Used to process all entries in a
598 hash table (in no particular order).
599
600 Argh! For the umpteenth time I got compilation errors because of
601 the "intuitive" name `kw'. This has to have an end:
602
603 * Makefile.am, init.c, libguile.h, objects.c, root.h: Replaced
604 "kw" --> "keywords" everywhere.
605 (I doubt that this will cause big compatibility problems since the
606 application interface is unaffected.)
607
608 * keywords.c, keywords.h: Files renamed from kw.c, kw.h.
609
71c7d7d6
MD
6101999-03-12 Mikael Djurfeldt <mdj@mdj.nada.kth.se>
611
efdfceea
MD
612 * srcprop.c (scm_set_source_property_x): Bugfix: Convert line and
613 column inums to native form.
614
71c7d7d6
MD
615 Improvement of backtraces: Introduces a new stack narrowing
616 specifier, #t, for the inner cut. (See further in the comments in
617 stacks.c:narrow_stack ().)
618
619 * procprop.c, procprop.h (scm_sym_system_procedure): New symbol.
620 (Used to flag certain system procedures which shouldn't turn up in
621 backtraces.)
622
623 * eval.c (scm_sym_system_module): New symbol. (Used to flag
624 modules which aren't "user" modules and the code of which
625 shouldn't turn up in backtraces.)
626
627 * eval.c, eval.h (scm_top_level_lookup_closure): New function:
628 Extract the lookup closure from an environment.
629 (scm_system_module_env_p): New function: Return non-#f if MODULE
630 is a system module.
631
632 * stacks.c: #include "eval.h"; #include "procprop.h";
633 (narrow_stack): Handle new narrowing specifier #t.
634
635 * debug.c (scm_procedure_name): Use name property in the default
636 case.
fde61308
MD
637
638 * gc.c, gc.h (scm_object_address): Renamed from scm_object_addr ().
639
640 * objects.h (scm_si_redefined, scm_si_hashsets): Shifted.
641
642 * eval.c, procs.c, procs.h, procprop.c: Renamed getter ->
643 procedure throughout.
644
645 * print.c (scm_iprin1): Removed extraneous space when printing
646 procedure-with-setters.
647
648 Entity and operator setter slots were introduced as a complement
649 to the <procedure-with-setter> type in order to support entities
650 and operators with setters in a reasonable and efficient way.
651 * procs.c (scm_procedure, scm_setter): Handle entity and operator
652 setter slots.
653
654 * objects.h (SCM_OPERATOR_SETTER, SCM_ENTITY_SETTER): New macros.
655 (struct scm_metaclass_operator): New setter slot.
656
657 * gc.c (scm_gc_mark): Mark struct setter slot.
658
659 * struct.c (scm_make_struct): Allocate one word more for
660 entities and initialize the new slot.
661
662 * struct.h (scm_struct_i_setter): New constant.
663
963561f7
MD
6641999-03-08 Mikael Djurfeldt <mdj@barbara.nada.kth.se>
665
fde61308
MD
666 * objects.h (SCM_OBJ_CLASS_REDEF): New macro: Find class slots
667 directly through the instance.
668
669 * objects.c (scm_class_of): Use SCM_OBJ_CLASS_REDEF.
670
671 * gc.c (scm_gc_sweep): Bugfix: Look for SCM_STRUCT_F_LIGHT flag at
672 scm_struct_i_flags instead of scm_vtable_index_layout!
673
674 * list.c (scm_list_star): New procedure.
675
963561f7
MD
6761999-02-19 Mikael Djurfeldt <mdj@barbara.nada.kth.se>
677
fde61308
MD
678 * debug.c (scm_init_debug): Added scheme level constant
679 SCM_IM_DISPATCH.
680
963561f7
MD
6811999-02-12 Jim Blandy <jimb@savonarola.red-bean.com>
682
683 * __scm.h (SCM_FENCE): Fix `asm volatile' warnings for EGCS.
684
685 * gc.c (scm_gc_sweep): Properly properly record the size of a
686 freed structure. (Thanks to Greg Harvey.)
687
6881999-02-07 Jim Blandy <jimb@savonarola.red-bean.com>
689
690 * gc.c (scm_gc_sweep): Properly record the size of a freed
691 structure. (Thanks to Michael Livshin.)
692
6931999-02-06 Jim Blandy <jimb@savonarola.red-bean.com>
694
695 Readline paren matching from Greg Harvey, with modifications from
696 Mikael Djurfeldt:
697
698 * readline.c (in_readline, reentry_barrier_mutex): Make these
699 static.
700
701 * readline.c: #include <sys/time.h> and "iselect.h", so we can
702 control how long we're paused, and threads will run while we're
703 paused.
704 (match_paren, find_matching_paren, init_bouncing_parens): New
705 functions.
706 (scm_init_readline): Call init_bouncing_parens.
707 (scm_readline_opts): Add the bounce-parens option.
708 * readline.h (SCM_READLINE_BOUNCE_PARENS): New readline option.
709 (SCM_N_READLINE_OPTIONS): Adjust.
710
7111999-02-06 Jim Blandy <jimb@zwingli.cygnus.com>
712
713 All the below are changes from Ken Raeburn, to get Guile to use
714 const where it can.
715
716 * chars.c (scm_lowers, scm_uppers, scm_charnames, scm_charnums),
717 eval.c (s_expression, s_test, s_body, s_bindings, s_variable,
718 s_clauses, s_formals): Variables now const.
719
720 * eval.c (promsmob): Now const.
721 * macros.c (macrosmob): Now const.
722 * smob.c (scm_newsmob): Smobfuns argument now points to const.
723 (freecell, flob, bigob): Now const.
724
725 * dynl.c (scm_make_argv_from_stringlist, scm_coerce_rostring),
726 error.c (scm_error, scm_syserror, scm_syserror_msg,
727 scm_num_overflow, scm_out_of_range, scm_wrong_type_arg,
728 scm_memory_error, scm_misc_error, scm_wta), macros.c
729 (scm_make_synt), feature.c (scm_add_feature), filesys.c
730 (scm_input_waiting_p), gc.c (scm_gc_start, scm_igc,
731 scm_must_malloc, scm_must_realloc), gsubr.c (scm_make_gsubr),
732 numbers.c (scm_num2dbl, scm_two_doubles, scm_num2long,
733 scm_num2long_long, scm_num2ulong),
734 options.c (scm_options), posix.c (scm_convert_exec_args,
735 environ_list_to_c), procs.c (scm_make_subr_opt, scm_make_subr),
736 ramap.c (scm_ramapc), read.c (scm_flush_ws), socket.c
737 (scm_sock_fd_to_port, scm_fill_sockaddr, scm_addr_vector), stime.c
738 (setzone, restorezone, bdtime2c), strop.c (scm_i_index),
739 strports.c (scm_mkstrport), symbols.c (scm_intern_obarray_soft,
740 scm_intern_obarray, scm_intern, scm_intern0,
741 scm_sysintern0_no_module_lookup, scm_sysintern, scm_sysintern0,
742 scm_symbol_value0), unif.c (scm_aind, scm_shap2ra): Argument
743 indicating calling subr, error message text, reason for error,
744 symbol name or feature name are now pointer to const.
745 * snarf.h (SCM_PROC, SCM_PROC1): String variables are now const.
746
747 * procs.c (scm_init_iprocs): iproc argument now points to const.
748 * pairs.c (cxrs): Now const.
749
750 * chars.h, error.h, feature.h, filesys.h, gc.h, gsubr.h, macros.h,
751 numbers.h, options.h, procs.h, ramap.h, read.h, smob.h,
752 strports.h, symbols.h, unif.h: Update variable declarations and
753 function prototypes for above changes.
754
755 * dynl.c, dynl-dld.c, dynl-dl.c, dynl-shl.c (sysdep_dynl_link,
756 sysdep_dynl_unlink, sysdep_dynl_func): Arguments FNAME, SUBR, and
757 SYMB now point to const.
758
7591999-01-30 Mikael Djurfeldt <mdj@mdj.nada.kth.se>
760
fde61308
MD
761 * print.c (scm_iprin1): Use scm_procedure_name instead of
762 scm_procedure_property for compiled closures.
763
764 * tags.h (scm_tc7_pws): New procedure type. Four representations
765 for procedure-with-setters were considered before selecting this
766 one:
767
768 1. A closure where the CODE and ENV slots are used to represent
769 the getter and a new SETTER slot is used for the setter. The
770 original getter is stored as a `getter' procedure property. For
771 closure getters, the CODE and ENV slots contains a copy of the
772 getter's CODE and ENV slots. For subr getters, the CODE contains
773 a call to the subr.
774
775 2. A compiled closure with a call to the getter in the cclo
776 procedure. The getter and setter are stored in slots 1 and 2.
777
778 3. An entity (i.e. a struct with an associated procedure) with a
779 call to the getter in the entity procedure and the setter stored
780 in slot 0. The original getter is stored in slot 1.
781
782 4. A new primitive procedure type supported in the evaluator. The
783 getter and setter are stored in a GETTER and SETTER slot. A call
784 to this procedure type results in a retrieval of the getter and a
785 jump back to the correct eval dispatcher.
786
787 Representation 4 was selected because of efficiency and
788 simplicity.
789
790 Rep 1 has the advantage that there is zero penalty for closure
791 getters, but primitive getters will get considerable overhead
792 because the procedure-with-getter will be a closure which calls
793 the getter.
794
795 Rep 3 has the advantage that a GOOPS accessor can be a subclass of
796 <procedure-with-setter>, but together with rep 2 it suffers from a
797 three level dispatch for non-GOOPS getters:
798
799 cclo/struct --> dispatch proc --> getter
800
801 This is because the dispatch procedure must take an extra initial
802 argument (cclo for rep 2, struct for rep 3).
803
804 Rep 4 has the single disadvantage that it uses up one tc7 type
805 code, but the plan for uniform vectors will very likely free tc7
806 codes, so this is probably no big problem. Also note that the
807 GETTER and SETTER slots can live directly on the heap, using the
808 new four-word cells.
809
810 * procs.c, procs.h (SCM_PROCEDURE_WITH_SETTER_P, SCM_GETTER,
811 SCM_SETTER): New macros.
812 (scm_procedure_with_setter_p, scm_make_procedure_with_setter,
813 scm_getter, scm_setter): New procedures.
814
815 * eval.c, print.c (scm_iprin1): Added entries for scm_tc7_pws.
816
817 * gc.c (scm_gc_mark, scm_gc_sweep): Added case labels for
818 scm_tc7_pws.
819
820 * objects.c, objects.h (scm_class_of,
821 scm_class_procedure_with_setter): Added.
822
823 * procprop.c (scm_i_procedure_arity), procs.c (scm_thunk_p): Added
824 entry for scm_tc7_pws.
825
826 * procs.c (scm_procedure_p): Added case label for scm_tc7_pws.
827
963561f7
MD
8281999-01-28 Mikael Djurfeldt <mdj@mdj.nada.kth.se>
829
fde61308
MD
830 * evalext.c, evalext.h (scm_m_generalized_set_x): New memoizing
831 macro.
832 (scm_init_evalext): Call scm_make_gsubr for
833 scm_m_generalized_set_x.
834
835 * eval.c, debug.c, tags.h (SCM_IM_SET_X): Renamed from SCM_IM_SET.
836
837 * eval.h: Declare scm_s_set_x, scm_sym_set_x;
838
839 * eval.c: Renamed "set" --> "set_x" in various names for
840 consistency of name correspondence between Scheme and C;
841 Renamed scm_i_set_x --> scm_sym_set_x and made global.
842 Renamed s_set_x --> scm_s_set_x and made global.
843
963561f7
MD
8441999-01-26 Mikael Djurfeldt <mdj@mdj.nada.kth.se>
845
fde61308
MD
846 * random.c (scm_i_random_bignum): Made independent of endianness.
847
963561f7
MD
8481999-01-22 Mikael Djurfeldt <mdj@mdj.nada.kth.se>
849
fde61308
MD
850 * eval.c (SCM_CEVAL): Added ENTER_APPLY in code for SCM_IM_APPLY.
851 (Thanks to Eric Hanchrow.)
852
963561f7
MD
8531999-01-21 Mikael Djurfeldt <mdj@mdj.nada.kth.se>
854
fde61308
MD
855 * objects.c, objects.h (SCM_CLASS_REDEF): Renamed from CLASS_REDEF.
856
857 * random.c: Bugfix: Retrieve and store most significant 32 bits in
858 different order if the machine is bigendian.
859 (scm_init_random): Added safety check for bignum digit size.
860
ec1bbf39
MD
8611999-01-21 Mikael Djurfeldt <mdj@barbara.nada.kth.se>
862
863 * random.c, random.h (scm_i_make_rstate): New function: Makes
864 scm_rstate from seed.
865 (scm_copy_random_state, scm_seed_to_random_state): New functions.
866 (scm_make_random_state): Removed.
867
868 * random.c (scm_make_random_state): Use scm_i_make_rstate().
869
efe5e0ef
MD
8701999-01-21 Mikael Djurfeldt <mdj@mdj.nada.kth.se>
871
872 * random.c: Bugfix: Retrieve and store most significant 32 bits in
873 different order if the machine is bigendian.
874 (scm_init_random): Added safety check for bignum digit size.
875
a40bd532
MD
8761999-01-11 Roland Orre <mdj@mdj.nada.kth.se>
877
878 * sort.c (scm_merge, scm_merge_list_x): Bugfix: Place elements
879 from first arg before equal elements in second arg in result.
880 (scm_merge_list_step): Bugfix: Don't presume that arguments in a C
881 function call are executed in a well defined order.
882
94baa3b2
JB
8831999-01-11 Jim Blandy <jimb@zwingli.cygnus.com>
884
885 * alloca.c (alloca): Cast value returned by malloc. (Thanks to
886 Christian Lynbech.)
887
922363f5
MD
8881999-01-11 Mikael Djurfeldt <mdj@mdj.nada.kth.se>
889
890 * random.c: Removed alloca includes.
891
f7677ff2
JB
8921999-01-11 Jim Blandy <jimb@zwingli.cygnus.com>
893
894 * Makefile.in: This changed, for some reason I don't really
895 understand, when I ran automake in the top level directory. This
896 may be contamination by Cygnus internal releases. If you re-run
897 automake and this change gets reverted, don't worry about it.
898
7a5bee23
MD
8991999-01-10 Mikael Djurfeldt <mdj@barbara.nada.kth.se>
900
901 * sort.c, sort.h: New files: Implement slib's and scsh's sort
f7677ff2 902 interfaces. Author: Roland Orre.
7a5bee23
MD
903
904 * Makefile.am: Added sort.c, sort.h, sort.x.
905
906 * init.c: #include "sort.h";
907 (scm_boot_guile_1): Call scm_init_sort ().
908
909 * numbers.h: Added #include "libguile/print.h".
910
911 * numbers.c: Formatted according to Guile conventions;
912 Renamed s_bignum --> scm_s_bignum.
913
914 * random.c, random.h: New files: Random number support.
915 Interface same as slib's.
916
917 * Makefile.am: Added random.c, random.h, random.x.
918
919 * init.c: #include "random.h";
920 (scm_boot_guile_1): Call scm_init_random ().
921
0c03eafd
MD
9221998-12-23 Mikael Djurfeldt <mdj@barbara.nada.kth.se>
923
924 * Makefile.am: New files: guardians.c, guardians.x, guardians.h
925
926 * guardians.c, guardians.h (scm_make_guardian,
927 scm_guardian_gc_init, scm_guardian_zombify, scm_guard,
928 scm_get_one_zombie, scm_init_guardian): This is an implementation
929 of guardians as described in R. Kent Dybvig, Carl Bruggeman, and
930 David Eby (1993) "Guardians in a Generation-Based Garbage
931 Collector" ACM SIGPLAN Conference on Programming Language Design
932 and Implementation, June 1993 ftp://ftp.cs.indiana.edu
933 /pub/scheme-repository/doc/pubs/guardians.ps.gz
934 Author: Michael N. Livshin.
935
936 * gc.h (SCM_MARKEDP, SCM_NMARKEDP): New macros.
937
938 * gc.c (scm_igc): Call scm_guardian_gc_init and
939 scm_guardian_zombify.
940
941 * init.c (scm_boot_guile_1): Call scm_init_guardian.
942
d0c2c0c0
MD
9431998-12-19 Mikael Djurfeldt <mdj@barbara.nada.kth.se>
944
945 * macros.c (scm_makacro, scm_makmacro, scm_makmmacro): Added
946 argument checking.
947
7f0a6a69
MD
9481998-12-15 Mikael Djurfeldt <mdj@barbara.nada.kth.se>
949
950 Move the procedure slots of entities to invisible slots (so that
951 we can have operator class objects which themselves are entities).
952 * struct.h (scm_struct_i_proc, scm_struct_i_flags,
953 SCM_STRUCTF_ENTITY): New constants.
954
955 * struct.c (scm_make_struct): Allocate "invisible" room for
956 procedures if SCM_STRUCTF_ENTITY is set in vtable.
957
958 * gc.c (scm_gc_mark): Mark entity procedures.
959
960 * struct.c, struct.h (scm_alloc_struct): Renamed from alloc_struct
961 and made global.
962 (scm_struct_init): Renamed from init_struct and made global.
963
964 * objects.h (SCM_ENTITY, scm_entity): Removed.
965 (SCM_ENTITY_PROC_0, SCM_ENTITY_PROC_0, SCM_ENTITY_PROC_0,
966 SCM_ENTITY_PROC_3): Adjusted for new location of procedure slots.
967
b8229a3b
MS
968Mon Dec 14 18:10:12 1998 Maciej Stachowiak <mstachow@mit.edu>
969
970 * snarf.h (SCM_SYNTAX): New macro to allow convenient declaration
971 of syntactic forms, similar to SCM_PROC.
972 * debug.c, eval.c, evalext.c: use SCM_SYNTAX to declare all special
973 forms, and SCM_SYMBOL or SCM_GLOBAL_SYMBOL to delcare C variables
974 for the name symbols when needed.
975
333a4791
JB
9761998-12-14 Jim Blandy <jimb@zwingli.cygnus.com>
977
978 * Makefile.in: Regenerated.
979
715fad68
JB
9801998-12-05 Jim Blandy <jimb@zwingli.cygnus.com>
981
982 * pairs.h (SCM_NEWCELL): When DEBUG_FREELIST is defined, don't
983 take the address of _into; it might be a register. Just have
984 scm_debug_newcell return the new cell.
985 * gc.c (scm_debug_newcell): Just return the new cell, instead of
986 taking the address of a place to store it as an argument.
987 * gc.h (scm_debug_newcell): Change declaration.
988 (Thanks to Greg Harvey.)
989
67ad463a
MD
9901998-12-08 Mikael Djurfeldt <mdj@barbara.nada.kth.se>
991
992 * ramap.c (array-copy-in-order!, array-map-in-order): New names.
993 Replaces old names serial-array-copy! and serial-array-map!.
994
995 * evalext.c (map-in-order): New name. Replaces serial-map.
996
67ea079d
JB
9971998-12-05 Jim Blandy <jimb@totoro.red-bean.com>
998
999 * smob.c (freeprint): New function.
1000 (freecell): Use it to print freed objects, for slightly easier
1001 debugging.
1002
6ab397f4
MD
10031998-12-04 Mikael Djurfeldt <mdj@mdj.nada.kth.se>
1004
1005 * backtrace.c (display_frame): Made more robust. Doesn't throw an
1006 error if no source properties can be found for a frame. (Thanks
1007 to Christian Lynbech.)
1008
afae5cbd
MD
10091998-11-27 Mikael Djurfeldt <mdj@mdj.nada.kth.se>
1010
1011 * objects.h: Removed slots direct_supers and direct_slots from the
1012 definitions of the rudimentary classes described by objects.h.
1013
1014 * objects.c, objects.h (scm_entity_p): New procedure. Together
1015 with the predicates scm_procedure_p and scm_struct_p, this
1016 predicate makes it possible to differ between structs, entities
1017 and operators.
1018
1019 * modules.c, modules.h (scm_resolve_module): New function.
1020
3763ac3c
MD
10211998-11-26 Mikael Djurfeldt <mdj@mdj.nada.kth.se>
1022
afae5cbd
MD
1023 * objects.h (SCM_METACLASS_STANDARD_LAYOUT,
1024 SCM_METACLASS_OPERATOR_LAYOUT): Removed slots `direct_supers' and
1025 `direct_slots'.
1026
1027 * objects.c (scm_entity_p): New procedure.
1028
3763ac3c
MD
1029 * procprop.c (scm_i_procedure_arity): Bugfix: Return correct value
1030 for asubrs, rpsubrs, lsubrs and lsubr_2s.
1031
0d2e4c1b
MD
10321998-11-26 Mikael Djurfeldt <mdj@barbara.nada.kth.se>
1033
1034 * procprop.h (scm_i_procedure_arity): Added declaration.
1035
1036 * procprop.c (scm_i_procedure_arity): Made global; New code to
1037 handle operators and entities.
1038 (scm_procedure_property): No need to call scm_procedure_p since
1039 scm_i_procedure_arity now does all necessary type checking.
1040 Added #include "objects.h".
1041
1042 * feature.c (scm_remove_hook_x): Bugfix: Changed reference to
1043 s_add_hook_x --> s_remove_hook_x.
1044 (scm_add_hook_x, scm_remove_hook_x): Hooks now takes arguments.
1045 Added #include "procprop.h"
1046
1047 * feature.c, feature.h (scm_reset_hook_x): New procedure.
1048 (scm_make_hook): Optional argument defines number of arguments to
1049 the hook.
1050 (scm_make_named_hook): Take number of args as second arg.
3763ac3c
MD
1051 (scm_run_hook): Renamed from scm_run_hooks (old name defined in
1052 boot-9.scm for a while); First arg is the hook. The rest are
1053 arguments passed on to the hook procedures.
0d2e4c1b 1054
69c6acbb
JB
10551998-11-23 Jim Blandy <jimb@zwingli.cygnus.com>
1056
1057 * numbers.c (scm_logand, scm_logior, scm_logxor, scm_logtest,
1058 scm_logbit_p): Do the computation in ulongs. This is not as nice
1059 as doing it in bignums, but at least it's good enough for
1060 manipulating flags in 32-bit words. (Thanks to Jim Wilson.)
1061
1062 * regex-posix.c (scm_regexp_exec): Reliably mark unmatched
1063 subexpressions. (Thanks to Charbel Jacquin.)
1064
a56eeb46
MD
10651998-11-23 Mikael Djurfeldt <mdj@kenneth>
1066
1067 * feature.c, feature.h (scm_make_hook, scm_add_hook_x,
1068 scm_remove_hook_x, scm_run_hooks): Moved from ice-9/boot-9.scm.
1069 (scm_make_named_hook): New function.
1070
1071 * feature.c: Added #include "eval.h".
1072
1073 * modules.c (scm_make_module): Beautify the module.
1074
7e414627
MD
10751998-11-22 Mikael Djurfeldt <mdj@barbara.nada.kth.se>
1076
1077 * modules.c, modules.h: New files: C interface to modules. (This
1078 is necessary in order to interface the object system to Guile
1079 properly. The guts of these modules will be replaced by the new
1080 module system in the future.)
1081
1082 * init.c: Added #include "modules.h"
1083 (scm_boot_guile_1): Call scm_init_modules.
1084 (invoke_main_func): Call scm_post_boot_init_modules.
1085
1086 * Makefile.am: Added modules.c, modules.x, modules.h.
1087
17621f3e
MD
10881998-11-22 Mikael Djurfeldt <mdj@kenneth>
1089
1090 * procs.c: #include "objects.h"
1091 (scm_procedure_p): Return #t also on structs which are operators.
1092
1093 * objects.c (scm_init_objects): Renamed <standard-metaclass>,
1094 <operator-metaclass> and <entity-class> to <standard-class>,
1095 <operator-class> and <entity> in order to conform with STKlos
1096 naming conventions.
1097
1098 * eval.c (SCM_CEVAL): Jump to badfun if trying to apply a struct
1099 which isn't an operator.
1100 (SCM_APPLY): Ditto, but jump to badproc.
1101
aa00bd1e
MD
11021998-11-21 Mikael Djurfeldt <mdj@kenneth>
1103
1104 * eval.c (SCM_CEVAL): Allow structs implanted in code.
1105 Previously, structs implanted in code were interpreted as forms
1106 the operator of which was a gloc. We solve this by checking for
1107 the zero in the emulated vcell in the struct vtable. Since
1108 implanted structs always will look like forms with a gloc
1109 operator, execution will only be slowed down by maximally one
1110 extra test-and-branch per application.
1111
1112 * evalext.c (scm_definedp): Removed check for isyms; Added a
1113 second optional argument: It is now possible to supply an
1114 evaluation environment in which to look for the symbol.
1115
b322f09a
MD
11161998-11-19 Mikael Djurfeldt <mdj@mdj.nada.kth.se>
1117
1118 * readline.c (scm_init_readline): Set
1119 rl_basic_word_break_characters. (Thanks to Ian Grant.)
1120
1121 * coop.c (coop_condition_variable_wait): Removed
1122 (coop_condition_variable_wait_mutex): Folded logic of
1123 coop_mutex_unlock into coop_condition_variable_wait_mutex to
1124 prevent condvar signal lossage. Previously, another thread could
1125 start to run after unlocking the mutex but before putting the
1126 current thread on the wait queue. If that thread then would
1127 signal the first, the signal would be lost. (Thanks to Christian
1128 Lynbech.)
1129
224822be
MD
11301998-11-17 Mikael Djurfeldt <mdj@mdj.nada.kth.se>
1131
1132 * eval.c (SCM_CEVAL): Added missing case for cclo. (Thanks to
1133 Christian Lynbech.)
1134
036737fc
MD
11351998-11-14 Mikael Djurfeldt <mdj@barbara.nada.kth.se>
1136
1137 * objects.c (scm_i_make_class_object): Renamed from
1138 make_class_object; exported; error checking moved to
1139 scm_make_class_object and scm_make_subclass_object.
1140 (scm_make_class_object, scm_make_subclass_object): Use
1141 scm_i_make_class_object.
1142 (scm_make_subclass_object): Let the subclass have same metaclass
1143 as the superclass.
1144
a6e350dd
MD
11451998-11-14 Mikael Djurfeldt <mdj@mdj.nada.kth.se>
1146
1147 * debug.c (scm_debug_options): Bugfix: Set the value of
1148 scm_stack_checking_enabled_p after setting debug options;
1149 #include "stackchk.h". (Thanks to Richard Polton.)
1150
9879d0f1
RS
11511998-11-13 Radey Shouman <rshouman@metro2000.com>
1152
1153 * unif.c (scm_array_contents): removed unnecessary test for 0
1154 base.
1155
88be72ac
MD
11561998-11-13 Mikael Djurfeldt <mdj@barbara.nada.kth.se>
1157
1158 * evalext.c, evalext.h (scm_m_sequence_to_list): Removed.
1159 Replaced by macro `collect' in boot-9.scm.
1160
ad3ff75b
MD
11611998-11-10 Mikael Djurfeldt <mdj@barbara.nada.kth.se>
1162
1163 * eval.c (scm_copy_tree): Copy source properties if existent.
1164
1165 * debug.c (scm_start_stack): Copy source when evaluating. (If we
1166 don't, we may end up passing memoized source to a transformer.)
1167
29672a5c
MD
11681998-11-10 Mikael Djurfeldt <mdj@mdj.nada.kth.se>
1169
7a13c3ae
MD
1170 * stack.c (get_applybody): Help function which lookups the first
1171 body form of the apply closure.
1172 (read_frames): Prevent the source of the first form of the apply
1173 closure from being recorded. This would only be confusing.
e40a5fc8 1174
29672a5c
MD
1175 * debug.h (SCM_SET_MACROEXP, SCM_CLEAR_MACROEXP, SCM_MACROEXPP):
1176 Replaces SCM_MACROFRAME, SCM_MACROFRAMEP.
1177
1178 * eval.c (SCM_CEVAL): Use SCM_SET/CLEAR_MACROEXP.
1179
1180 * stacks.c (read_frame): Bugfix: Removed lingering `else'
1181 statement.
1182 (read_frames): Use SCM_MACROEXPP.
1183
56977059 11841998-11-10 Mikael Djurfeldt <mdj@barbara.nada.kth.se>
7c939801
MD
1185
1186 * stacks.c (read_frames): Skip gsubr frames in backtraces. (They
1187 don't contain interesting information since all arguments are
1188 present in the frame which applies the compiled closure anyway.);
1189 Skip the transformer application frames.
56977059
MD
1190
1191 * print.c (scm_iprin1): Print gsubrs as primitives.
1192
fc4c5795
MD
11931998-11-09 Mikael Djurfeldt <mdj@barbara.nada.kth.se>
1194
1195 * debug.h (SCM_MACROFRAME, SCM_MACROFRAMEP): New frame type.
1196
1197 * eval.c (SCM_CEVAL): Mark macro frames at `handle_a_macro' so
1198 that we can identify these in a backtrace. (This change doesn't
1199 introduce any significant speed penalty.)
1200
1201 * eval.c: Added note about `serial-map' using scm_map.
1202
1203 * read.c, read.h (scm_read_options, scm_read_opts): Removed
1204 readline options. They should reside in their own options array.
1205
1206 * readline.c, readline.h (scm_readline_options,
1207 scm_readline_opts): Moved readline options here.
1208
68d15e3e
MD
12091998-11-07 Mikael Djurfeldt <mdj@barbara.nada.kth.se>
1210
1211 * readline.c (scm_read_history, scm_write_history): Bugfix: Use
1212 SCM_ROCHARS instead of SCM_CHARS.
1213
1214 * ports.c (scm_unread_string): Bugfixes: Check for SCM_STRINGP,
1215 not SCM_ROSTRINGP; use SCM_ROUCHARS instead of SCM_UCHARS.
1216
44e0a162
MD
12171998-11-06 Mikael Djurfeldt <mdj@barbara.nada.kth.se>
1218
1219 * ports.h (SCM_CUC): #define as ~SCM_CRDY instead of 0x001fffffL.
1220 This is quite important since the latter clears the
1221 FPORT_READ_SAFE and FPORT_WRITE_SAFE flags causing flushes at
1222 every single character read...
1223
99317654
MD
12241998-11-03 Mikael Djurfeldt <mdj@barbara.nada.kth.se>
1225
1226 * print.c (scm_iprin1): Removed suspect looking (and indeed
1227 malevolent) semicolon after test for user supplied closure print
1228 procedure. (Thanks to Telford Tendys.)
1229
1230 * list.c (scm_sloppy_memq): Removed sloppy_mem_check.
1231 (scm_memq, scm_memv, scm_member): Do argument checking *before*
1232 starting to search the list. Removed call to sloppy_mem_check.
1233
1234 * list.c, list.h (scm_delq1_x, scm_delv1_x, scm_delete1_x): New
1235 procedures: Same as scm_delq_x et al, but delete maximally one
1236 element.
1237
1238 * options.c (scm_options, scm_init_options): GC-protect option
1239 values of type SCM. (Thanks to Telford Tendys.)
1240
d0b7bad7
MD
12411998-11-01 Mikael Djurfeldt <mdj@mdj.nada.kth.se>
1242
1243 * eval.c: Don't #define scm_lookupcar to scm_lookupcar1. Instead
1244 make sure that there always is a "real" scm_lookupcar.
1245
9cb84fbb
MD
12461998-11-01 Mikael Djurfeldt <mdj@barbara.nada.kth.se>
1247
69c6acbb
JB
1248 * read.c, read.h (scm_read_opts): New read options
1249 "history-length" and "history-file".
9cb84fbb
MD
1250 (scm_read_options): Stifle history to history length.
1251
69c6acbb 1252 * readline.c (scm_read_history, scm_write_history): New procedures.
9cb84fbb 1253
4ecb8428
MD
12541998-10-31 Mikael Djurfeldt <mdj@barbara.nada.kth.se>
1255
1256 * eval.h (scm_macro_eval_x): Removed declaration.
1257
1258 * eval.c (scm_s_expression, scm_s_test, scm_s_body,
1259 scm_s_bindings, scm_s_variable, scm_s_clauses, scm_s_formals):
1260 Renamed and made global.
1261
1262 * eval.c, eval.h (SCM_EVALIM): Renamed from EVALIM.
1263 (SCM_XEVAL, SCM_XEVALCAR): Renamed from XEVAL, XEVALCAR.
1264
1265 * evalext.c, evalext.h: New files. Contain non-R5RS things
1266 having to do with evaluation.
1267
fc4c5795
MD
1268 * evalext.c (scm_serial_map): New procedure: Version of `map'
1269 which guarantees that the procedure is applied to the lists in
1270 serial order.
1271 (scm_m_sequence_to_list): New syntax: Version of `begin' which
1272 returns a list of the results of the body forms instead of the
1273 result of the last body form.
4ecb8428
MD
1274 (scm_definedp, scm_m_undefine): Moved from eval.c
1275
1276 * evalext.h (scm_m_sequence_to_list): Added declaration.
1277
1278 * macros.c, macros.h: New files.
fc4c5795
MD
1279 (scm_procedure_to_syntax, scm_procedure_to_macro,
1280 scm_procedure_to_memoizing_macro, scm_macro_p, scm_macro_type,
1281 scm_macro_name, scm_macro_transformer): Moved from eval.c
4ecb8428
MD
1282 (scm_make_synt): Moved from eval.c
1283
69c6acbb 1284 * procs.c, procs.h (scm_procedure_documentation): Moved from eval.c.
4ecb8428
MD
1285
1286 * init.c (scm_boot_guile_1): Added calls to scm_init_macros and
1287 scm_init_evalext.
1288
1289 * Makefile.am: Added evalext.c, evalext.h, macros.c, macros.h.
1290
35c96965
MD
1291 * debug.c, print.c: Added #include "macros.h".
1292
4d362308
MD
12931998-10-29 Mikael Djurfeldt <mdj@barbara.nada.kth.se>
1294
1295 This change adds the ability to use `unread-char' multiple times
1296 without interspersed reads and adds the new procedure
1297 `unread-string'. The change is optimized for the common case of
1298 unreading a single character. This is also the reason behind the
1299 choice to store characters in the port itself: in most cases no
1300 extra malloc is required.
1301
1302 The amount of code in some macros in ports.h has been increased to
1303 the extent that they would fit better as C functions, but, since
1304 this code belongs to the port representation, such functions
1305 should be placed in ports.c which would cause calls back and forth
1306 between ports.c and genio.c. That is not good for performance.
1307 Also, keeping them as macros allows the compiler to do some
1308 optimizations which are needed to make the current interface
1309 (SCM_CRDYP, SCM_CGETUN, SCM_TRY_CLRDY) efficient.
1310
1311 One benchmark (Guile startup time) indicates an increase of
1312 loading speed of 1%. Another (reading (using `read') boot-9.scm
1313 10 times) shows no change in performance.
1314
1315 (Caveat: Since Gary is redesigning I/O anyway, no big efforts were
1316 made to find a beautiful solution.)
1317
1318 * ports.h (SCM_CLRDY, SCM_CUNGET, SCM_CGETUN): Rewritten.
1319 (SCM_TRY_CLRDY): New macro: Only clear the first unread
1320 character. (SCM_CLRDY clears all.)
1321 (SCM_N_READY_CHARS): New macro: Returns number of unread
1322 characters in a port. Returns wrong answer if SCM_CRDYP is false.
1323 (struct scm_port_table): New fields: `entry' contains port table
1324 index, `cp' points to last unread char, `cbuf' is the buffer for
1325 unread chars, `cbufend' points after end of the character buffer.
1326
1327 * ports.h, ports.c (scm_unread_string): New procedure.
1328 (scm_grow_port_cbuf): New function.
1329
1330 * ports.c (scm_add_to_port_table, scm_remove_from_port_table):
1331 Handle new fields.
1332 (scm_generic_fgets), fports.c (local_fgets): Use a loop
1333 to read unread characters. Use SCM_TRY_CLRDY instead of
1334 SCM_CLRDY.
1335
1336 * ioext.c (scm_ftell): Use SCM_N_READY_CHARS to correct position.
1337
1338 * genio.c (scm_getc): Use SCM_TRY_CLRDY instead of SCM_CLRDY.
1339
1340 * genio.c, genio.h (scm_ungets): New function.
1341
1342 * genio.c (scm_puts): Removed mysterious TRANSCRIPT_SUPPORT code
1343 sections.
1344
22c88b3f
MD
13451998-10-28 Mikael Djurfeldt <mdj@mdj.nada.kth.se>
1346
1347 * threads.h (scm_thread_sleep, scm_thread_usleep): Fixed
1348 declarations. (Thanks to Russ McManus.)
1349
3ffc7a36
MD
13501998-10-26 Mikael Djurfeldt <mdj@barbara.nada.kth.se>
1351
1352 * numbers.c (num2long): As a software archeologist, I'm proud of
1353 this finding! :) Preliminary dating suggests an almost 4 year old
1354 remnant from the SCM ancestor. The sample has been removed from
1355 the finding site and is now safely stored in the repository.
1356
1357 * numbers.h: Removed prototype for num2long.
1358
1359 * unif.c (scm_array_set_x): Use scm_num2long instead of num2long.
1360
1361 * gh_data.c (gh_scm2doubles): Make it possible to pass result
1362 array as second arg.
1363 (gh_chars2byvect, gh_shorts2svect, gh_floats2fvect, gh_scm2chars,
1364 gh_scm2shorts, gh_scm2longs, gh_scm2floats): New functions.
1365 * gh.h: Updated and added prototypes.
1366
1367 * gh_data.c (gh_ints2scm): Handle integers outside INUM limits.
1368
cc720f64
JB
13691998-10-24 Jim Blandy <jimb@zwingli.cygnus.com>
1370
1371 * gc.h: Remove all uses of SCM_P. (Thanks to Richard Polton.)
1372
1373 * guile-snarf.in: Never generate an empty file. (Thanks to
1374 Richard Polton.)
1375
1376 * gh.h (gh_enter, gh_new_procedure0_0, gh_new_procedure0_1,
1377 gh_new_procedure0_2, gh_new_procedure1_0, gh_new_procedure1_1,
1378 gh_new_procedure1_2, gh_new_procedure2_0, gh_new_procedure2_1,
1379 gh_new_procedure2_2, gh_new_procedure3_0, gh_new_procedure4_0,
1380 gh_new_procedure5_0): Specify argument types, to appease C++
1381 compilers. (Thanks to Brad Bowman.)
1382
1383 Bug reports from Russ McManus:
1384 * guile-snarf.in: If the CPP environment variable is set, use that
1385 as the C preprocessor, instead of the preprocessor autoconf
1386 found.
1387 * snarf.h (SCM_PROC): Cast the function pointer passed to
1388 scm_make_gsubr, to satisfy C++.
1389
1390 * gh_eval.c (gh_eval_str_with_catch, gh_eval_file_with_catch):
1391 Use the handler passed, instead of ignoring it and using
1392 gh_standard_handler. (Thanks to Etienne Bernard.)
1393
5469b4a1
JB
13941998-10-20 Jim Blandy <jimb@zwingli.cygnus.com>
1395
1396 * ports.h: Put text after #endif in comment. (Thanks to Nicolas
1397 Neuss.)
1398
f4be1689
JB
13991998-10-19 Jim Blandy <jimb@zwingli.cygnus.com>
1400
1f6fe22a
JB
1401 * __scm.h, alist.c, async.c, async.h, backtrace.h, chars.c,
1402 continuations.c, debug.c, debug.h, dynl-dl.c, dynl.c, dynl.h,
1403 dynwind.c, dynwind.h, eq.c, error.c, error.h, eval.c, eval.h,
1404 feature.c, filesys.c, filesys.h, fports.c, fports.h, gc.c, gc.h,
1405 genio.c, genio.h, gh.h, gh_data.c, gsubr.c, gsubr.h, hash.c,
1406 hashtab.c, init.c, init.h, ioext.c, ioext.h, kw.c, libguile.h,
1407 list.c, list.h, load.c, load.h, mallocs.c, markers.c,
1408 mit-pthreads.c, net_db.c, numbers.c, numbers.h, options.c,
1409 ports.c, ports.h, posix.c, posix.h, print.c, print.h, procprop.c,
1410 procprop.h, procs.c, procs.h, ramap.c, ramap.h, regex-posix.c,
1411 regex-posix.h, root.c, root.h, scmsigs.c, scmsigs.h, script.c,
1412 script.h, simpos.c, simpos.h, smob.c, smob.h, snarf.h, socket.c,
1413 srcprop.c, stackchk.c, stackchk.h, stacks.c, stime.c, stime.h,
1414 strings.c, strings.h, strports.c, struct.c, struct.h, symbols.c,
1415 symbols.h, tags.h, threads.c, throw.h, unif.c, variable.c,
1416 vectors.c, vectors.h, version.h, vports.c, weaks.c: Update
1417 copyright years.
1418
f4be1689
JB
1419 * script.c (scm_compile_shell_switches): Define
1420 use-emacs-interface in the root module, so the repl code can see
1421 it. See today's change to top-repl in ice-9/boot-9.scm.
1422
1423 * filesys.c (set_element, get_element): Make sure that `element'
1424 is a cell before applying SCM_FPORTP to it. (Thanks to Jost
1425 Boekemeier and Jorgen "forcer" Schaefer.)
1426
14271998-10-18 Jim Blandy <jimb@zwingli.cygnus.com>
1428
1429 * chars.c (scm_charnames): In ASCII character name table, make
1430 newlines print as #\newline by default, not #\nl.
1431
1432 * Makefile.am (libguile_la_SOURCES, BUILT_SOURCES): Put these in
1433 alphabetical order. Oh thrills. But it helps me know how far
1434 along in the compilation I am.
1435 * Makefile.in: Regenerated.
1436
05c33d09
MD
14371998-10-18 Mikael Djurfeldt <mdj@barbara.nada.kth.se>
1438
1439 * unif.c (scm_raprin1): Changed print syntax for byte vectors from
1440 #bytes(...) to #y(...), and syntax for short vectors from
1441 #short(...) to #h(...). This may seem nutty, but, like the other
1442 uniform vectors, byte vectors and short vectors want to have the
1443 same print and read syntax (and, more basic, want to have read
1444 syntax!). Changing the read syntax to use multiple characters
1445 after the hash sign breaks with the conventions used in R5RS and
1446 the conventions used for the other uniform vectors. It also
1447 introduces complexity in the current reader, both on the C and
1448 Scheme levels. (The Right solution is probably to change the
1449 syntax and prototypes for uniform vectors entirely.)
1450
1aab20ac
JB
14511998-10-17 Jim Blandy <jimb@savonarola.red-bean.com>
1452
1453 Don't use local_fgets on sockets; ftell doesn't work on sockets.
1454 (Thanks to Jorgen "forcer" Schaefer.)
1455 * ports.h (SCM_NOFTELL): New flag.
1456 * fports.c (local_fgets): If it's set, use the generic fgets.
1457 * socket.c (scm_socket): Set SCM_NOFTELL on the ports we produce.
1458
97c524bd
MD
14591998-10-17 Mikael Djurfeldt <mdj@barbara.nada.kth.se>
1460
1461 * script.c (scm_compile_shell_switches): Add handling of -q switch
1462 (inhibit loading of user init file).
1463 (scm_shell_usage): Add usage text for -q switch.
1464 (scm_compile_shell_switches): Always load user init file first if
1465 it is loaded at all.
1466
70445040
JB
14671998-10-16 Jim Blandy <jimb@zwingli.cygnus.com>
1468
1469 * stime.c: The CPP hair to determine a value for CLKTCK is weird,
1470 and is now broken under NetBSD. I can't fathom what it's trying
1471 to do, so I've replaced it with something that I do understand,
1472 which seems to work, and which isn't broken on NetBSD. "Progress?
1473 You Decide." (Thanks to Perry Metzger.)
1474
1475 * regex-posix.c (scm_regexp_exec): Add a cast to remove a
1476 signed/unsigned comparison.
1477
6e6e2bbc
JB
14781998-10-15 Jim Blandy <jimb@zwingli.cygnus.com>
1479
1480 Warning fixes from Greg Harvey:
1481 * unif.c (scm_array_set_x): initializer for pos
1482 * throw.c (scm_ithrow): added initializer for jmpbuf (SCM_UNDEFINED)
1483 * struct.c (scm_struct_ref, scm_struct_set_x): Added
1484 initializers for field_type, since EGCS so desparately wants to
1485 play dumb
1486 * debug.h (scm_make_gloc, scm_gloc_p, scm_make_iloc, scm_memcons,
1487 scm_mem_to_proc, scm_proc_to_mem, scm_debug_hang): Added prototypes
1488 when GUILE_DEBUG is defined.
1489 * dynwind.h (scm_wind_chain): Same.
1490 * ports.h (scm_pt_size, scm_pt_member): Same.
1491 * print.h (scm_current_pstate): Same.
1492 * procs.h (scm_make_cclo): Same.
1493
eebc12c6
JB
14941998-10-14 Jim Blandy <jimb@zwingli.cygnus.com>
1495
a437d8a2
JB
1496 Handle short and long long uniform arrays properly. (Thanks to
1497 Clark McGrew.)
1498 * ramap.c (scm_ra_matchp, scm_array_fill_int, scm_array_index_map_x,
1499 raeql_1): Add cases for scm_tc7_svect (short vectors) and
1500 scm_tc7_llvect (long long vectors).
1501
1502 Change the way libguile and boot-9.scm are timestamped, to try to
1503 get rid of these spurious mismatch warnings. Now both
1504 libguile/versiondat.h and ice-9/version.scm are generated directly
1505 by the configuration process, rather than having version.scm
1506 generated directly, and libguile/versiondat.h generated by the
1507 Makefile, which is generated by configure. It seems that
1508 sometimes the Makefile would change, but versiondat.h depends on
1509 Makefile.in, not Makefile, so it wouldn't get rebuilt.
1510 * Makefile.am (versiondat.h): Target removed; this is generated
1511 directly by the configure script now.
1512 (BUILT_SOURCES): Remove versiondat.h.
1513 * versiondat.h.in: New file, transformed by the configure script
1514 into versiondat.h.
1515 * Makefile.in: Regenerated.
1516
731a0a68
JB
1517 * (__scm.h, alist.c, eval.c, feature.c, gsubr.c, numbers.c,
1518 options.c): Rename RECKLESS -> SCM_RECKLESS, CAUTIOUS ->
1519 SCM_CAUTIOUS; this way, 1) there's only one version of each flag
1520 to define (we used to have both RECKLESS and SCM_RECKLESS), and 2)
1521 if we want to use them in a header file some day, we can. (Thanks
1522 to Michael Livshin.)
1523
ae6f9e24
JB
1524 * stime.c (scm_get_internal_real_time): Do the arithmetic using
1525 SCM numbers, so we won't have rollover problems; the range of a
1526 signed long in milliseconds is about 25 days. (Thanks to Karl
1527 Hegbloom.)
1528
70445040 1529 Don't redefine sleep and usleep; fix this problem now.
eebc12c6
JB
1530 * coop.c (sleep, usleep): Remove declarations; we don't use or
1531 redefine these any more.
1532 (scm_thread_usleep, scm_thread_sleep): New functions which do the
1533 job of usleep and sleep in a thread-friendly way. We can use
1534 these in the rest of Guile. Define versions for systems both with
1535 and without iselect.
1536 * threads.h (scm_thread_usleep, scm_thread_sleep): New declarations.
1537 * scmsigs.c (usleep): Clean up oddities declaring usleep; since
1538 we're just using it, not redefining it, we can use a K&R style
1539 declaration here.
1540 (sleep): Declare this, too, if the system hasn't.
1541 (scm_sleep, scm_usleep): Use scm_thread_sleep and
1542 scm_uthread_sleep if they're available; otherwise, just call the
1543 system functions.
1544 * scmconfig.h.in: Regenerated.
1545
1546 * coop.c (scm_thread_sleep): Make `slept' an unsigned long.
1547
1548 * coop.c (coop_sleephelp): Remove ANSI #ifdef hair.
1549
94e3e95e
JB
15501998-10-12 Jim Blandy <jimb@zwingli.cygnus.com>
1551
cb9728ed
JB
1552 * threads.c: Doc fix.
1553
1554 The argument type of usleep varies from system to system,
1555 as does the return type. We really shouldn't be redefining usleep
1556 at all, but I don't have time to clean that up before the 1.3.
1557 release. It's on the schedule for afterwards. (Thanks to Julian
1558 Satchell.)
1559 * coop.c (usleep): Use USLEEP_ARG_TYPE in prototype and
1560 definition.
1561 * scmsigs.c (usleep): Use USLEEP_ARG_TYPE in prototype.
1562 * scmconfig.h: Regenerated.
1563
94e3e95e
JB
1564 * simpos.c (scm_software_type): Procedure deleted. This isn't the
1565 right way to handle system variation. Autoconf's approach is the
1566 way and the light.
1567 * simpos.h (scm_software_type): Declaration deleted.
1568
1569 * script.c (scm_find_executable): Don't test if unix is #defined
1570 here; first, NetBSD doesn't #define it, and second, it's the wrong
b1d6e336 1571 way to go about these things. (Thanks to Perry Metzger.)
94e3e95e
JB
1572 (dld_find_executable): Delete this MSDOS support code. This isn't
1573 the way we want to support this; it needs to be rethunk at a
1574 larger scale.
1575
1576 * genio.c (scm_do_read_line): Don't just politely check that the
1577 line was either non-empty or EOF. Abort if it's empty and not
1578 EOF.
1579
5f964025
JB
15801998-10-11 Jim Blandy <jimb@zwingli.cygnus.com>
1581
81aef0ba
JB
1582 * scmconfig.h.in: Regenerated.
1583
335df0e8
JB
1584 * libguile.h: Don't omit the dynamic linking functions. (Thanks
1585 to Greg Badros.)
1586
5f964025
JB
1587 * genio.c (scm_do_read_line): Count lines correctly when the file
1588 doesn't end in a newline.
1589
17f8d40c
JB
15901998-10-10 Jim Blandy <jimb@zwingli.cygnus.com>
1591
216d3a1e
JB
1592 * genio.c (scm_do_read_line): Maintain the line count correctly.
1593 (Thanks to Harvey J. Stein and Greg Harvey.)
1594
17f8d40c
JB
1595 * gc.c (scm_return_first): Remove #ifdef __STDC__ garbage; Guile
1596 requires ANSI now.
1597
1598 * numbers.c (big2str): Protect t from garbage collection until
1599 we're done. (Thanks to Gary Houston.)
1600
31b9e767
JB
16011998-10-09 Jim Blandy <jimb@zwingli.cygnus.com>
1602
c6ff295e
JB
1603 * Makefile.am (libguile_la_LDFLAGS): Increment shared library
1604 version number.
1605 * Makefile.in: Regenerated.
1606
31b9e767
JB
1607 * fports.h (scm_setbuf0, scm_setvbuf, scm_setfileno,
1608 scm_evict_ports, scm_open_file, scm_stdio_to_port): Get rid of
1609 SCM_P macro.
1610
1611 Do magic to mix reads and writes on stdio FILE-based ports.
0445f9f2 1612 (Thanks to Christian Lynbech.)
31b9e767
JB
1613 * fports.c (FPORT_READ_SAFE, FPORT_WRITE_SAFE, FPORT_ALL_OKAY):
1614 New macros.
1615 (pre_read, pre_write): New functions.
1616 (local_fgetc, local_fgets, local_ffwrite, local_fputc,
1617 local_fputs): Call them.
1618 (local_fflush): Mark the port as ready for reading and writing.
1619 (scm_stdio_to_port): Set the FPORT_READ_SAFE, FPORT_WRITE_SAFE
1620 flags on new port objects. This might not be accurate --- who
1621 knows what state the FILE * is in when we get it --- but it won't
1622 do extraneous calls to fflush or fseek, so it's no worse than the
1623 behavior before this change.
1624 * ports.h: Add comment.
1625
1626 Centralize the creation of port objects based on stdio FILE * in
1627 fports.c; don't just throw them together anywhere.
1628 * fports.c (scm_stdio_to_port): Make NAME a SCM value, which is
1629 what the rest of Guile wants. Don't set the revealed count;
1630 that's only appropriate for stdin, stdout, stderr.
1631 (scm_standard_stream_to_port): This function does set the revealed
1632 count.
1633 * init.c (scm_init_standard_ports): Use scm_standard_stream_to_port,
1634 not scm_stdio_to_port.
1635 * filesys.c (scm_open): Call scm_stdio_to_port; don't write it out.
1636 * fports.c (scm_open_file): Same.
1637 * posix.c (scm_pipe): Same.
1638 * socket.c (scm_sock_fd_to_port): Same.
1639 * ioext.c (scm_fdopen): Same.
1640 (scm_freopen): Moved from here to...
1641 * fports.c (scm_freopen): ... here. This is really something that
1642 munges the internals of an fport, so it should go here.
1643 * fports.h (scm_stdio_to_port): Adjust prototype.
1644 (scm_standard_stream_to_port, scm_freopen): New protoypes.
1645 * ioext.h (scm_freopen): Prototype removed.
1646
1647 * filesys.c (set_element, get_element): This can work on both pipe
1648 and file ports, so use SCM_FPORTP to typecheck, instead of testing
1649 for scm_tc16_fport.
1650
1651 * scmconfig.h.in: Regenerated.
1652
1653 Change the definition of the functions in scm_ptobfuns so that
1654 they get passed the port object, not the port's stream.
1655 * ports.h (scm_ptobfuns): Rename all `stream' arguments to `port'.
1656 * gc.c (scm_gc_sweep): Pass the port itself to the free function.
1657 * genio.c (scm_putc, scm_puts, scm_lfwrite, scm_fflush, scm_getc):
1658 Pass the port itself to the scm_ptobs function.
1659 * ports.c (scm_close_port, scm_force_output, scm_flush_all_ports,
1660 scm_generic_fgets): Same.
1661 (putc_void_port, puts_void_port, write_void_port, flush_void_port,
1662 getc_void_port, fgets_void_port, close_void_port): Just change the
1663 argument names; these functions don't really do anything.
1664 * fports.c (local_fgetc, local_fgets, local_fclose, local_fflush,
1665 local_fputc, local_fputs, local_ffwrite, local_pclose): Take the
1666 port as an argument, and use SCM_STREAM to get the stdio FILE *.
1667 Also, use prototyped definitions, and get rid of the extra
1668 declarations.
1669 (scm_fptob, scm_pipob): We don't need casts here any more.
1670 * strports.c (prinstpt): Use prototype declarations.
1671 (stputc, stwrite, stputs, stgetc): Take the port as an argument,
1672 and use SCM_STREAM to get the string info. Also, use prototyped
1673 definitions, and get rid of the extra declarations.
1674 * vports.c (sfputc, sfwrite, sfputs, sfflush, sfgetc, sfclose,
1675 noop0): Same.
1676
1677 * ports.h (scm_ptobfuns): Replace uses of SCM_P with a straight
1678 prototype; it's okay (preferred, even!) to use ANSI C in Guile.
1679
1680 * fports.c (local_fgetc, local_fgets): Renamed from scm_fgetc and
1681 scm_fgets, for consistency.
1682 (scm_fptop, scm_pipob): References updated.
1683
6d921cd6
JB
16841998-10-08 Jim Blandy <jimb@zwingli.cygnus.com>
1685
1686 Include the source location in error messages for scripts.
1687 * init.c (scm_boot_guile_1): Use scm_internal_lazy_catch, so the
1688 stack is still there when we catch the error.
1689 * throw.c (handler_message): If we are handling an error with a
1690 message, then put together the proper arguments and call
1691 scm_display_error, instead of scm_display_error_message. That
1692 displays source location, if it can find it.
1693
13af3048
JB
16941998-10-07 Jim Blandy <jimb@zwingli.cygnus.com>
1695
a8e05009
JB
1696 * gc.c (scm_unprotect_object): Change this so that calls to
1697 scm_protect_object and scm_unprotect_object nest properly.
1698 (scm_protect_object): Doc fixes.
1699
3c0a54bd
JB
1700 * strings.c (scm_string_set_x): Require the argument to be a
1701 writable string, not a substring or a symbol.
1702 * strings.h (SCM_RWSTRINGP, SCM_NRWSTRINGP): New predicates.
74f87516
JB
1703 (Thanks to John Redford and Charbel Jacquin.)
1704
13af3048
JB
1705 * scmconfig.h.in: Regenerated; ../acconfig.h has changed.
1706
6ea669d7
JB
17071998-10-07 Jim Blandy <jimb@totoro.red-bean.com>
1708
1709 * eval.c (safe_setjmp): Remove this misunderstanding.
1710 (ENTER_APPLY, SCM_CEVAL, SCM_APPLY): Replace with references to
1711 ordinary setjmp.
1712
2d0937bc
JB
17131998-10-06 Jim Blandy <jimb@zwingli.cygnus.com>
1714
1715 * libguile.h: Mark these as C declarations, for compilation by C++
1716 compilers.
1717
1718 * snarf.h (SCM_PROC, SCM_PROC1): Remove very odd code in #ifdef
1719 __cplusplus clause. I seriously doubt this ever worked the way
1720 the author seems to have intended.
1721
17221998-10-05 Jim Blandy <jimb@zwingli.cygnus.com>
1723
1724 Utterly needless cleanups to hopelessly messy code.
1725 * ports.c: Doc fixes.
1726 (scm_fflush): Moved to ...
1727 * genio.c (scm_fflush): ... here, amongst all the other port
1728 method invocation functions.
1729 * genio.h, ports.h: The prototype moves too.
1730
53314947
JB
17311998-10-04 Jim Blandy <jimb@zwingli.cygnus.com>
1732
8b49142f
JB
1733 * backtrace.c (display_error_body): The current frame does not
1734 always have a parent frame; consider a function called directly
1735 from the MAIN_FUNC passed to scm_boot_guile. (Thanks to Maciej
1736 Stachowiak.)
1737
53314947
JB
1738 * alloca.c (alloca): Undo yesterday's changes, and simply call
1739 malloc directly for storage, and abort if we don't get what we
1740 want. The situation is much simpler --- just call malloc. Emacs
1741 has bizarre/evil requirements (signal handlers might malloc unless
1742 you set this global flag, so you have to set the flag around all
1743 calls to malloc) which we are certainly not going to conform to,
1744 so we can do the simple and obvious thing.
1745
1746 * coop.c (coop_condition_variable_wait): Make this function
1747 static. It's only useful internally --- you should never just
1748 wait on a condition variable.
1749 * coop-defs.h (coop_condition_variable_wait): Delete prototype.
1750
026065b7
JB
17511998-10-03 Jim Blandy <jimb@zwingli.cygnus.com>
1752
7265de70
JB
1753 * unif.c (scm_array_set_x): Accept any kind of number as an
1754 element for a uniform vector of doubles. This is more consistent
1755 with Scheme's view of numbers. (Thanks to Miroslav Silovic.)
1756
a9fe62cb
JB
1757 * alloca.c: Use scm_must_malloc to obtain storage. Hopefully this
1758 works; I can't conveniently test it myself. (Thanks to Dvid
1759 Tillman for the bug report.)
1760
026065b7
JB
1761 * init.c: Doc fixes.
1762
1763 * init.c (invoke_main_func): Load the startup files (boot-9.scm)
1764 from here, not from scm_compile_shell_switches (which is a pretty
1765 dumb place to do it).
1766 (scm_load_startup_files): New function.
1767 (scm_ice_9_already_loaded): Variable moved to here from script.c.
1768 * script.c (scm_compile_shell_switches): Don't load the startup
1769 files here.
1770 (scm_ice_9_already_loaded): Variable moved.
1771 * init.c (scm_load_startup_files): Prototype for new function.
1772 * gh_init.c (gh_enter): Doc fix.
1773
1aab20ac 17741998-10-03 Jim Blandy <jimb@savonarola.red-bean.com>
541716d1
JB
1775
1776 Some anti-warning changes from Greg Harvey.
1777 * gh_data.c (gh_scm2doubles): Initialize m, to avoid compiler
1778 warnings when it doesn't understand our NORETURN declarations in
1779 error.h.
1780 * posix.c (scm_mknod): Similar.
1781
f9d12ce8
JB
17821998-10-03 Jim Blandy <jimb@zwingli.cygnus.com>
1783
1784 * posix.c (scm_getpwuid): If we can't find an entry, return our
1785 own message, instead of using scm_syserror --- the getpwMUMBLE
1786 functions don't set `errno' to anything interesting.
1787
1aab20ac 17881998-10-03 Jim Blandy <jimb@savonarola.red-bean.com>
0553d3a2
JB
1789
1790 Get rid of warnings from the cooperative threading system.
1791 * threads.h (scm_single_thread_p, scm_yield,
1792 scm_call_with_new_thread, scm_join_thread, scm_make_mutex,
1793 scm_lock_mutex, scm_unlock_mutex, scm_make_condition_variable,
1794 scm_wait_condition_variable, scm_signal_condition_variable): Add
1795 prototypes for these Scheme-visible functions.
1796 * coop-defs.h (coop_next_runnable_thread,
1797 coop_wait_for_runnable_thread_now, coop_wait_for_runnable_thread):
1798 Prototypes for these here, even though they're from iselect.c.
1799 (coop_condition_variable_wait, coop_join): Add prototypes.
1800 * coop-threads.c (scm_threads_free_thread, scm_threads_free_mutex,
1801 scm_threads_free_condvar): Make these smob functions static.
1802 * coop-threads.h (coop_init): Give this a real prototype.
1803 * coop.c: #include <unistd.h>, if we have it, for `usleep' and `sleep'.
1804 (coop_next_runnable_thread): No need to provide prototype; it's in
1805 coop-defs.h.
1806
1807 * scmconfig.h.in: .detarenegeR
1808
1809 * iselect.c, threads.c: Doc fixes.
1810
235bb3fe
JB
18111998-10-03 Jim Blandy <jimb@zwingli.cygnus.com>
1812
1813 * Makefile.in: Regenerated with a patched automake, to get
1814 dependency generation right when using EGCS.
1815
1816 * inet_aton.c (inet_aton): Add prototype, to remove compiler
1817 warning. (Thanks to Robert Pluim.)
1818
1819 * inet_aton.c (inet_aton): Reassure the compiler that the
1820 arguments to the <ctype.h> macros are all unsigned characters, not
1821 signed characters.
1822
1aab20ac 18231998-10-03 Jim Blandy <jimb@savonarola.red-bean.com>
83d1c666
JB
1824
1825 Getting rid of more warnings...
1826 * iselect.c: Test for MISSING_BZERO_DECL, not DECLARE_BZERO; see
1827 today's change to ../configure.in.
1828 * scmsigs.c: Test for MISSING_USLEEP_DECL, not DECLARE_USLEEP.
1829 * scmconfig.h.in: Regenertaded.de.,.__
1830 * stime.c (strptime): Declare this, #ifdef MISSING_STRPTIME_DECL.
1831 (scm_localtime, scm_mktime): Use a const char * to manipulate the
1832 time zone name.
1833
1834 * readline.c: Doc fix.
1835 (rl_cleanup_after_signal, rl_free_line_state): Make these static.
1836 * readline.h (scm_filename_completion_function): Add prototype.
1837 (scm_init_readline): Make this into a prototype.
1838
1839 * readline.c (scm_filename_completion_function): Use SCM_PROC to
1840 declare this, instead of calling scm_make_subr manually.
1841
1aab20ac 18421998-10-02 Jim Blandy <jimb@savonarola.red-bean.com>
83d1c666
JB
1843
1844 * readline.h (scm_init_readline): Add prototype for this.
1845 (scm_init_readline): Make this a real prototype.
1846
94c0b3b8
JB
18471998-09-30 Jim Blandy <jimb@zwingli.cygnus.com>
1848
1849 Warning fixes from Maciej Stachowiak:
1850 * backtrace.h (scm_display_application, scm_backtrace): Add
1851 prototypes.
1852 * debug.c (scm_m_start_stack): Make this function static.
1853 * fluids.h (scm_fluid_p): Add prototype.
1854 * procprop.c (scm_i_procedure_arity): Make this function static.
1855 * regex-posix.c (scm_regexp_error_msg): Make this function static.
1856 * regex-posix.h (scm_init_regex_posix): Use prototype, not K&R decl.
1857 * root.h (scm_dynamic_root): Add external prototype.
1858 * scmsigs.h (scm_usleep): Add external prototype.
1859 * script.h (scm_init_script): Use prototype, not K&R decl.
1860 * stacks.h (scm_stack_id): Add external prototype.
1861 * symbols.h (scm_sysintern0_no_module_lookup): Add external prototype.
1862
dc9f6d6a
MG
18631998-09-30 Mark Galassi <rosalia@cygnus.com>
1864
1865 * gh.h: took out the definitions of vset and vref, since they are
1866 replaced by the proper vector routines that correspond to the R4RS
1867 procedures.
1868
61a9ba48
JB
18691998-09-29 Jim Blandy <jimb@totoro.red-bean.com>
1870
94c0b3b8 1871 * snarf.h (SCM_VCELL_INIT, SCM_GLOBAL_VCELL_INIT): New macros;
61a9ba48
JB
1872 these are analogous to SCM_VCELL and SCM_GLOBAL_VCELL but take a
1873 third argument, a C expression that should result in a SCM value,
1874 which is used to initialize the variable. Reimplemented
1875 SCM_CONST_LONG in terms of SCM_VCELL_INIT. (Thanks to Maciej
1876 Stachowiak.)
1877
1878 * version.h (scm_libguile_config_stamp): Add prototype.
1879 (From Maciej Stachowiak.)
1880
9a3c1149
JB
18811998-09-26 Jim Blandy <jimb@zwingli.cygnus.com>
1882
1883 * eval.c (scm_force): Assert that x is SCM_NIMP to fix segv when
1884 (force 9) is tried. (Thanks to Karl M. Hegbloom.)
1885
52591c80
JB
18861998-09-06 Jim Blandy <jimb@zwingli.cygnus.com>
1887
6925bc4e
JB
1888 * print.c (scm_iprin1): Rather than having one i, and using it in
1889 several places, declare a fresh i local to each block where it is
1890 used, and give it a signedness appropriate to its use in each case.
1891 (scm_iprlist): Same.
1892
1893 * print.c (scm_iprin1): Add cast to avoid unsigned/signed
1894 comparison warnings.
1895
1896 * print.c (ENTER_NESTED_DATA): Make i an unsigned long, to avoid
1897 signed/unsigned clashes.
1898
1899 * posix.h (scm_tmpnam): Added prototype.
1900
52591c80
JB
1901 * objects.h (scm_set_object_procedure_x, scm_make_class_object,
1902 scm_make_subclass_object): Add external prototypes.
1903
1904 * numbers.c (scm_mkbig): Add cast, and note that signed/unsigned
1905 comparison is okay here.
1906
1907 * numbers.c (scm_istr2int): Add cast; len is known to be positive.
1908
1909 * numbers.c (scm_bigcomp): Clarify logic, and avoid relying on the
1910 (true, but confusing) fact that -1 == ((unsigned) 0 - 1).
1911
1912 * numbers.c (scm_adjbig): Make nsiz an scm_sizet, to avoid mixing
1913 signed/unsigned.
1914
1915 * load.c (swap_port): Make this function static.
1916
1917 * load.c (scm_search_path): Make max_path_len and max_ext_len
1918 unsigned, since they're compared against string sizes.
1919
1920 * load.c (init_build_info): Make i unsigned.
1921
1922 * ioext.h (scm_read_line): Add prototype.
1923
1924 * hashtab.c (scm_hash_fn_get_handle, scm_hash_fn_create_handle_x,
1925 scm_hash_fn_remove_x): Make hash bucket index local variable k
1926 unsigned. Use scm_ulong2num to pass it to SCM_ASSERT as
1927 accurately as possible.
1928
1929 * gh_data.c (gh_set_substr): Add casts to avoid signed/unsigned
1930 comparisons, and range checking to make sure those casts are
1931 harmless.
2d2c87e1
JB
1932
1933 * stackchk.h (SCM_STACK_OVERFLOW_P): Change definition to avoid
1934 signed/unsigned comparisons.
1935
1936 * smob.c (scm_numsmob): Make this an int, not an scm_sizet, to
1937 avoid signed/unsigned comparisons.
1938 * smob.h (scm_numsmob): Change extern declaration to match.
1939
1940 * ports.c (scm_numptob): Make this an int, not an scm_sizet, to
1941 avoid signed/unsigned comparisons.
1942 * ports.h (scm_numptob): Change extern declaration to match.
1943 (scm_current_load_port, scm_set_port_line_x,
1944 scm_set_port_column_x): New prototypes.
1945
1946 * gsubr.c (GSUBR_TEST): Don't #define this. Nobody's using the
1947 test code, and it causes warnings.
1948
1949 * gh.h (gh_int2scmb, gh_uniform_vector_length,
1950 gh_uniform_vector_ref): Added prototypes.
1951
1952 * Makefile.am (libguile_la_SOURCES): Include Scheme-level
1953 debugging support unconditionally. That's backtrace.c, stack.c,
1954 debug.c, and srcprop.c.
1955 (EXTRA_libguile_la_SOURCES): Omit those from here.
1956 * Makefile.in: Regenerated.
1957
a9b70caf
MD
19581998-08-21 Mikael Djurfeldt <mdj@mdj.nada.kth.se>
1959
1960 * options.c (scm_options): Bugfix: Allow empty list of options!
1961
1962 * debug.c, debug.h (scm_single_step): Removed.
1963 (scm_with_traps): New procedure. This procedure could easily be
1964 written in Scheme but needs to be highly optimized.
1965
1966 * eval.h, eval.c: New evaluator trap flag: SCM_TRAPS_P.
1967
1968 * eval.c (SCM_CEVAL, SCM_APPLY): Removed resetting of trap flags.
1969 Check SCM_TRAPS_P before trapping.
1970
6dd78771
JB
19711998-07-30 Jim Blandy <jimb@zwingli.cygnus.com>
1972
1973 Changes to avoid signed/unsigned comparison warnings.
1974 * gc.c (scm_mtrigger, scm_heap_size): Make these unsigned longs.
1975 (scm_gc_sweep): Make n and j local to the blocks they're used in,
1976 so they can have appropriate types for each application. Make i
1977 signed. Use initializers in some spots. I'll probably pay for
1978 all this tweaking.
1979 (scm_must_malloc, scm_must_realloc): Use scm_sizet for size args.
1980 (scm_must_realloc): Make nm unsigned.
1981 (init_heap_seg): Make new_seg_index and n_new_objects signed.
1982 (scm_init_storage): Use prototype-style definition, and make the
1983 argument unsigned.
1984 * gc.h (scm_heap_size, scm_mtrigger, scm_must_malloc,
1985 scm_must_realloc, scm_init_storage): Adjust prototype accordingly.
1986
1987 * filesys.c (scm_readlink): Make local vars rv and size ints, to
1988 avoid signed/unsigned comparison warnings, and because the return
1989 value of readlink may be -1. Don't bother casting the third
1990 argument to readlink.
1991
1992 * filesys.c (scm_dirname, scm_basename): Move these to their own
1993 page, at the end of the file.
1994 * filesys.h (scm_dirname, scm_basename): Add prototypes for these.
1995
1996 * eval.h (scm_eval_options_interface): Add external prototype for this.
1997 * eval.c (scm_eval_options_interface): Use prototype-style def'n.
1998
1999 * eval.c (scm_lookupcar1): Make this static.
2000
2001 * dynl.h (scm_registered_modules, scm_clear_registered_modules):
2002 Make these prototype declarations, not K&R-style.
2003
2004 * chars.c (scm_tables_prehistory): Add cast, to remove signed/
2005 unsigned comparison warning.
2006
2007 * appinit.c: File removed. It had a single function in it, empty,
2008 whose reason for existence is explained in no documentation or
2009 comment. I think it's there as a default for some Tcl-style
2010 initialization, but Tcl abandoned that approach a while ago.
2011 * Makefile.am (libguile_la_SOURCES): Remove appinit.c.
2012 (BUILT_SOURCES): Remove appinit.x.
2013 * Makefile.in: Regenerated.
2014
0dcbc17a
JB
20151998-07-29 Jim Blandy <jimb@zwingli.cygnus.com>
2016
2017 * Makefile.in: Regenerated using the last public version of
2018 automake, not the hacked Cygnus version.
2019
1f5ae2fd
JB
20201998-07-28 Jim Blandy <jimb@zwingli.cygnus.com>
2021
2022 Remove Totoro kludge.
2023 * Makefile.in, scmconfig.h.in: Regenerated.
2024 * init.c, readline.c: Don't check if TOTORO is #defined.
2025
e99cbcd6
JB
20261998-07-26 Jim Blandy <jimb@zwingli.cygnus.com>
2027
2028 * Makefile.am: Adjust for new thread configuration system.
2029 (INCLUDES): Include the value of THREAD_CPPFLAGS.
2030 (guile_LDADD, check_ldadd): THREAD_LIBS_LOCAL has been renamed from
2031 THREAD_LIBS.
2032 (THREAD_LIBS): Definition deleted; automake will generate such
2033 things automatically.
2034 * Makefile.in: Regenerated.
2035
87148d9e
JB
20361998-07-23 Jim Blandy <jimb@zwingli.cygnus.com>
2037
2038 Simplify smob and port marking; set the mark bit in the generic
2039 marking code, and make marker routines only responsible for
2040 turning up outgoing pointers.
2041 * gc.c (scm_gc_mark): Set the mark bit on ports and smobs here,
2042 before calling the marking function. Don't call the marking
2043 function if it's zero.
2044 * markers.c (scm_mark0): Just return #f. This function isn't
2045 necessary at all now, but it's harmless to call it. We'll leave
2046 it in so other folks' code doesn't croak at link time.
2047 (scm_markcdr): Don't call SCM_SETGC8MARK.
2048 * async.c (mark_async): Don't call SCM_SETGC8MARK.
2049 * dynl.c (mark_dynl_obj): Same.
2050 * root.c (mark_root): Same.
2051 * srcprop.c (marksrcprops): Same.
2052 * unif.c (markra): Same.
2053 * variable.c (scm_markvar): Same.
2054 * ports.c (scm_markstream): Same.
2055 (void_port_ptob): Specify zero for our marking function.
2056 * debug.c (debugobjsmob): Same.
2057 * dynwind.c (guardsmob): Same.
2058 * filesys.c (dir_smob): Same.
2059 * fluids.c (fluid_smob): Same.
2060 * fports.c (scm_fptob, scm_pipob): Same.
2061 * mallocs.c (mallocsmob): Same.
2062 * regex-posix.c (regex_t_smob): Same.
2063 * smob.c (freecell, flob, bigob): Same.
2064 * threads.c (thread_smob, mutex_smob, condvar_smob): Same.
2065 * throw.c (jbsmob, lazy_catch_funs): Same.
2066
3910272e
MD
20671998-07-17 Mikael Djurfeldt <mdj@barbara.nada.kth.se>
2068
2069 * eval.c (scm_copy_tree): Reverted last change: `eval' uses
2070 scm_copy_tree on code in order not to let memoized code to leak
2071 out. Thus, scm_copy_tree needs to copy vectors as well since
2072 quasiquote can introduce evaluated code also inside vector
2073 constants.
2074
240ed1e5
MD
20751998-07-17 Mikael Djurfeldt <mdj@barbara.nada.kth.se>
2076
2077 * eval.c (scm_copy_tree): Removed ability to copy vectors.
2078
2079 * gh_data.c, gh.h (gh_ints2scm, gh_longs2ivect,
2080 gh_ulongs2uvect): New procedures. (Complements gh_doubles2scm and
2081 gh_doubles2dvect.)
2082
2083 * unif.c: Say that ivect and uvect are of type signed and unsigned
2084 long instead of int in commentary so that it correctly describes
2085 the implementation.
2086
5ef81022
MD
20871998-07-12 Mikael Djurfeldt <mdj@barbara.nada.kth.se>
2088
2089 * stime.c: Removed declaration of strptime. (It should be
2090 declared by the system headers. If it turns out that some systems
2091 don't, we'll handle that then.) (Thanks to Greg Troxel.)
2092
2093 * stime.h: Renamed TIMEH --> STIMEH
2094
2095 * backtrace.c (scm_display_error, scm_display_backtrace): In order
2096 to increase portability, don't use structure assignment.
2097 (Thanks to Nicolas Neuss.)
2098
2099 * iselect.c: Use LONG_MAX instead of ULONG_MAX for increased
2100 portability.
2101 (finalize_fd_sets): Added empty statement after last case label.
2102 (Thanks to Nicolas Neuss.)
2103
2104 * gc.c (scm_igc): Changed //-comment into /*-comment. (Thanks to
2105 Nicolas Neuss.)
2106
212d45b8
MD
2107Sat Jul 11 22:08:21 1998 Mikael Djurfeldt <mdj@totoro.red-bean.com>
2108
2109 * init.c, readline.c: OK, I won't have these readline.x bug
2110 reports anymore. We've had them since April. The current reason
2111 is a completely unintelligible failure of totoro.red-bean.com to
2112 do the test for rl_getc_function in libreadline correctly. This
2113 kludge overrides the test if we're on totoro so that the snapshot
2114 generation process can work.
2115
2116 * readline.c: Define a strdup replacement if not existent on system.
2117
43eeb5a6
MD
21181998-07-12 Mikael Djurfeldt <mdj@barbara.nada.kth.se>
2119
2120 * vectors.c, vectors.h (scm_make_vector): Removed third argument.
2121 This change makes scm_make_vector R5RS compatible. We cannot keep
2122 the third argument since people want to be able to deduce the form
2123 of the C function call only by looking at R5RS. (At the same time
2124 we have removed some unnecessary complexity!)
2125
2126 * eval.c, filesys.c, fluids.c, gc.c, gh_data.c, init.c, kw.c,
2127 net_db.c, posix.c, print.c, regex-posix.c, scmsigs.c, socket.c,
2128 stime.c, symbols.c, unif.c, vectors.c, weaks.c: Removed third
2129 argument in call to scm_make_vector.
2130
9d0b279f
MD
21311998-07-02 Mikael Djurfeldt <mdj@mdj.nada.kth.se>
2132
2133 * numbers.h (SCM_NUM2DBL): New macro. Complements SCM_NUMBERP.
2134 This macro is useful in applications.
2135
dbb25e7f
MD
21361998-06-21 Mikael Djurfeldt <mdj@barbara.nada.kth.se>
2137
2138 * load.c (scm_internal_parse_path): Renamed from scm_parse_path.
2139 (scm_parse_path, scm_search_path): New Scheme level procedures.
2140
2141 * load.h (scm_internal_parse_path, scm_parse_path,
2142 scm_search_path): Declared.
2143
74d6650d
MD
21441998-06-18 Mikael Djurfeldt <mdj@mdj.nada.kth.se>
2145
2146 * filesys.c (dirname, basename): New procedures.
2147
2148 * init.c (scm_boot_guile_1): Removed condition around
2149 scm_init_options.
2150
2151 * dynwind.c: #include "genio.h"; #include "smob.h"; Implemented a
2152 new data type (guards) for representation of C level guards and
2153 data on the wind chain.
2154 (scm_internal_dynamic_wind): New function.
2155
2156 * dynwind.h: Declare scm_internal_dynamic_wind.
2157
2158 * root.h (scm_root_state): Added scm_cur_loadp.
2159
2160 * root.c (mark_root): Added comment about cur_loadp.
2161
2162 * load.c: #include "dynwind.h";
2163 (scm_primitive_load): Use scm_inner_dynamic_wind to update
2164 scm_cur_loadp.
2165
2166 * init.c (scm_init_standard_ports): Initialize scm_def_loadp.
2167
2168 * ports.c (current-load-port): New procedure.
2169
391aebfc
MD
21701998-06-09 Mikael Djurfeldt <mdj@mdj.nada.kth.se>
2171
10ccfad7
MD
2172 * ioext.c (scm_isatty_p): Accept any kind of data as argument. If
2173 not a tty, return #f.
2174
391aebfc
MD
2175 * regex-posix.c (scm_regexp_exec): Free malloced memory. (Thanks
2176 to Julian Satchell and Roland Kaufmann.)
2177
2178 * gh.h (gh_memv, gh_member): Fixed typos in macro definitions.
2179 (gh_write): Added declaration. (Thanks to Eiichi Takamori.)
2180
6dabf6a9
MD
21811998-06-07 Mikael Djurfeldt <mdj@barbara.nada.kth.se>
2182
2183 * debug.h, debug.c (scm_start_stack): New function. Implements
2184 the guts of old scm_m_start_stack.
2185
2186 * debug.c (scm_m_start_stack): Use scm_start_stack.
2187
2188 * init.c (scm_start_stack, scm_restart_stack): Renamed to
2189 start_stack and restart_stack. (These have static scope.)
2190
daca2816
MD
21911998-05-19 Mikael Djurfeldt <mdj@mdj.nada.kth.se>
2192
2193 * readline.c (rl_cleanup_after_signals, rl_free_line_state): New
2194 readline functions to come in release 2.3. (Thanks to Chet
2195 Ramey.)
2196 (handle_errors): Use the above functions.
2197
be0ea988
MD
21981998-05-12 Mikael Djurfeldt <mdj@mdj.nada.kth.se>
2199
2200 * readline.c: Improvements for readline support: Handle errors
2201 better; Implement before-read-hook.
2202
22031998-05-11 Mikael Djurfeldt <mdj@mdj.nada.kth.se>
2204
2205 * init.c (scm_boot_guile_1), readline.c: Test for
2206 HAVE_RL_GETC_FUNCTION instead of HAVE_LIBREADLINE. (Need to
2207 assure that we have version >= 2.1.)
2208
e158e4f4
MD
22091998-05-11 Mikael Djurfeldt <mdj@kenneth>
2210
83d1c666
JB
2211 * readline.c (scm_readline): Defer interrupts while we're calling
2212 readline.
2213
e158e4f4
MD
2214 * readline.c (scm_add_history): Bugfix: Do strdup before giving
2215 away the string to add_history.
56600c45
MD
2216 (completion_function): Do completion for readline. (Thanks to
2217 Andrew Archibald.)
e158e4f4
MD
2218 (scm_filename_completion_function): New procedure: Filename
2219 completer.
2220 (current_input_getc): New function. Use this one instead of
2221 standard getc from readline.
2222
2223 * throw.c, throw.h (scm_handle_by_throw): New function: This
2224 handler throws errors to next handler on the dynwind chain.
2225
22261998-05-09 Mikael Djurfeldt <mdj@kenneth>
2227
2228 * scmsigs.c (scm_usleep): Bugfix: Don't define j if it isn't
2229 used.
2230
8bb51def
MD
22311998-05-03 Mikael Djurfeldt <mdj@mdj.nada.kth.se>
2232
2233 * procprop.c (scm_i_procedure_arity): New function. Returns arity
2234 of procedure.
2235 (scm_procedure_properties): Modified to return arity together with
2236 other properties.
2237 (scm_procedure_property): Added the read-only property `arity'.
2238 (scm_set_procedure_property_x): It is an error to set the `arity'
2239 property.
2240
2241 * gsubr.h, gsubr.c: Moved macros from gsubr.c to gsubr.h and added
2242 prefix SCM_; Made f_gsubr_apply global and added prefix scm_.
2243
2244 * procprop.h (scm_sym_arity): New symbol.
2245
2246 * objects.c (scm_set_object_procedure_x): New procedure: Use this
2247 to set the dispatch procedure of an operator or entity object.
2248
2249 * objects.h (SCM_METACLASS_OPERATOR_LAYOUT, SCM_ENTITY_LAYOUT):
2250 Made procedure slots read-only.
2251
2252 * eval.c (SCM_CEVAL): Moved scm_tc7_contin case above
2253 scm_tcs_cons_gloc case in zero args switch; Fixed args
2254 construction for operators in scm_tcs_cons_gloc case in two args
2255 switch.
2256
680ed4a8
MD
22571998-05-02 Mikael Djurfeldt <mdj@mdj.nada.kth.se>
2258
104d4533
MD
2259 * fluids.c: Removed use of assert.h (in order to avoid
2260 __eprintf).
2261
2262 * Makefile.am (libguile_la_LDFLAGS): Added -export-dynamic.
2263
2264 * dynl.c (maybe_drag_in_eprintf): Disabled through #ifdef 0.
2265
680ed4a8
MD
2266 * eval.c (SCM_CEVAL): Do more thorough argument checking. This
2267 change makes the evaluator safer at the cost of evaluation speed.
2268 It handles the case when the user has added a non-immediate
2269 improper end of the application form, e.g., `(+ 0 . x)'.
2270 (Earlier only cases like `(+ 0 . 0)' were handled.) I've tried to
2271 minimize the extra cost as much as possible. The new code is
2272 enclosed in #ifdef CAUTIOUS regions. NOTE: This also fixes the
2273 problem with structs planted directly in the code (e.g. by a
2274 macro). This no longer causes segmentation fault. (Thanks to
2275 Eric Hanchrow.)
2276
2277 * eval.c, eval.h (scm_eval_args, scm_deval_args): Take one extra
2278 arg `proc' in order to be able to throw errors; New argument
2279 checking code.
2280
2281 * Removed extra #include "debug.h"
2282
0935d604
MD
22831998-04-25 Mikael Djurfeldt <mdj@kenneth>
2284
2285 * scmsigs.c: Declare usleep as returning void on some systems.
2c36126d
MD
2286 (scm_usleep): Return SCM_INUM0 on those systems. (Thanks to Julian
2287 Satchell.)
0935d604
MD
2288
2289 * coop.c (usleep): Return void on some systems.
2290
f1a5fa3c
MD
22911998-04-20 Mikael Djurfeldt <mdj@mdj.nada.kth.se>
2292
2293 * Makefile.am (libguile_la_LDFLAGS): Removed redundant -rpath.
2294
2295 * coop.c: Changed return type of usleep to int.
2296
2297 * scmsigs.c (scm_usleep): New procedure; Declare usleep if it
2298 isn't found in the OS.
2299
2300 * iselect.h: #define scm_internal_select select if GUILE_ISELECT
2301 isn't enabled. (Thought that I had made this change ages ago...)
2302
2303 * iselect.c: Declare bzero if not defined by OS.
2304
26c41b99
MD
23051998-04-19 Mikael Djurfeldt <mdj@mdj.nada.kth.se>
2306
c3e09ef9
MD
2307 * dynl.c (scm_must_free_argv): Fixed memory leak due to negated
2308 condition. (Thanks to John Tobey.)
2309
2310 * continuations.c (scm_make_cont), debug.c (scm_make_memoized,
2311 scm_make_debugobj), eval.c (scm_makprom): SCM_DEFER/ALLOW_INTS -->
2312 A section.
2313
2314 * __scm.h: Start the long-term project of moving to POSIX threads.
2315 Phase 1: Classification of all critical sections.
2316 (SCM_ENTER_A_SECTION, SCM_EXIT_A_SECTION): New macros: Delimiters
2317 for A sections. (See comments in __scm.h for details.)
2318
26c41b99
MD
2319 * dynl.c: Only check that HAVE_DLOPEN is defined before loading
2320 dynl-dl.c; Test on HAVE_LIBDLD instead of HAVE_DLD.
2321
28795b1f
MD
23221998-04-18 Mikael Djurfeldt <mdj@mdj.nada.kth.se>
2323
2324 * Makefile.am (BUILT_SOURCES): Added cpp_err_symbols.c,
2325 cpp_sig_symbols.c, libpath.h and versiondat.h to BUILT_SOURCES
2326 (libpath.h, versiondat.h): Replaced dependency on Makefile with
2327 dependencies on $(srcdir)/Makefile.in
2328 $(top_builddir)/config.status in order to avoid circularity.
2329
2330 * script.c (scm_compile_shell_switches): Bugfix: Don't discount i
2331 from argc if argc was 0 initially.
2332
2333 * Makefile.am (Makefile.am): Replaced THREAD_LIBS --> GUILE_LIBS
2334 in generation of libpath.h.
2335
f2e5c92c
MD
23361998-04-15 Mikael Djurfeldt <mdj@nada.kth.se>
2337
2338 * Makefile.am (libguile_la_LDFLAGS): Bumped version number of
2339 libguile from 2 to 3.
2340
a3365d47
MD
23411998-04-14 Mikael Djurfeldt <mdj@nada.kth.se>
2342
2343 * Makefile.am: Added .x-dependencies to variable BUILT_SOURCES.
2344
fc1d67c4
MD
23451998-04-13 Mikael Djurfeldt <mdj@kenneth>
2346
2347 * ports.c (scm_port_line, scm_set_port_line_x, scm_port_column,
2348 scm_set_port_column_x, scm_port_filename,
2349 scm_set_port_filename_x): Removed optional arguments. Added
2350 proper argument checking.
2351
2352 * eval.c, eval.h, coop.c (scm_eval_stack, SCM_EVAL_STACK): Measure
2353 stack size in machine words.
2354
2355 * unif.c (scm_uniform_vector_ref, scm_cvref, scm_array_set_x,
2356 rapr1): Use SCM_UCHARS instead of SCM_CHARS for strings. (Thanks
2357