(scm_round): Test for x already an integer, to avoid bad
[bpt/guile.git] / libguile / ChangeLog
CommitLineData
b1cb24ff
DH
12004-04-19 Dirk Herrmann <dirk@dirk-herrmanns-seiten.de>
2
3 * eval.c (scm_unmemocopy): Fixed unmemoization of let*.
4
5 (deval_args, CEVAL): Minor improvements: Reduced variable scopes,
6 added const qualifiers, cast intentionally unused expressions to
7 void for emphasis, improved comment.
8
5065b40d
DH
92004-04-18 Dirk Herrmann <dirk@dirk-herrmanns-seiten.de>
10
11 * tags.h (scm_tags, scm_tc8_tags, scm_tc9_flag, scm_tc8_flag,
12 scm_tc8_isym): Renamed scm_tags to scm_tc8_tags. Renamed
13 scm_tc9_flag to scm_tc8_flag. Introduced new identifier
14 scm_tc8_isym. Defined tc8-tags relative to scm_tc3_imm24.
15 Defined the tc8-tag for flags to be 0x04, which will mean that
16 SCM_BOOL_F will also have the value 0x04 instead of 0x013c. Due
17 to the reduced number of bits and the simpler bit pattern for
18 SCM_BOOL_F, certain machines may be able to use more efficient
19 processor instructions to deal with SCM_BOOL_F.
20
21 (SCM_ITAG9, SCM_MAKE_ITAG9, SCM_ITAG9_DATA): Removed. These have
22 never been defined in a released version, thus no need to
23 deprecate them.
24
25 (SCM_IFLAGP, SCM_MAKIFLAG, SCM_IFLAGNUM): Flags now use tc8
26 instead of tc9 tags.
27
28 (SCM_ISYMP, SCM_MAKISYM, SCM_ISYMNUM): Isyms now use tc8 instead
29 of tc9 tags.
30
31 (SCM_MAKSPCSYM): Removed. It is almost impossible that user code
32 could have used this definition.
33
34 (SCM_IM_AND, SCM_IM_BEGIN, SCM_IM_CASE, SCM_IM_COND, SCM_IM_DO,
35 SCM_IM_IF, SCM_IM_LAMBDA, SCM_IM_LET, SCM_IM_LETSTAR,
36 SCM_IM_LETREC, SCM_IM_OR, SCM_IM_QUOTE, SCM_IM_SET_X): Now encoded
37 as isyms, as special isyms don't exist any more.
38
9fa6c119
KR
392004-04-18 Kevin Ryde <user42@zip.com.au>
40
e08d2eee
KR
41 * filesys.c (scm_readdir): Use readdir_r when available, for thread
42 safety.
43
9fa6c119
KR
44 * numbers.c (scm_max, scm_min): For big/real, use SCM_SWAP rather than
45 explicit swapping code.
46
c9cdd396
KR
472004-04-15 Kevin Ryde <user42@zip.com.au>
48
49 * cpp_sig_symbols.in: Add SIGSYS.
50
51 * list.c (scm_append_x): Use iterative style, to avoid non-tail
52 recursion.
53
54 * numbers.c (scm_max, scm_min): For inum/frac, frac/inum, big/frac,
55 frac/big and frac/frac, use scm_less_p for exact comparison.
56
83ac9c59
KR
57 * numbers.c (scm_gcd): For inum/big, use mpz_gcd_ui by sharing code
58 with big/inum.
59
84a4be9a
KR
60 * numbers.c (xisinf): Add a comment about solaris 7 lacking isinf.
61
84fad130
HWN
622004-04-06 Han-Wen Nienhuys <hanwen@xs4all.nl>
63
6b69393d
HWN
64 * inline.h (scm_cell): use SCM_GC_CELL_WORD for checking tag.
65
84fad130
HWN
66 * chars.h (scm_init_chars): change scm_{upcase,downcase} to
67 scm_c_{up,down}case.
68 (SCM_MAKE_CHAR): add (unsigned char) cast. This prevents havoc
69 when hi-bit ASCII is subjected to SCM_MAKE_CHAR().
70
c3110a30
KR
712004-04-06 Kevin Ryde <user42@zip.com.au>
72
0b288f36
KR
73 * numbers.c (scm_ash): Remove stray "}" in docstring.
74
ea2508c8
KR
75 * numbers.c (scm_make_ratio): For inum/bignum integer detection, use
76 x==SCM_MOST_NEGATIVE_FIXNUM explicitly, for clarity and to avoid
77 calling mpz_cmp_ui in most cases.
78
c3110a30
KR
79 * numbers.c (scm_quotient, scm_remainder): In inum/big, use mpz_cmp_ui
80 for big == abs(most-negative-fixnum) special case.
81 (abs_most_negative_fixnum): Remove, no longer used.
82
83 * scmsigs.c (scm_sigaction_for_thread): Correction to signum range
84 test, avoids SCM_VECTOR_REF outside bounds of signal_handlers on
85 calling (sigaction NSIG).
86
87 * simpos.c (scm_system_star): Fix execargv memory leak, merge parent
88 and fork error cases to do this.
89
dec40cd2
DH
902004-04-03 Dirk Herrmann <dirk@dirk-herrmanns-seiten.de>
91
92 * eval.c (CEVAL): Don't distinguish between short and long
93 instructions when dispatching - just always dispatch on the
94 instruction code, which is common for short and long instructions.
95 Further, removed unnecessary goto statements and added comment.
96
0e7bb795
DH
972004-04-03 Dirk Herrmann <dirk@dirk-herrmanns-seiten.de>
98
99 * eval.c (scm_unmemocopy): Don't distinguish between short and
100 long instructions when dispatching - just always dispatch on the
101 instruction code, which is common for short and long instructions.
102 Further, removed unnecessary goto statements, fixed indentation
103 and replaced SCM_IMP predicates by SCM_NULLP.
104
f9986767
DH
1052004-04-03 Dirk Herrmann <dirk@dirk-herrmanns-seiten.de>
106
107 * eval.c (scm_lookupcar1, CEVAL): Use SCM_ILOCP instead of
108 comparison with SCM_ILOC00. In CEVAL, eliminate goto-label
109 'checkmacro'.
110
fbc42231
KR
1112004-03-31 Kevin Ryde <user42@zip.com.au>
112
113 * simpos.c: Include <signal.h> for SIG_IGN and friends.
114
434f2f7a
DH
1152004-03-29 Dirk Herrmann <dirk@dirk-herrmanns-seiten.de>
116
117 Introduce scm_debug_mode_p as a replacement for scm_debug_mode and
118 SCM_DEBUGGINGP:
119
120 * debug.h (scm_debug_mode_p, scm_debug_mode, SCM_DEBUGGINGP),
121 eval.c (scm_debug_mode_p): Deprecated scm_debug_mode and
122 SCM_DEBUGGINGP. Provided scm_debug_mode_p instead, to have one
123 single interface that also matches the naming conventions.
124 Probably scm_debug_mode_p should be part of the private interface
125 anyway.
126
127 * debug.h (scm_debug_mode_p), backtrace.c (display_error_body),
128 eval.c (SCM_APPLY, scm_trampoline_0, scm_trampoline_1,
129 scm_trampoline_2): Change uses of scm_debug_mode or SCM_DEBUGGINGP
130 to scm_debug_mode_p.
131
132
133 Deprecate direct access to scm_ceval, scm_deval and scm_ceval_ptr:
134
135 * eval.h (scm_ceval, scm_deval, scm_ceval_ptr), debug.h
136 (scm_ceval_ptr): Deprecated. Moved declaration of scm_ceval_ptr
137 from debug.h to eval.h.
138
139 * debug.h (SCM_RESET_DEBUG_MODE): Don't access scm_ceval_ptr any
140 more, just leave it with setting scm_debug_mode_p, which is
141 equivalent for practical purposes.
142
143 * deprecated.h (SCM_XEVAL, SCM_XEVALCAR): Call scm_i_eval_x
144 instead of *scm_ceval_ptr. Leave all evaluating to scm_i_eval_x.
145
146 * gdbint.c (gdb_eval): Call scm_i_eval_x instead of scm_ceval.
147
148 * eval.c (ceval, deval, scm_ceval, scm_deval): Made scm_ceval
149 static and renamed it to ceval throughout. Provide a new exported
150 but deprecated function scm_ceval as a wrapper for backwards
151 compatibility. The same is done for the deval/scm_deval pair of
152 functions.
153
154 * eval.c (CEVAL, SCM_CEVAL): Renamed SCM_CEVAL to CEVAL
155 throughout. Defined CEVAL to ceval or deval, based on compilation
156 phase.
157
158 * eval.c (SCM_XEVAL, SCM_XEVALCAR): Dispatch on scm_debug_mode_p
159 to ceval and deval instead of calling *scm_ceval_ptr.
160
161 * eval.c (dispatching_eval): New deprecated static function.
162
163 * eval.c (scm_ceval_ptr): Initialized to dispatching_eval in order
164 to emulate its old behaviour as closely as possible.
165
166
167 Change the evaluator such that only expressions for which pair? is
168 true are passed to CEVAL, and such that all other expressions are
169 evaluated outside of CEVAL:
170
171 * eval.c (EVAL): New, provided in analogy to EVALCAR. Evaluate an
172 expression that is assumed to be memoized already. All but
173 expressions of the form '(<form> <form> ...)' are evaluated inline
174 without calling an evaluator.
175
176 * eval.c (SCM_XEVAL, SCM_XEVALCAR, EVALCAR): Evaluate all but
177 expressions of the form '(<form> <form> ...)' inline without
178 calling an evaluator.
179
180 * eval.c (scm_i_eval_x, scm_i_eval, scm_ceval, scm_deval): Handle
181 the special case of unmemoized symbols passed on the top level.
182
183 * eval.c (CEVAL): Change calls to CEVAL to EVAL, except where it
184 is known that the expression passed to CEVAL is of the form
185 '(<form> <form> ...)'. Remove handling of the tc7-objects, since
186 now it is known that the input expression of CEVAL is a pair.
187
1882004-03-29 Dirk Herrmann <dirk@dirk-herrmanns-seiten.de>
5fb64383
DH
189
190 * eval.c (is_self_quoting_p): New static function.
191
192 (scm_m_quote): Use is_self_quoting_p.
193
194 (copy_tree): Corrected typo in comment.
195
84fad130 196>>>>>>> 1.2042
702551e6
HWN
1972004-03-28 Han-Wen Nienhuys <hanwen@xs4all.nl>
198
bfefbf18
HWN
199 * eval.c (s_scm_copy_tree): idem.
200
201 * list.c (s_scm_filter): remove "pointer" from doc string.
202
702551e6
HWN
203 * gc.h (SCM_GC_CELL_TYPE): SCM_GC_CELL_TYPE uses SCM_GC_CELL_OBJECT.
204
205 * goops.h (SCM_NUMBER_OF_SLOTS): don't SCM_UNPACK the result.
206
207 * backtrace.c ("display_backtrace_body"): SCM_PACK before SCM_EQ_P
208 (display_frame): idem.
209 (display_backtrace_file_and_line): idem.
210
211 * tags.h (SCM_UNPACK): stricter typechecking on SCM_UNPACK
212 arguments.
213
3cd23214
KR
2142004-03-26 Kevin Ryde <user42@zip.com.au>
215
88a7ae1f
KR
216 * filesys.c (scm_getcwd, scm_readlink): Avoid memory leak on errors.
217
3cd23214
KR
218 * numbers.c (scm_modulo): For inum/big and big/big, remove test of
219 big==0 since that never occurs.
220
221 * numbers.c, numbers.h (scm_modulo_expt): Renamed from
222 scm_modular_expt, matching scheme level name `modulo-expt'.
223
224 * numbers.c (scm_modular_expt): Return a negative remainder for a
225 negative divisor, the same as `modulo' does.
226
2272004-03-26 Eric Hanchrow <offby1@blarg.net>
228
229 * numbers.c, numbers.h (scm_modular_expt): New function.
230
2926035a
KR
2312004-03-25 Kevin Ryde <user42@zip.com.au>
232
233 * numbers.c (scm_min, scm_max): Correction to big/real and real/big,
234 return inexact as required by r5rs.
235
62360b89
DH
2362004-03-24 Dirk Herrmann <dirk@dirk-herrmanns-seiten.de>
237
238 * eval.c: Separated some definitions relevant for execution from
239 the memoization part of the file.
240
241 (copy_tree): New static function
242
243 (scm_copy_tree): Rewritten to fix two kinds or bugs: First, cyclic
244 structures are detected now and will lead to an exception instead
245 of forcing guile to run in an endless loop, using up all the
246 system's memory. Second, arrays in the cdr of an improper list
247 are now copied. See the new test cases in eval.test.
248
2492004-03-24 Dirk Herrmann <dirk@dirk-herrmanns-seiten.de>
b28f5b3c
DH
250
251 * posix.c (scm_gethostname): Make sure len is initialised before
252 it is used. Restructured to (hopefully) represent possible
253 configurations more clearly in the code. Added unwind handler.
254
3bd3bae8
KR
2552004-03-23 Kevin Ryde <user42@zip.com.au>
256
257 * posix.c (scm_gethostname): Use sysconf(_SC_HOST_NAME_MAX) and/or
258 MAXHOSTNAMELEN when available.
259
254bf78d
MV
2602004-03-21 Marius Vollmer <mvo@zagadka.de>
261
262 * read.c (skip_scsh_block_comment): Also recognize '\r' as a line
263 terminator. Rewritten the logic as a state machine, I must have
264 been doing too much VHDL lately...
265
266 * eval.c (scm_ceval, scm_deval): Explicitely evaluate ports to
267 themselves. Thanks to Han-Wen Nienhuys!
268
269 * list.c: Changed docstrings so that they no longer talk about
270 returning 'pointers' to something.
271
009c34a2
HWN
2722004-03-20 Han-Wen Nienhuys <hanwen@xs4all.nl>
273
274 * gc.c: remove set_debug_cell_accesses! when
275 SCM_DEBUG_CELL_ACCESSES is not defined. Scheme source code should
276 use (if (defined? 'set-debug-cell-accesses!) .. ) to switch on
277 debugging conditionally.
278
54733c95
KR
2792004-03-21 Kevin Ryde <user42@zip.com.au>
280
281 * stime.c (scm_gmtime): Use gmtime_r when available, for thread safety.
282
bbaf8747
KR
2832004-03-20 Kevin Ryde <user42@zip.com.au>
284
285 * posix.c (scm_gethostname): Preserve errno across free() call.
286
726f82e7
HWN
2872004-03-18 Han-Wen Nienhuys <hanwen@xs4all.nl>
288
289 * gc-card.c (sweep_card): use SCM_GC_SET_CELL_WORD for setting
290 free cells.
291
e1350d6a
KR
2922004-03-14 Kevin Ryde <user42@zip.com.au>
293
294 * stime.c: Define _GNU_SOURCE for strptime prototype from glibc.
295 (strptime): Use HAVE_DECL_STRPTIME for when to give own prototype.
296
62055253
KR
2972004-03-07 Kevin Ryde <user42@zip.com.au>
298
299 * stime.c (scm_gmtime): Return bd_time->tm_zone when available, rather
300 than "GMT" always.
301 (filltime): Make zname parameter "const".
302
92e64b87
MD
3032004-03-03 Mikael Djurfeldt <mdj@chunk.mit.edu>
304
305 * threads.c, threads.h (scm_c_scm2thread): New function.
306
004ad931
KR
3072004-02-29 Kevin Ryde <user42@zip.com.au>
308
309 * numbers.c (guile_ieee_init): Use C99 INFINITY and NAN when
310 available. Test HAVE_DINFINITY and HAVE_DQNAN for those globals, in
311 particular don't assume "defined (__alpha__) && ! defined (linux)"
312 means OSF. Remove "SCO" code, which was not really SCO specific and
313 which John W. Eaton advises should be long past being needed.
314
315 * posix.c (scm_execl, scm_execlp, scm_execle): Avoid memory leak under
316 error throw.
317
72ea45ac
KR
3182004-02-24 Kevin Ryde <user42@zip.com.au>
319
320 * posix.c (scm_cuserid): Use a private result buffer, for thread safe.
321
2af0602e
KR
3222004-02-22 Kevin Ryde <user42@zip.com.au>
323
324 * numbers.c (scm_max, scm_min): For one arg, dispatch to generic for
325 complex, same as for two args. (Handle only inum, big, real, frac).
326
b114eafe
KR
3272004-02-21 Kevin Ryde <user42@zip.com.au>
328
329 * posix.c (scm_crypt): Use new HAVE_CRYPT.
330 (<crypt.h>): Remove HAVE_LIBCRYPT condition.
db752bb5 331 Reported by Andreas Voegele.
b114eafe 332
1e55d288
NJ
3332004-02-20 Neil Jerram <neil@ossau.uklinux.net>
334
335 * list.c (scm_list_n): Add #if SCM_DEBUG_CELL_ACCESSES_P around
336 validation.
337
338 * read.c (scm_lreadparen): Removed.
339 (scm_lreadparen1): Renamed scm_i_lreadparen.
340
eb741d98
HWN
3412004-02-20 Han-Wen Nienhuys <hanwen@xs4all.nl>
342
343 * list.c (scm_list_n): validate non-immediate arguments;
344 this will catch forgotten a SCM_UNDEFINED.
345
4e28ba5e
MV
3462004-02-18 Marius Vollmer <mvo@zagadka.de>
347
348 * gc.h (scm_gc_cells_collected): Removed duplicated declaration.
349 Thanks to Bill Schottstaedt!
350
351 * socket.h (scm_gethost): Removed prototype it is already in
352 "net_db.h". Thanks to Bill Schottstaedt!
353
ef861ead
KR
3542004-02-18 Kevin Ryde <user42@zip.com.au>
355
356 * num2integral.i.c (INTEGRAL2BIG): WORDS_BIGENDIAN not right for word
357 order parameter to mpz_import, in fact with just one word there's no
358 order to worry about at all.
359
360 * numbers.c (scm_num_eq_p): For real==frac, complex==frac, frac==real
361 and frac==complex, make an exact comparison rather than converting
362 with fraction2double.
363
364 * posix.c, putenv.c, stime.c (environ): Use _NSGetEnviron in Darwin
365 shared library, since environ is not directly available there.
366
367 * script.c (scm_shell_usage): Print to stdout for --help, per GNU
368 standard.
369
370 * stime.c (scm_localtime, scm_gmtime, scm_mktime): Provide a default
371 errno EINVAL in case localtime and gmtime don't set it.
372 (scm_mktime, scm_strptime): Forcibly use errno EINVAL for our
373 SCM_SYSERROR, since mktime and strptime generally don't set errno.
374
ae43d08e 3752004-02-16 Kevin Ryde <kevin@swox.se>
292dfa7f 376
c9ea6462
KR
377 * gc-malloc.c (scm_done_malloc, scm_done_free): Allow negative sizes,
378 which were permitted in the past for these.
379
292dfa7f
KR
380 * num2float.i.c (NUM2FLOAT): Expand isfinite to !xisinf, as per
381 previous change to numbers.c.
382
ae43d08e
KR
383 * script.c (scm_shell_usage): Print bug-guile email address, as per
384 GNU standard. Reported by Han-Wen Nienhuys.
385
711a9fd7
MD
3862004-02-13 Mikael Djurfeldt <djurfeldt@nada.kth.se>
387
388 * unif.c (scm_make_uve): Removed local variable and simplified
389 code in order to avoid compiler used uninitialized warnings.
390
391 * hashtab.c, hashtab.h (scm_hash_map_to_list): Renamed from
392 scm_hash_map.
393 (scm_hash_fold): Use scm_call_3 directly in the call to
394 scm_internal_hash_fold instead of going via fold_proc (which is
395 now removed).
396 (scm_hash_for_each): Use a trampoline +
397 scm_internal_hash_for_each_handle.
398 (scm_internal_hash_for_each_handle, scm_hash_for_each_handle): New
399 functions.
400
3da7f6b2
KR
4012004-02-12 Kevin Ryde <user42@zip.com.au>
402
344a212f
KR
403 * ports.c (scm_port_line): In docstring, note first line is 0.
404 (scm_set_port_line_x): In docstring, note first line is 0.
405 (scm_port_column): In docstring, there's no default to current input
406 port, and remove shared port-line @defun.
407 (scm_set_port_column_x): In docstring, there's no default to current
408 input port, note first column is 0, remove shared set-port-line!
409 @defun.
410
3da7f6b2
KR
411 * ramap.c (scm_array_fill_x): For fvect and dvect, use scm_num2dbl to
412 convert args the same way that array-set! does.
413
414 * unif.c (scm_make_uve, scm_array_p): Allow fraction 1/3 as prototype
415 for dvect.
416 (scm_array_p): Add missing "break"s in switch, fix llvect test look
417 for "l" not "s", fix dvect to be false for singp(prot) since such a
418 value is for fvect.
419 (scm_array_prototype): Return 1/3 for dvect, rather than 0.33..33.
88531a74
KR
420 (exactly_one_third): New variable.
421 (scm_init_unif): Initialize it.
3da7f6b2 422
cd21f5eb
NJ
4232004-02-10 Neil Jerram <neil@ossau.uklinux.net>
424
425 * read.c (scm_read_opts): Change `escaped-parens' to
426 `elisp-strings'.
427
16353acc
NJ
4282004-02-08 Neil Jerram <neil@ossau.uklinux.net>
429
430 * read.c (scm_read_opts): New opts `elisp-vectors' and
431 `escaped-parens'.
432 (s_vector): New.
433 (scm_lreadr): Use scm_lreadparen1 instead of scm_lreadparen. Make
434 handling of elisp vector syntax dependent on SCM_ENABLE_ELISP and
435 `elisp-vectors' option instead of SCM_ELISP_READ_EXTENSIONS.
436 Allow "\(" and "\)" in strings when SCM_ENABLE_ELISP defined and
437 `escaped-parens' option set.
438 (scm_read_token): If elisp vector syntax active, disallow [ and ]
439 in tokens.
440 (scm_lreadparen): Rewrite as interface to scm_lreadparen1.
441 (scm_lreadparen1): New.
442
443 * read.h: Remove conditionally compiled last arg to
444 scm_lreadparen.
445 (SCM_ELISP_VECTORS_P, SCM_ESCAPED_PARENS_P): New.
446
f62b9dff
HWN
4472004-01-23 Han-Wen Nienhuys <hanwen@xs4all.nl>
448
449 * eval.c (m_expand_body): remove stray variable new_body.
450
ef5b6b61
MV
4512004-01-22 Marius Vollmer <mvo@zagadka.de>
452
453 * eval.c (m_expand_body): Rewrite the expression in place (by
454 overwriting FORMS) also when a letrec is constructed, not only
455 when no definitions are found. Do not return rewritten expression
456 to emphasize the in-place rewriting. Changed all users.
457
7eec4c37
HWN
4582004-01-19 Han-Wen Nienhuys <hanwen@xs4all.nl>
459
460 * gc.c: add protected_object_count, a number that is dumped from
461 gc_stats()
462
25ffbdac
MV
4632004-01-11 Marius Vollmer <mvo@zagadka.de>
464
465 * dynwind.h, dynwind.c (scm_frame_unwind,
466 scm_frame_unwind_handler): Renamed and changed all uses.
467 (scm_frame_rewind, scm_frame_rewind_handler): Likewise.
468
08568c95
KR
4692004-01-11 Kevin Ryde <user42@zip.com.au>
470
471 * unif.c (scm_bit_count, scm_bit_position, s_scm_bit_set_star_x,
472 s_scm_bit_count_star, s_scm_bit_invert_x): Clarify docstrings, as per
473 changes made to scheme-compound.texi.
474
5565749c
MV
4752004-01-10 Marius Vollmer <mvo@zagadka.de>
476
25ffbdac
MV
477 * print.c (scm_print_symbol_name): Handle #{`foo}#, #{,foo}#,
478 #{.}#, and all numeric strings specially. Thanks to Paul Jarc!
479
480 * guile-snarf.in: Use mkdir to create a unique temporary directory
481 that we can safely use. Thanks to Stefan Nordhausen!
5565749c 482
fc6bb283
MV
4832004-01-07 Marius Vollmer <marius.vollmer@uni-dortmund.de>
484
7ebccde8
MV
485 * dynwind.h, dynwind.c (scm_i_dowinds): Removed 'explicit'
486 argument since it is always zero now. Changed all callers.
487 Removed code for handling fluids.
96e3b2f8
MV
488
489 * fluids.c (scm_c_with_fluids): Use frames instead of adding to
490 the wind chain explicitely. Use scm_c_with_fluid for the common
491 case of only one fluid.
492 (scm_with_fluid): New.
493 (scm_c_with_fluid): Use frames instead of scm_c_with_fluids.
494
fc6bb283 495 * fluids.h, fluids.c (scm_frame_fluid): New.
96e3b2f8
MV
496 (scm_with_fluid): New.
497 (scm_i_swap_fluids, scm_i_swap_fluids_reverse): Removed.
fc6bb283
MV
498
499 * dynwind.c (scm_frame_end): Do not use scm_i_dowinds. Instead,
500 do the unwinding directly. It is simple enough.
501
502 * dynwind.h, dynwind.c: Did the following renamings:
503 scm_begin_frame -> scm_frame_begin,
504 scm_end_frame -> scm_frame_end,
505 scm_on_unwind -> scm_frame_unwind,
506 scm_on_rewind -> scm_frame_rewind,
507 scm_on_unwind_with_scm -> scm_frame_unwind_with_scm,
508 scm_on_rewind_with_scm -> scm_frame_rewind_with_scm.
509 Changed all uses.
510
511 * aync.h, async.c: Did the follwing renamings:
512 scm_with_blocked_asyncs -> scm_frame_block_asyncs,
513 scm_with_unblocked_asyncs -> scm_frame_unblock_asyncs.
514 Changed all uses.
515
516 * ports.h, ports.c: Did the follwing renamings:
517 scm_with_current_input_port -> scm_frame_current_input_port,
518 scm_with_current_output_port -> scm_frame_current_output_port,
519 scm_with_current_error_port -> scm_frame_current_error_port.
520 Changed all uses.
521
298ab996
KR
5222004-01-07 Kevin Ryde <user42@zip.com.au>
523
524 * numbers.c (s_bignum): Remove, not used since gmp bignums.
525 Reported by Richard Todd.
526
ba40113e
KR
527 * threads-plugin.h (SCM_MUTEX_MAXSIZE): Increase to 12*sizeof(long),
528 for the benefit of powerpc-apple-darwin5.5. Reported by Richard Todd.
529
298ab996
KR
530 * unif.c (scm_aind): Test SCM_CONSP rather than !SCM_NULLP while
531 traversing the args list, fixes segv if an improper list is given.
532 Reported by Rouben Rostamian.
533
aacff585
MV
5342004-01-06 Marius Vollmer <marius.vollmer@uni-dortmund.de>
535
536 * ports.c (swap_ports, scm_with_current_foo_port): Do not allocate
537 swap_data on stack, use a 'malloc obj'.
538
539 * fluids.h, fluids.c (scm_make_initial_fluids, scm_copy_fluids,
540 scm_swap_fluids, scm_swap_fluids_reverse): Renamed to
541 scm_i_... since they are internal. Changed all uses.
542
543 * dynwind.c (frame_print): Removed, use the default printer.
544 (WINDER_F_MARK, WINDER_MARK_P, winder_mark): New.
545 (scm_on_unwind_with_scm, scm_on_rewind_with_scm): New. Use above
546 to protect SCM values.
547
548 * dynwind.h (SCM_F_WIND_EXPLICITELY,
549 SCM_F_WIND_EXPLICITLY): It's "explicitly" not "explicitely", damn.
550 Changed all uses.
551 (scm_on_unwind_with_scm, scm_on_rewind_with_scm): New.
552
49c00ecc
MV
5532004-01-05 Marius Vollmer <mvo@zagadka.de>
554
555 * ports.h, ports.c (scm_with_current_input_port,
556 scm_with_current_output_port, scm_with_current_error_port): New.
557
558 * async.h, async.c (scm_with_blocked_asyncs,
559 scm_with_unblocked_asyncs): New.
560
dab514a8
MV
5612004-01-03 Marius Vollmer <mvo@zagadka.de>
562
563 * dynwind.h, scm_dynwind.c (scm_t_frame_flags, scm_t_wind_flags,
564 scm_begin_frame, scm_end_frame, scm_on_unwind, scm_on_rewind):
565 New.
566 (scm_dowinds, scm_i_dowinds): scm_dowinds has been renamed to
567 scm_i_dowinds and extended to handle frames and to invoke a 'turn'
568 function when the outermost wind point has been reached. The
569 latter is used to copy a continuation stack at the right time.
570 scm_dowinds remains available.
571 (SCM_GUARDSP, SCM_BEFORE_GUARD, SCM_AFTER_GUARD, SCM_GUARD_DATA,
572 tc16_guard, guards_print): Removed.
573 (scm_internal_dynamic_wind): Reimplemented using frames.
574
575 * continuations.c (copy_stack): New, do only the stack copying
576 part of copy_stack_and_call.
577 (copy_stack_and_call): Copy the stack after unwinding and before
578 rewinding.
579 (scm_dynthrow): Do not call scm_dowinds, this is now done by
580 copy_stack_and_call.
581
441a25d9
KR
5822004-01-04 Kevin Ryde <user42@zip.com.au>
583
584 * numbers.c (scm_less_p): Don't convert frac to float for compares,
dab514a8 585 can give bad results due to rounding.
441a25d9 586
e0499207
KR
587 * stime.c (scm_current_time, scm_gettimeofday): Add a comment about
588 setzone/restorezone protection for DOS.
589
89fcf1b4
MV
5902003-12-26 Marius Vollmer <mvo@zagadka.de>
591
592 * gen-scmconfig.h.in, gen-scmconfig.c: Arrange for scm_t_intmax
593 and scm_t_uintmax to be defined in scmconfig.h
594
caff34d4
KR
5952003-12-03 Kevin Ryde <user42@zip.com.au>
596
597 * numbers.c (scm_less_p): Remove spurious xisnan from frac+big case.
598
599 * numbers.c (scm_make_ratio): Check for numerator equal to
600 SCM_MOST_NEGATIVE_FIXNUM and bignum denominator the negative of that,
601 giving integer -1.
602
603 * numbers.c (scm_real_part): Return fraction unchanged rather than
604 converting to flonum.
605
2d0b85ac
DH
6062003-11-30 Dirk Herrmann <D.Herrmann@tu-bs.de>
607
608 * modules.c (module_variable): Fixed (and thus simplified) the
609 definition of SCM_BOUND_THING_P to reflect the fact that since
610 after the 1.4 series of guile, obarrays only hold variable
611 objects.
612
2297981d
MV
6132003-11-30 Marius Vollmer <mvo@zagadka.de>
614
615 * numbers.c (scm_logand): It's "#b...", not "#\b...".
616
617 From Paul Jarc:
618
619 * read.c (scm_lreadr): Signal an error for invalid escape
620 sequences in strings. Code cleanups too.
621
622 * print.c (scm_iprin1): use \xNN hexadecimal sequences when
623 writing control characters in strings.
624
6252003-11-21 Marius Vollmer <mvo@zagadka.de>
626
627 * ports.c (scm_drain_input): Bug fix: only access the port after
628 checking that it indeed is one.
629
5c264007
DH
6302003-11-22 Dirk Herrmann <D.Herrmann@tu-bs.de>
631
632 * eval.c (s_bad_define): New static identifier.
633
634 (m_body): Fixed comment.
635
636 (scm_m_define): Don't generate memoized code for definitions that
637 are not on the top level. As a consequence, no memoized code at
638 all is generated for definitions any more: Top level definitions
639 are executed immediately during memoization and internal
640 definitions are handled separately in m_expand_body.
641
642 (scm_unmemocopy, unmemocopy): Removed code for unmemoizing
643 definitions. Consequently, there is no unmemoizing code any more
644 that might modify the environment. Thus, the old scm_unmemocopy
645 is removed and the old unmemocopy is renamed to scm_unmemocopy.
646
647 (SCM_CEVAL): The SCM_IM_DEFINE keyword can no longer occur in
648 memoized code. Call EVALCAR for continuations. Prefer !SCM_NULLP
649 over SCM_NIMP in places, where the argument is known to be part of
650 a proper list.
651
018d4730
KR
6522003-11-21 Kevin Ryde <user42@zip.com.au>
653
654 * numbers.c (scm_abs): Allocate a new real only for negatives, as done
655 for bignums.
656
657 * numbers.c (scm_bit_extract): Use mpz functions, rearrange inum case
658 to share some shifting.
659
660 * numbers.c (scm_integer_expt): Don't mpz_init after scm_i_clonebig or
661 scm_i_mkbig, since they do so already. Don't mpz_clear a bignum SCM,
662 since gc does this.
663
4bca30d8
MV
6642003-11-19 Marius Vollmer <mvo@zagadka.de>
665
fb16d26e
MV
666 * numbers.c (scm_make_ratio): Rewritten to have a simpler
667 structure. Previously, not all cases with a negative denominator
668 were covered.
669
4bca30d8
MV
670 * numbers.c (mem2decimal_from_point): use scm_divide instead of
671 scm_divide2real when forming the fractional part. This allows
672 "#e1.2" to yield 6/5.
673
674 * numbers.c (scm_i_fraction_equalp): Do not treat the return value
675 of scm_equal_p as a C boolean, use SCM_FALSEP. Previously, all
676 fractions were equal to each other regardless of value. Ooops.
677
678 * numbers.c (scm_rationalize): Return an inexact result when given
679 inexact arguments.
680
681 * numbers.c (scm_exact_p, scm_inexact_p): Throw error for
682 non-numbers.
683
bdf26b60
MV
6842003-11-18 Marius Vollmer <marius.vollmer@uni-dortmund.de>
685
686 Support for exact fractions from Bill Schottstaedt! Thanks!
687
688 * print.c (scm_iprin1): Handle fractions.
689
690 * objects.h (scm_class_fraction): New.
691 * objects.c (scm_class_fraction): New.
692 (scm_class_of): Handle fractions.
693
694 * hash.c (scm_hasher): Handle fractions.
695
696 * numbers.c: New code for handling fraction all over the place.
697 (scm_odd_p, scm_even_p): Handle inexact integers.
698 (scm_rational_p): New function, same as scm_real_p.
699 (scm_round_number, scm_truncate_number, scm_ceiling, scm_floor):
700 New exact functions that replace the inexact 'dsubr'
701 implementations.
702 (scm_numerator, scm_denominator): New.
703
704 * numbers.h (SCM_NUMP): Recognize fractions.
705 (SCM_FRACTIONP, SCM_SLOPPY_FRACTIONP, SCM_FRACTION_NUMERATOR,
706 SCM_FRACTION_DENOMINATOR, SCM_FRACTION_SET_NUMERATOR,
707 SCM_FRACTION_SET_DENOMINATOR, SCM_FRACTION_REDUCED_BIT,
708 SCM_FRACTION_REDUCED_SET, SCM_FRACTION_REDUCED_CLEAR,
709 SCM_FRACTION_REDUCED): New.
710 (scm_floor, scm_ceiling, scm_truncate_number, scm_round_number):
711 New prototypes.
712 (scm_make_ratio, scm_rationalize, scm_numerator, scm_denominator,
713 scm_rational_p): New prototypes.
714 (scm_i_dbl2num, scm_i_fraction2double, scm_i_fraction_equalp,
715 scm_i_print_fraction): New prototypes.
716
717 * goops.c (create_standard_classes): Create "<fraction>" class.
718
719 * gc-mark.c (scm_gc_mark_dependencies): Handle fractions.
720
721 * gc-card.c (scm_i_sweep_card): Include scm_tc16_fraction as a
722 case in the switch, but do nothing for now.
723
724 * eval.c (SCM_CEVAL, SCM_APPLY, call_dsubr_1): Convert fractions
725 to doubles when calling 'dsubr' functions.
726
727 * eq.c (scm_eqv_p, scm_equal_p): Handle fractions.
728
28fda544
RB
7292003-11-18 Rob Browning <rlb@defaultvalue.org>
730
731 * gen-scmconfig.c (main): remove public definition of
732 SCM_SIZEOF___INT64 and SCM_SIZEOF_UNSIGNED___INT64 and add
733 direct typedef of long_long and ulong_long inside deprecated block
734 when appropriate.
735
736 * deprecated.h: move long_long and ulong_long definitions to
737 gen-scmconfig.c so that we don't need to add SCM_SIZEOF___INT64
738 and SCM_SIZEOF_UNSIGNED___INT64 to the public namespace.
739
b58e7420
MV
7402003-11-17 Marius Vollmer <mvo@zagadka.de>
741
9a1d7d7c
MV
742 * hash.c (scm_string_hash): New hashing algorithm that takes the
743 complete string into account.
744
b58e7420
MV
745 * eval.c (scm_m_generalized_set_x): Macroexpand the target when it
746 is a list. This allows (@ ...) to work with set!.
9a1d7d7c
MV
747 (scm_m_generalized_set_x): Use ASSERT_SYNTAX_2 instead of
748 SCM_ASSYNT.
b58e7420
MV
749
750 * script.c (scm_compile_shell_switches): Use scm_c_read_string for
751 the "-e" option instead of scm_str2symbol. This allows things
752 like (@ ...) to be specified for the entry point.
753
461bffb1
DH
7542003-11-16 Dirk Herrmann <D.Herrmann@tu-bs.de>
755
756 * eval.c (scm_m_letstar): Create memoized code in place to
757 minimize consing.
758
6f81708a
DH
7592003-11-16 Dirk Herrmann <D.Herrmann@tu-bs.de>
760
761 * eval.c (s_splicing): Commented and reformulated.
762
763 (lookup_global_symbol, lookup_symbol): New static functions.
764
765 (s_test, s_bindings, s_duplicate_bindings, s_variable): Removed.
766
767 (try_macro_lookup, literal_p): Use lookup_symbol instead of
768 creating a temporary pair for scm_lookupcar.
769
770 (scm_unmemocar, unmemocar): Renamed scm_unmemocar to unmemocar,
771 created deprecated wrapper function scm_unmemocar.
772
773 (SCM_VALIDATE_NON_EMPTY_COMBINATION, scm_sym_else,
774 scm_sym_unquote, scm_sym_uq_splicing, scm_sym_enter_frame,
775 scm_sym_apply_frame, scm_sym_exit_frame, scm_sym_trace, f_apply,
776 undefineds, sym_three_question_marks): Moved around without
777 modifications.
778
779 * eval.c, eval.h (scm_macroexp, scm_unmemocar): Deprecated.
780
910b5125
DH
7812003-11-15 Dirk Herrmann <D.Herrmann@tu-bs.de>
782
783 * eval.c (try_macro_lookup, expand_user_macros, is_system_macro_p,
784 m_expand_body, scm_m_expand_body): Grouped together with m_body.
785 No further modifications.
786
c86c440b
DH
7872003-11-15 Dirk Herrmann <D.Herrmann@tu-bs.de>
788
789 * eval.c (s_mixed_body_forms): New static identifier.
790
791 (canonicalize_define, scm_m_define): The check for a bad
792 expression is performed in canonicalize_define now.
793
794 (try_macro_lookup, expand_user_macros, is_system_macro_p): New
795 static helper functions for m_expand_body.
796
797 (m_expand_body): Use ASSERT_SYNTAX to signal syntax errors. Only
798 expand user defined macros. Fixed handling of the definition/
799 expression boundary. Fixed handling of definitions grouped with
800 'begin. Use canonicalize_define to expand definitions.
801
3890131a
MV
8022003-11-13 Marius Vollmer <mvo@zagadka.de>
803
b58e7420
MV
804 * read.c (scm_lreadr): detect EOF after backslash, and interpret
805 \xNN hexadecimal sequences. From Paul Jarc, thanks!
806
5df36eac
MV
807 * snarf.h (SCM_SMOB, SCM_GLOBAL_SMOB, SCM_SMOB_MARK,
808 SCM_GLOBAL_SMOB_MARK, SCM_SMOB_FREE, SCM_GLOBAL_SMOB_FREE,
809 SCM_SMOB_PRINT, SCM_GLOBAL_SMOB_PRINT, SCM_SMOB_EQUALP,
810 SCM_GLOBAL_SMOB_EQUALP, SCM_SMOB_APPLY, SCM_GLOBAL_SMOB_APPLY):
811 New macros from Paul Jarc. Thanks!
812
3890131a
MV
813 * gc_os_dep.c (scm_get_stack_base): Provide a definition that
814 return NULL when the machine type is unknown. Previously,
815 gc_os_dep.c would refuse to compile.
816
430b8401
DH
8172003-11-09 Dirk Herrmann <D.Herrmann@tu-bs.de>
818
819 * eval.c (scm_m_body, m_body, scm_m_lambda, memoize_named_let,
820 scm_m_let, scm_m_letrec, m_expand_body): Renamed static function
821 scm_m_body to m_body.
822
328dc9a3
DH
8232003-11-09 Dirk Herrmann <D.Herrmann@tu-bs.de>
824
825 * eval.c, eval.h (scm_m_expand_body, m_expand_body): Deprecated
826 public use of scm_m_expand_body in eval.h. In eval.c, renamed
827 scm_m_expand_body to m_expand_body and made it static. Added
828 deprecated wrapper scm_m_expand_body.
829
830 (scm_eval_body, SCM_CEVAL, SCM_APPLY): Use m_expand_body instead
831 of scm_m_expand_body.
832
c2337a61
KR
8332003-11-09 Kevin Ryde <user42@zip.com.au>
834
835 * dynl.c (scm_dynamic_unlink): Need scm_list_1 on error message
836 argument. Reported by Mike Gran.
837
ced8edb0
DH
8382003-11-08 Dirk Herrmann <D.Herrmann@tu-bs.de>
839
840 * eval.c (s_missing_body_expression): New static identifier.
841
842 (s_body): Removed.
843
844 (scm_m_expand_body): Fixed core dump when passing a body with
845 defines, but without expressions (see additions to syntax.test).
846 Use ASSERT_SYNTAX to signal syntax errors.
847
0f572ba7
DH
8482003-11-02 Dirk Herrmann <D.Herrmann@tu-bs.de>
849
850 * eval.c (canonicalize_define): New static helper function.
851
852 (memoize_define, canonicalize_define): Extract handling of
853 function currying to canonicalize_define.
854
2510c810
DH
8552003-11-02 Dirk Herrmann <D.Herrmann@tu-bs.de>
856
857 * eval.c (scm_trampoline_0, scm_trampoline_1, scm_trampoline_2):
858 Make sure that error checking in debug mode is not worse than in
859 standard mode.
860
34adf7ea
DH
8612003-11-01 Dirk Herrmann <D.Herrmann@tu-bs.de>
862
863 * eval.c (scm_m_body, scm_m_lambda): Documentation strings are not
864 handled in scm_m_body any more, but rather in scm_m_lambda.
865
866 (scm_m_body, memoize_named_let, scm_m_let, scm_m_letstar,
867 scm_m_letrec, scm_m_expand_body): Check for validity is done by
868 calling functions of scm_m_body.
869
870 (scm_m_lambda): Avoid unnecessary consing when creating the
871 memoized code.
872
89bff2fc
DH
8732003-11-01 Dirk Herrmann <D.Herrmann@tu-bs.de>
874
875 * eval.c (s_expression): Added comment.
876
877 (s_empty_combination, error_unbound_variable): New static
878 identifiers.
879
880 (SCM_VALIDATE_NON_EMPTY_COMBINATION, SCM_EVALIM2, scm_lookupcar1):
881 Use ASSERT_SYNTAX, syntax_error or error_unbound_variable to
882 signal syntax errors.
883
884 (SCM_CEVAL): Separated handling of evaluator bytecodes and other
885 scheme objects.
886
60a49842
DH
8872003-10-25 Dirk Herrmann <D.Herrmann@tu-bs.de>
888
889 * eval.c (unmemocar, sym_three_question_marks, scm_unmemocar):
890 Grouped together with unmemocopy, without modifications.
891
892 (build_binding_list, unmemocopy): Renamed names of list arguments
893 and variables to reflect the actual order of the list elements.
894
70c1c108
DH
8952003-10-22 Dirk Herrmann <D.Herrmann@tu-bs.de>
896
897 * eval.c (s_defun): New static identifier.
898
899 (scm_m_nil_cond, scm_m_atfop, scm_m_undefine): Add comments. Use
900 ASSERT_SYNTAX to signal syntax errors. Avoid unnecessary consing
901 when creating the memoized code.
902
0ee39677
KR
9032003-10-19 Kevin Ryde <user42@zip.com.au>
904
905 * numbers.c (scm_ash): Revise docstring as per recent update to manual.
906
907 * numbers.c (scm_i_big2dbl): Rewrite, carefully rounding to "closest"
908 in accordance with R5RS, which just mpz_get_d doesn't really give.
909
9a848baf
DH
9102003-10-18 Dirk Herrmann <D.Herrmann@tu-bs.de>
911
912 * eval.c (s_bad_slot_number): New static identifier.
913
914 (scm_m_atslot_ref, scm_m_atslot_set_x): Use ASSERT_SYNTAX to
915 signal syntax errors. Avoid unnecessary consing when creating the
916 memoized code.
917
da48db62
DH
9182003-10-18 Dirk Herrmann <D.Herrmann@tu-bs.de>
919
920 * eval.c (scm_m_cont, scm_m_at_call_with_values,
921 scm_m_generalized_set_x): Use ASSERT_SYNTAX to signal syntax
922 errors. Avoid unnecessary consing when creating the memoized
923 code.
924
925 (scm_m_generalized_set_x): Let scm_m_set_x handle the R5RS
926 standard case. Make sure line and file information are copied to
927 every created expression.
928
82b3e2c6
DH
9292003-10-18 Dirk Herrmann <D.Herrmann@tu-bs.de>
930
931 * eval.c (scm_m_set_x, scm_m_apply, scm_m_atbind): Use
932 ASSERT_SYNTAX to signal syntax errors. Avoid unnecessary consing
933 when creating the memoized code.
934
935 (scm_m_atbind): Reversed the order, in which the init expressions
936 are stored and executed. The order of execution is now equal to
937 the order in which the initializers of the let-forms are executed.
938 Use check_bindings and transform_bindings.
939
940 (SCM_CEVAL): Eliminated SCM_NIMP in favor of more appropriate
941 !SCM_NULLP. Added some comments.
942
21628685
DH
9432003-10-18 Dirk Herrmann <D.Herrmann@tu-bs.de>
944
945 * eval.c: Sorted include files alphabetically.
946
947 (scm_m_begin): Added comment.
948
949 (scm_m_or): Use ASSERT_SYNTAX to signal syntax errors. Avoid
950 unnecessary consing when creating the memoized code.
951
952 (iqq, scm_m_quasiquote, scm_m_quote): Use ASSERT_SYNTAX to signal
953 syntax errors. Be more specific about the kind of error that was
954 detected.
955
956 (scm_m_quote, unmemocopy): As an optimization, vector constants
957 are now inserted unquoted into the memoized code. During
958 unmemoization the quotes are added again to provide syntactically
959 correct code.
960
d6754c23
DH
9612003-10-18 Dirk Herrmann <D.Herrmann@tu-bs.de>
962
963 * eval.c (scm_m_let, scm_m_letstar, scm_m_letrec,
964 scm_m_expand_body, check_bindings): Extracted syntax checking of
965 bindings to new static function check_bindings.
966
967 (scm_m_let, memoize_named_let): Extracted handling of named let to
968 new static function memoize_named_let.
969
970 (transform_bindings, scm_m_let, scm_m_letstar, scm_m_letrec): Use
971 ASSERT_SYNTAX to signal syntax errors. Be more specific about the
972 kind of error that was detected. Avoid use of SCM_CDRLOC. Avoid
973 unnecessary consing when creating the memoized code.
974
03a3e941
DH
9752003-10-12 Dirk Herrmann <D.Herrmann@tu-bs.de>
976
977 * eval.c (s_bad_formals, s_bad_formal, s_duplicate_formal): New
978 static identifiers.
979
980 (s_clauses, s_formals, s_duplicate_formals): Removed.
981
982 (scm_m_lambda): Use ASSERT_SYNTAX to signal syntax errors. Be more
983 specific about the kind of error that was detected. Prepare for
984 easier integration of changes for separated memoization.
985
da48db62 9862003-10-12 Dirk Herrmann <D.Herrmann@tu-bs.de>
4610b011
DH
987
988 * eval.c (s_duplicate_binding): New static identifier.
989
990 (scm_m_case): Call scm_c_memq instead of implementing it inline.
991
992 (scm_m_define): Added comment about how we check for duplicate
993 formals.
994
995 (scm_m_do): Added check for duplicate bindings.
996
997 (scm_m_if): Use ASSERT_SYNTAX to signal syntax errors. Avoid
998 unnecessary consing when creating the memoized code.
999
1000 (scm_c_improper_memq, c_improper_memq, scm_m_lambda): Renamed
1001 scm_c_improper_memq to c_improper_memq, since it is not exported.
1002
1003 (transform_bindings): Call scm_c_memq rather than
1004 scm_c_improper_memq.
1005
1006 (SCM_CEVAL): Simplified handling of SCM_IM_IF forms.
1007
da48db62 10082003-10-12 Dirk Herrmann <D.Herrmann@tu-bs.de>
a954ce1d
DH
1009
1010 * eval.c (s_bad_bindings, s_bad_binding, s_bad_exit_clause): New
1011 static identifiers.
1012
1013 (scm_m_do): Use ASSERT_SYNTAX to signal syntax errors. Be more
1014 specific about the kind of error that was detected. Avoid use of
1015 SCM_CDRLOC. Avoid unnecessary consing when creating the memoized
1016 code, this way also making sure that file name, line number
1017 information etc. remain available.
1018
da48db62 10192003-10-12 Dirk Herrmann <D.Herrmann@tu-bs.de>
8ae95199
DH
1020
1021 * eval.c (memoize_as_thunk_prototype): New static function.
1022
1023 (scm_m_delay, scm_m_future): Use memoize_as_thunk_prototype.
1024 Avoid unnecessary consing when creating the memoized code.
1025
9b9a35b6
KR
10262003-10-12 Kevin Ryde <user42@zip.com.au>
1027
1028 * list.c (scm_append): Track argument number and use in error.
1029
cc56ba80
DH
10302003-10-11 Dirk Herrmann <D.Herrmann@tu-bs.de>
1031
1032 * eval.c (s_missing_expression, s_bad_variable): New static
1033 identifiers.
1034
1035 (scm_m_define): Use ASSERT_SYNTAX to signal syntax errors. Prefer
1036 R5RS terminology for the naming of variables. Be more specific
1037 about the kind of error that was detected. Make sure file name,
1038 line number etc. are added to all freshly created expressions.
1039 Avoid unnecessary consing when creating the memoized code.
1040
609a8b86
DH
10412003-10-11 Dirk Herrmann <D.Herrmann@tu-bs.de>
1042
1043 * eval.c (s_extra_expression, s_misplaced_else_clause,
1044 s_bad_cond_clause, s_missing_recipient): New static identifiers.
1045
1046 (s_extra_case_clause): Removed.
1047
1048 (scm_m_case, scm_m_cond): If a clause appears after an else
1049 clause, report a misplaced else clause.
1050
1051 (scm_m_cond): Use ASSERT_SYNTAX to signal syntax errors. Be more
1052 specific about the kind of error that was detected. Handle bound
1053 'else and '=>. Avoid unnecessary consing when creating the
1054 memoized code.
1055
1056 (scm_m_cond, unmemocopy, SCM_CEVAL): Use SCM_IM_ELSE to memoize
1057 the syntactic keyword 'else and SCM_IM_ARROW to memoize the
1058 syntactic keyword '=>.
1059
58a2510b
DH
10602003-10-11 Dirk Herrmann <D.Herrmann@tu-bs.de>
1061
1062 * eval.c (scm_m_case): Allow empty lists of case labels.
1063
2a6f7afe
DH
10642003-10-11 Dirk Herrmann <D.Herrmann@tu-bs.de>
1065
1066 * tags.h (SCM_IM_ELSE, SCM_IM_ARROW): New memoizer codes.
1067
1068 * print.c (scm_isymnames): Add names for the new memoizer codes.
1069
1070 * eval.c (s_missing_clauses, s_bad_case_clause,
1071 s_extra_case_clause, s_bad_case_labels, s_duplicate_case_label,
1072 literal_p): New static identifiers.
1073
1074 (scm_m_case): Use ASSERT_SYNTAX to signal syntax errors. Be more
1075 specific about the kind of error that was detected. Check for
1076 duplicate case labels. Handle bound 'else. Avoid unnecessary
1077 consing when creating the memoized code.
1078
1079 (scm_m_case, unmemocopy, SCM_CEVAL): Use SCM_IM_ELSE to memoize
1080 the syntactic keyword 'else.
1081
e6729603
DH
10822003-10-10 Dirk Herrmann <D.Herrmann@tu-bs.de>
1083
1084 * eval.c (s_bad_expression, syntax_error_key, syntax_error,
1085 ASSERT_SYNTAX, ASSERT_SYNTAX_2): New static identifiers.
1086
1087 (scm_m_and): Use ASSERT_SYNTAX to signal syntax errors. Avoid
1088 unnecessary consing when creating the memoized code.
1089
9ddeb776
KR
10902003-10-09 Kevin Ryde <user42@zip.com.au>
1091
1092 * numbers.c (scm_inexact_to_exact): Don't depend on what double->long
1093 cast gives for values bigger than a long, or for nan or inf.
1094
df5af69a
DH
10952003-10-08 Dirk Herrmann <D.Herrmann@tu-bs.de>
1096
1097 * smob.h (scm_make_smob_type): Made the declaration match the
1098 definition.
1099
da0e6c2b
MV
11002003-10-07 Marius Vollmer <mvo@zagadka.de>
1101
1102 * goops.c, objects.h, smob.c, smob.h: Make type names char
1103 const * instead of char *. Thanks to Paul Jarc!
1104
591924eb
KR
11052003-10-02 Kevin Ryde <user42@zip.com.au>
1106
ff6ea7b9 1107 * strports.c (scm_call_with_output_string): scm_get_output_string
591924eb
KR
1108 rather than scm_strport_to_string, so as to guard against the port
1109 having been closed by the called procedure. Reported by Nic Ferrier.
1110
f03314f9
DH
11112003-09-18 Dirk Herrmann <D.Herrmann@tu-bs.de>
1112
1113 * numbers.h (SCM_INEXACTP): Removed uses of SCM_TYP16S.
1114
1115 * tags.h, deprecated.h (SCM_TYP16S): Deprecated and moved from
1116 tags.h to deprecated.h.
1117
534c55a9
DH
11182003-09-18 Dirk Herrmann <D.Herrmann@tu-bs.de>
1119
1120 This set of patches introduces a new tc7 code scm_tc7_number for
1121 numbers. Bignums, reals and complex numbers are turned from smobs
1122 into subtypes of scm_tc7_number.
1123
1124 * tags.h (scm_tc7_number): New.
1125
1126 * eq.c (scm_equal_p), eval.c (SCM_CEVAL), evalext.c
1127 (scm_self_evaluating_p), gc-card.c (scm_i_sweep_card), gc-mark.c
1128 (scm_gc_mark_dependencies), goops.c (create_smob_classes), hash.c
1129 (scm_hasher), numbers.c, numbers.h (SCM_NUMP), objects.c
1130 (scm_class_of), print.c (scm_iprin1), smob.c
1131 (scm_smob_prehistory): Don't handle bignums, reals and complex
1132 numbers as subtypes of scm_tc7_smob any more.
1133
1134 * numbers.h, tags.h (scm_tc16_big, scm_tc16_real,
1135 scm_tc16_complex): Moved definitions from tags.h to numbers.h.
1136
29c4382a
DH
11372003-09-18 Dirk Herrmann <D.Herrmann@tu-bs.de>
1138
1139 * numbers.c (scm_make_complex), gc-card.c (scm_i_sweep_card): Use
1140 sizeof (scm_t_complex) to determine the memory size of the
1141 malloc'd area for complex numbers.
1142
47ae1f0e
DH
11432003-09-17 Dirk Herrmann <D.Herrmann@tu-bs.de>
1144
1145 * numbers.c (scm_bigequal): Fixed.
1146
859b6b2f
MV
11472003-09-16 Marius Vollmer <mvo@zagadka.de>
1148
1149 * stime.c (scm_current_time): 'time' does not set errno so don't
1150 use SCM_SYSERROR for reporting errors.
1151
e17d318f
DH
11522003-09-16 Dirk Herrmann <D.Herrmann@tu-bs.de>
1153
1154 This set of patches eliminates the dependency between the
1155 implementation of evaluator specific memoization codes and special
1156 constants like #f, '() etc. ('flags'), which are not evaluator
1157 specific. The goal is to remove definitions of evaluator
1158 memoization codes completely from the public interface. This will
1159 make it possible to experiment more freely with optimizations of
1160 guile's internal representation of memoized code.
1161
1162 * objects.c (scm_class_of): Eliminate dependency on SCM_ISYMNUM.
1163
1164 * print.c (iflagnames): New array, holding the printed names of
1165 guile's special constants ('flags').
1166
1167 (scm_isymnames): Now holds only the printed names of the
1168 memoization codes.
1169
1170 (scm_iprin1): Separate the handling of memoization codes and
1171 guile's special constants.
1172
1173 * tags.h (scm_tc9_flag, SCM_ITAG9, SCM_MAKE_ITAG9, SCM_ITAG9_DATA,
1174 SCM_IFLAGNUM): new
1175
1176 (scm_tc8_char, scm_tc8_iloc, SCM_BOOL_F, SCM_BOOL_T,
1177 SCM_UNDEFINED, SCM_EOF_VAL, SCM_EOL, SCM_UNSPECIFIED, SCM_UNBOUND,
1178 SCM_ELISP_NIL, SCM_IM_DISPATCH, SCM_IM_SLOT_REF,
1179 SCM_IM_SLOT_SET_X, SCM_IM_DELAY, SCM_IM_FUTURE,
1180 SCM_IM_CALL_WITH_VALUES, SCM_IM_NIL_COND, SCM_IM_BIND): Changed
1181 values.
1182
1183 (SCM_IFLAGP): SCM_IFLAGP now only tests for flags.
1184
1185 (SCM_IFLAGP, SCM_MAKIFLAG, SCM_IFLAGNUM): Generalized to use the
1186 tc9 macros and scm_tc9_flag.
1187
eecac806
MV
11882003-09-15 Marius Vollmer <mvo@zagadka.de>
1189
1190 * posix.c (scm_setgroups): Check that the gid list is not too
1191 long. Thanks to Paul Jarc!
1192
22f2cf2d
DH
11932003-09-14 Dirk Herrmann <D.Herrmann@tu-bs.de>
1194
1195 * tags.h: Reduced the number of short instructions from 14 to 13.
1196 The typecode of the former 14th short instruction is now used to
1197 represent long instructions. Changed some comments to reflect
1198 this fact.
1199
1200 (SCM_MAKISYM): ISYMs get a new tc7 code, namely the one that was
1201 previously used by SCM_IM_DEFINE.
1202
1203 (SCM_IM_DEFINE): Turned into a long instruction.
1204
1205 * eval.c (unmemocopy, SCM_CEVAL): Treat SCM_IM_DEFINE as a long
1206 instruction.
1207
1208 * eval.c (SCM_CEVAL): Since characters and iflags have now a tc7
1209 code that is separate from all instructions, one level of dispatch
1210 for long instructions can be eliminated.
1211
1212 * print.c (scm_isymnames): Removed some commented code.
1213
62f548e1
MV
12142003-09-12 Marius Vollmer <mvo@zagadka.de>
1215
97a61c5f
MV
1216 * __scm.h (SCM_FENCE): Use __memory_barrier with the Intel
1217 compiler on IA64.
1218
50e0ba57
MV
1219 * hashtab.h (scm_tc16_hashtable): Added "extern" declaration.
1220
1221 * modules.c (scm_module_reverse_lookup): Check that the obarray
1222 really is a hashtable and do nothing if not.
1223
62f548e1
MV
1224 * inline.h: Use "extern inline" only with GCC. Use "static
1225 inline" else.
1226
0d5e3480
DH
12272003-09-06 Dirk Herrmann <D.Herrmann@tu-bs.de>
1228
1229 * numbers.h (SCM_INEXACTP, SCM_REALP, SCM_COMPLEXP): Removed uses
1230 of SCM_SLOPPY_INEXACTP, SCM_SLOPPY_REALP and SCM_SLOPPY_COMPLEXP.
1231
1232 * numbers.h, deprecated.h (SCM_SLOPPY_INEXACTP, SCM_SLOPPY_REALP,
1233 SCM_SLOPPY_COMPLEXP): Deprecated and moved from numbers.h to
1234 deprecated.h.
1235
6b412e91
DH
12362003-09-06 Dirk Herrmann <D.Herrmann@tu-bs.de>
1237
1238 * eq.c (scm_eqv_p, scm_equal_p): Removed uses of
1239 SCM_SLOPPY_INEXACTP, SCM_SLOPPY_REALP and SCM_SLOPPY_COMPLEXP.
1240
1241 * eq.c (scm_eqv_p, scm_equal_p): Reordered comparisons from
1242 0.0==some_expression to some_expression==0.0. The latter is
1243 better readable. The former is preferred by some people, since it
1244 leads to a compiler error when confusing == with =. However, when
1245 using gcc, a warning will be issued if in an if-statement an
1246 assigment appears. Since many Guile developers are using gcc,
1247 such errors will not remain unnoticed anyway. We can therefore
1248 focus on better readability.
1249
7e3b25bf
DH
12502003-09-04 Dirk Herrmann <D.Herrmann@tu-bs.de>
1251
1252 * tags.h: Added description of Guile's type system. Removed some
1253 old and misleading comments.
1254
3ea39242
DH
12552003-09-04 Dirk Herrmann <D.Herrmann@tu-bs.de>
1256
1257 * unit.c (scm_cvref): Eliminate unnecessary uses of SCM_NIMP,
1258 SCM_SLOPPY_REALP and SCM_SLOPPY_COMPLEXP.
1259
5d7d39ff
DH
12602003-09-04 Dirk Herrmann <D.Herrmann@tu-bs.de>
1261
1262 * numbers.h (SCM_MAKINUM): Define in terms of scm_tc2_int.
1263
1264 (SCM_INEXACTP, SCM_REALP, SCM_COMPLEXP): Define in terms of the
1265 respective SLOPPY macro.
1266
baa84a20
DH
12672003-09-04 Dirk Herrmann <D.Herrmann@tu-bs.de>
1268
1269 * eq.c (scm_equal_p): Use SCM_TYP7 to check if an object is of
1270 type string, not SCM_TYP7S.
1271
ba15f500
KR
12722003-09-03 Kevin Ryde <user42@zip.com.au>
1273
1274 * numbers.c (scm_lognot): Correction to docstring, ones-complement not
1275 2s-complement.
1276
53bb8782
KR
1277 * stime.c (scm_strptime): Add comment about glibc strptime %s and
1278 current timezone requiring SCM_DEFER_INTS.
1279
defdc4b4
NJ
12802003-08-30 Neil Jerram <neil@ossau.uklinux.net>
1281
1282 * script.c (scm_compile_shell_switches): Make -s switch optional
1283 if file to be loaded does not begin with a `-'. (Thanks to Aaron
1284 VanDevender for the patch!)
1285
0f008a15
KR
12862003-08-30 Kevin Ryde <user42@zip.com.au>
1287
1288 * numbers.c (scm_lognot): Rewrite using ~ and mpz_com, for directness
1289 and to have non-integer types rejected as per other logical funcs.
1290
438a3ba1
KR
12912003-08-28 Kevin Ryde <user42@zip.com.au>
1292
1293 * gc.h (scm_remember_upto_here_1): Revise comments on the asm form.
1294
98dceb37
KR
12952003-08-23 Kevin Ryde <user42@zip.com.au>
1296
1297 * simpos.c (scm_system): Remove SCM_DEFER_INTS, system() should be
1298 thread safe, and could take a long time too.
1299
1fa79a38
KR
13002003-08-22 Kevin Ryde <user42@zip.com.au>
1301
1302 * numbers.c (scm_difference): Correction to bignum - negative inum.
1303
d97f9b42
KR
13042003-08-14 Kevin Ryde <user42@zip.com.au>
1305
1306 * gc.h (scm_remember_upto_here_1, scm_remember_upto_here_2)
1307 [__GNUC__]: Use volatile asm macros rather than a function call.
1308 * gc.c (scm_remember_upto_here_1, scm_remember_upto_here_2): Undefine
1309 macros while defining functions.
1310
1311 * simpos.c (getenv): Use <stdlib.h> for prototype.
1312 (scm_system): In docstring, refer to status:exit-val rather than
1313 "functions above".
1314
b9052fcc
KR
13152003-08-09 Kevin Ryde <user42@zip.com.au>
1316
1317 * srcprop.c (scm_source_properties): Return plist from hash if it's a
1318 list set by source-properties! rather than an SRCPROPS object,
1319
8e5b4b9e
KR
13202003-07-29 Kevin Ryde <user42@zip.com.au>
1321
1322 * properties.c (scm_primitive_property_ref): In docstring, note
1323 parameters to not-found-proc, use hyphens rather than underscores for
1324 that parameter name.
1325 (scm_primitive_property_set_x): In docstring, VAL is the value
1326 parameter not CODE.
1327
20703ac4
MV
13282003-07-27 Marius Vollmer <mvo@zagadka.de>
1329
c6ccee34
MV
1330 * print.c (scm_print_symbol_name): handle more weird characters by
1331 escaping the symbol name properly. Thanks to Paul Jarc!
1332
2f4931bf
MV
1333 * posix.h (scm_setgroups): New prototype.
1334 * posix.c (scm_setgroups): New. Thanks to Paul Jarc!
1335 (scm_getgroups): Handle groups ids that don't fit into a fixnum.
1336 Don't use SCM_WRITABLE_VELTS.
1337
265c456f
MV
1338 * gc.h (SCM_GC_SET_CELL_BVEC): New.
1339 * gc-card.c (scm_i_init_card_freelist): Use it. Thanks to
1340 Matthias Koeppe!
1341
20703ac4
MV
1342 * __scm.h (SCM_C_INLINE_KEYWORD): New.
1343 * numbers.c: Use it in place of SCM_C_INLINE so that the code
1344 compiles when SCM_C_INLINE is undefined.
1345
59c4bb82
DH
13462003-07-24 Dirk Herrmann <D.Herrmann@tu-bs.de>
1347
1348 * __scm.h: Reformulated the architecture and compiler properties
1349 in terms of properties of scm_t_bits and SCM variables rather than
1350 in terms of c standard types. This is since it is not known which
1351 of the standard types scm_t_bits and SCM variables will be defined
1352 to.
1353
d7850c8d
KR
13542003-07-24 Kevin Ryde <user42@zip.com.au>
1355
1356 * numbers.c (scm_angle): Use scm_flo0 for non-negative inum, bignum
1357 and real.
1358
8a0c514f
KR
13592003-07-18 Kevin Ryde <user42@zip.com.au>
1360
1361 * numbers.c (scm_product): In complex * bignum, correction to
1362 REAL/IMAG fetch, x is the complex, not y.
1363
0aacf84e
MD
13642003-07-13 Mikael Djurfeldt <djurfeldt@nada.kth.se>
1365
1366 * numbers.c (scm_odd_p, scm_even_p): Bugfix: Treat result of
1367 scm_inf_p test as Scheme values.
1368 (scm_sum): Bugfix: Normalize bignum created from a negative bignum
1369 and a positive inum.
1370 Use GNU indentation style.
1371
192de9a4
DH
13722003-07-12 Dirk Herrmann <D.Herrmann@tu-bs.de>
1373
1374 * values.c (scm_values): Build lists of length 1 by using
1375 scm_list_1 instead of using scm_cons.
1376
bbb4438a
KR
13772003-07-10 Kevin Ryde <user42@zip.com.au>
1378
b58c85ce
KR
1379 * deprecation.c (scm_c_issue_deprecation_warning_fmt): Add va_end.
1380 * list.c (scm_list_n): Ditto.
1381
bbb4438a
KR
1382 * gc-malloc.c (scm_gc_realloc): Define "ptr" at start of function.
1383
287f8ad1
KR
13842003-07-08 Matthias Koeppe <mkoeppe@merkur.math.uni-magdeburg.de>
1385
1386 * tags.h (scm_t_bits, scm_t_signed_bits, etc): Avoid solaris empty
1387 defines of INTPTR_MAX and UINTPTR_MAX, combine conditionals for
1388 scm_t_bits and scm_t_signed_bits to avoid any chance of one and not
1389 the other using intptr_t.
1390
005d2366
KR
13912003-07-08 Kevin Ryde <user42@zip.com.au>
1392
0aacf84e 1393 * numbers.c (scm_make_polar): Use sincos, when available.
005d2366
KR
1394 (scm_magnitude): Use hypot.
1395
1396 * ports.c (scm_char_ready_p, scm_peek_char): In docstrings, don't use
1397 @footnote since it doesn't go through to guile-procedures.txt.
1398
1399 * threads.c (scm_call_with_new_thread): In docstring, use "( )"
1400 outside @var to quieten makeinfo, and use @code.
1401
cbfe8e62
HWN
14022003-07-06 Han-Wen Nienhuys <hanwen@cs.uu.nl>
1403
1404 * gc-malloc.c (decrease_mtrigger): new function
1405 (increase_mtrigger): new function, separate debug registering and
1406 mtrigger administration.
1407 (scm_gc_realloc): bugfix: do mtrigger administration before the
1408 actual realloc, for the realloc might invalidate a GC-d segment of
1409 memory. Thanks to Sam Hocevar for pointing this out.
1410 (scm_gc_realloc): use scm_malloc_reregister instead of
1411 unregistering and registering in sequence.
1412
aeb4c2e1
HWN
14132003-07-03 Han-Wen Nienhuys <hanwen@cs.uu.nl>
1414
1415 * __scm.h (SCM_ASSERT): change "else" expansion to "do { } while (0)"
1416
4c27f8d2
HWN
14172003-07-02 Han-Wen Nienhuys <hanwen@cs.uu.nl>
1418
1419 * __scm.h (SCM_ASRTGO): add "else" to macro expansions with if
1420 clauses.
1421
983e697d
MV
14222003-06-29 Marius Vollmer <mvo@zagadka.de>
1423
1424 * deprecated.h (SCM_OPDIRP, scm_fport, scm_option, scm_srcprops,
1425 scm_srcprops_chunk, scm_info_frame, scm_stack, scm_array,
1426 scm_array_dim, SCM_ARRAY_CONTIGUOUS, SCM_FUNC_NAME, SCM_WTA,
1427 RETURN_SCM_WTA, SCM_VALIDATE_NUMBER_COPY,
1428 SCM_VALIDATE_NUMBER_DEF_COPY, SCM_VALIDATE_OPDIR): Re-added from
1429 the release_1_6 branch.
1430
78b6566e
SJ
14312003-06-25 Stefan Jahn <stefan@lkcc.org>
1432
1433 * continuations.c: Redeclaration of getcontext() via the
1434 __asm__ ("getcontext") directive.
1435
1436 * continuations.h: Include <ucontext.h> instead of
1437 <sys/ucontext.h>.
1438
1ebb8497
KR
14392003-06-21 Kevin Ryde <user42@zip.com.au>
1440
1441 * numbers.c (_GNU_SOURCE): #define, to get C99 things.
1442 (scm_asinh, scm_acosh, scm_atanh, scm_truncate, $asinh, $acosh,
1443 $atanh, truncate): Use C library asinh, acosh, atanh and trunc, when
1444 available.
1445 (scm_inexact_to_exact): Expand isfinite to its definition !xisinf.
1446 (isfinite): Remove, conflicts with C99 isfinite().
1447
fbf85ba4
MV
14482003-06-19 Marius Vollmer <mvo@zagadka.de>
1449
1450 * deprecated.h, deprecated.c (scm_strhash, scm_sym2ovcell_soft,
1451 scm_sym2ovcell, scm_intern_obarray_soft, scm_intern_obarray,
1452 scm_symbol_value0, scm_string_to_obarray_symbol scm_intern_symbol,
1453 scm_unintern_symbol, scm_symbol_binding, scm_symbol_interned_p,
1454 scm_symbol_bound_p, scm_symbol_set_x, scm_gentemp): Re-added from
1455 the release_1_6 branch.
1456
fcc5d734
SJ
14572003-06-14 Stefan Jahn <stefan@lkcc.org>
1458
1459 * threads.h: Redefined scm_getspecific() and scm_setspecific()
1460 to be functions instead of macros.
1461
1462 * threads.c: Conditionalized inclusion of <sys/time.h> and
1463 <unistd.h>.
1464 (scm_getspecific, scm_setspecific): Made these two function
1465 real part of the API.
1466
1467 * posix.c (s_scm_putenv): Added some code to make a
1468 (putenv "FOO="), i.e. setting an empty string, work also on
1469 Win32 systems. Thanks to Kevin Ryde for the proposal.
1470
c3ae8e07
KR
14712003-06-12 Kevin Ryde <user42@zip.com.au>
1472
75b14838
KR
1473 * posix.c (scm_putenv): Free temporary ptr in mingw unset. Add
1474 freebsd to comment about need to use unsetenv.
c3ae8e07 1475
9d9fa092
MV
14762003-06-02 Marius Vollmer <mvo@zagadka.de>
1477
1478 * ports.c (scm_peek_char): Safe the column of the port around the
1479 getc/ungetc calls. Thanks to Dr. Peter Ivanyi!
1480
f2478375
KR
14812003-06-07 Kevin Ryde <user42@zip.com.au>
1482
1483 * tags.h: Use inttypes.h and stdint.h when available, for INTPTR_MAX
1484 and friends required by scm_t_bits setups.
1485
6375e040
DH
14862003-06-06 Dirk Herrmann <D.Herrmann@tu-bs.de>
1487
1488 * tags.h (scm_tc2_int): Added.
1489
1490 * tags.h (scm_tc3_int_1, scm_tc3_int_2): Expressed in terms of
1491 scm_tc2_int.
1492
1493 * tags.h (scm_tcs_cons_imcar, scm_tcs_cons_nimcar, scm_tcs_struct,
1494 scm_tcs_closures): Hard coded values replaced by symbolic ones.
1495
f5c6ec2f
DH
14962003-06-05 Dirk Herrmann <D.Herrmann@tu-bs.de>
1497
1498 * eval.c: Partially undid my patch from 2003-05-31. This patch
1499 caused the segfault referenced in the previous changelog entry.
1500
47dbd81e
DH
15012003-06-05 Dirk Herrmann <D.Herrmann@tu-bs.de>
1502
1503 * tags.h: Fixed comment about the immediate type code layout.
1504
1505 * eval.c: Fixed handling of non-special instructions. Without
1506 this patch, guile will segfault on (#\0) and similar instructions.
1507
3ec52c51
KR
15082003-06-05 Kevin Ryde <user42@zip.com.au>
1509
1510 * numbers.c (scm_max, scm_min): For inum, bignum and real, if other
1511 operand is NaN, then return NaN. Also avoid passing NaN to mpz_cmp_d.
1512
e418bd7c
KR
1513 * read.c (scm_input_error): Pass arg list parameter to scm_error_scm,
1514 rather than SCM_EOL. Needed by "Unknown # object" case in scm_lreadr.
1515
d0624e39
DH
15162003-06-04 Dirk Herrmann <D.Herrmann@tu-bs.de>
1517
1518 * __scm.h, gc-card.c (SCM_DEBUG_DEBUGGER_SUPPORT,
1519 SCM_DEBUG_DEBUGGING_SUPPORT): Renamed macro
1520 SCM_DEBUG_DEBUGGER_SUPPORT to SCM_DEBUG_DEBUGGING_SUPPORT and
1521 generalized it to apply not only to C level functions but also to
1522 scheme level functions.
1523
1524 * debug.c, debug.h, eval.c (make-iloc, scm_make_iloc, iloc?,
1525 scm_iloc_p, dbg-make-iloc, scm_dbg_make_iloc, dbg-iloc?,
1526 scm_dbg_iloc_p): Moved functions scm_make_iloc, scm_iloc_p to
1527 eval.c, made them available under SCM_DEBUG_DEBUGGING_SUPPORT == 1
1528 only and renamed them to scm_dbg_make_iloc, scm_dbg_iloc_p,
1529 respectively.
1530
1531 * deprecated.h, eval.c, eval.h (SCM_ILOC00, SCM_IDINC,
1532 SCM_IDSTMSK): Deprecated. The macro definitions are moved from
1533 eval.h into eval.c and a copy is placed into deprecated.h.
1534
1535 * eval.c, eval.h (SCM_MAKE_ILOC): Removed from eval.h and placed
1536 into eval.c. This definition was not part of the API in any
1537 officially released version of guile and thus does not need to go
1538 through a phase of deprecation.
1539
e90c3a89
DH
15402003-06-02 Dirk Herrmann <D.Herrmann@tu-bs.de>
1541
d0624e39
DH
1542 * deprecated.c, deprecated.h, eval.c, eval.h (scm_s_expression,
1543 scm_s_test, scm_s_body, scm_s_bindings, scm_s_variable,
1544 scm_s_clauses, scm_s_formals): Deprecated. In eval.c the
e90c3a89
DH
1545 definitions are make static and renamed from scm_s_xxx to s_xxx.
1546 In deprecated.c the original definitions are copied.
1547
d0624e39
DH
1548 * deprecated.h, eval.c, eval (SCM_EVALIM2, SCM_EVALIM, SCM_XEVAL,
1549 SCM_XEVALCAR): Deprecated. The macro definitions are moved from
e90c3a89
DH
1550 eval.h into eval.c and a copy (slightly modified to work in user
1551 code) is placed into deprecated.h.
1552
1553 * eval.c: Use the local static s_xxx definitions instead of the
1554 scm_s_xxx definitions throughout.
1555
14b18ed6
DH
15562003-06-01 Dirk Herrmann <D.Herrmann@tu-bs.de>
1557
1558 This set of patches separates the representation of the cxr family
1559 of functions (car, cdr etc.) from the dsubr family of functions
1560 (i. e. functions that take a double precision floating point
1561 argument). Further, the algorithm for handling the cxr function
1562 is improved.
1563
1564 * eval.c (SCM_CEVAL, SCM_APPLY, scm_trampoline_1), numbers.c
1565 (scm_asinh, scm_acosh, scm_atanh, scm_truncate, scm_round, floor,
1566 ceil, sqrt, fabs, exp, log, sin, cos, tan, asin, acos, atan, sinh,
1567 cosh, tanh), objects.c (scm_class_of), procprop.c
1568 (scm_i_procedure_arity), ramap.c (scm_array_map_x), tags.h
1569 (scm_tc7_dsubr, scm_tcs_subrs): Introduce scm_tc7_dsubr as new
1570 typecode for the dsubr family of functions.
1571
1572 * ramap.c (ramap_cxr, ramap_dsubr): Renamed ramap_cxr to
1573 ramap_dsubr.
1574
1575 * eval.c (SCM_CEVAL, SCM_APPLY, call_cxr_1), pairs.c
1576 (scm_init_pairs): Make use of the (now usable) second cell element
1577 of a scm_tc7_cxr function to implement the cxr family of functions
1578 more efficiently.
1579
2ca0d207
DH
15802003-05-31 Dirk Herrmann <D.Herrmann@tu-bs.de>
1581
1582 * eval.c (SCM_CEVAL, SCM_APPLY, scm_trampoline_0,
1583 scm_trampoline_1, scm_trampoline_2): Postpone error cases to the
1584 end of an if-else-if-sequence of checks.
1585
9a069bdd
DH
15862003-05-30 Dirk Herrmann <D.Herrmann@tu-bs.de>
1587
1588 * eval.c (SCM_CEVAL): Improved readability of call-with-values
1589 execution. Generalize apply_closure to apply_proc and use that
1590 for call-with-values.
1591
e910e9d2
DH
15922003-05-30 Dirk Herrmann <D.Herrmann@tu-bs.de>
1593
1594 * eval.c (SCM_CEVAL): Avoid one level of indirection when applying
1595 a non closure.
1596
1e498fbd
SJ
15972003-05-30 Stefan Jahn <stefan@lkcc.org>
1598
1599 * posix.c (s_scm_putenv): Use the new HAVE_UNSETENV
1600 appropriately for mingw32 hosts.
1601
1602 * numbers.h: Defining copysign(), isnan() and finite() to
1603 be prefixed by a single '_' for mingw32 hosts.
1604
c47e2599
KR
16052003-05-30 Kevin Ryde <user42@zip.com.au>
1606
1607 * numbers.c (z_negative_one): New variable.
1608 (scm_init_numbers): Initialize it.
1609 (scm_logcount): Use it and mpz_hamdist to count zeros for negatives.
1610
2e945bcc
SJ
16112003-05-29 Stefan Jahn <stefan@lkcc.org>
1612
1613 * win32-dirent.c: Use malloc() instead of scm_malloc().
1614
1615 * stime.c (s_scm_strftime): Add a type cast to avoid compiler
1616 warning.
1617
1618 * posix.c (s_scm_putenv): Disable use of unsetenv() for the
1619 mingw32 build.
1620
1621 * modules.c (s_scm_module_import_interface): Renamed local
1622 variable interface to _interface. Seems like 'interface'
1623 is a special compiler directive for the mingw32 compiler.
1624
1625 * mkstemp.c: Provide prototype to avoid compiler warning.
1626
1627 * load.c (s_scm_search_path): Fixed absolute and relative
1628 path detections for native Windows platforms.
1629
1630 * gc.h, threads.h: Export some more symbols using SCM_API (necessary
1631 to build on mingw32).
1632
1633 * gc-freelist.c ("s_scm_map_free_list",
1634 "s_scm_gc_set_debug_check_freelist_x"): Fixed use of FUNC_NAME.
1635
1636 * fports.c (fport_fill_input): Disable use of
1637 fport_wait_for_input() on Win32 platforms.
1638
1639 * filesys.c (s_scm_basename): Fixed __MINGW32__ code.
1640
1641 * Makefile.am: Modified some rules for cross compiling.
1642
ddd8f927
DH
16432003-05-25 Dirk Herrmann <D.Herrmann@tu-bs.de>
1644
1645 * eval.c (SCM_CEVAL): In case of an application, all checks for a
1646 proper function object and the correct number of arguments are now
1647 performed in the application part of SCM_CEVAL.
1648
1649 (scm_badformalsp): Removed.
1650
f8ba2197
DH
16512003-05-25 Dirk Herrmann <D.Herrmann@tu-bs.de>
1652
1653 * deprecated.c (scm_read_and_eval_x): Fixed C99-ism.
1654
79f55b7c
MD
16552003-05-22 Mikael Djurfeldt <djurfeldt@nada.kth.se>
1656
a502595f
MD
1657 * num2integral.i.c (NUM2INTEGRAL): Avoid warning about conditional
1658 always being false by inserting preprocessor conditional. (Thanks
1659 to Bruce Korb.)
1660
79f55b7c
MD
1661 * __scm.h (SCM_STACK_PTR): New macro. (Cast argument through
1662 (void *) in order to avoid an aliasing warning; thanks to Bruce
1663 Korb.)
1664
1665 * stackchk.h (SCM_STACK_OVERFLOW_P): Use SCM_STACK_PTR.
1666
1667 * threads.c (suspend, launch_thread, scm_threads_mark_stacks): Use
1668 SCM_STACK_PTR.
1669
1670 * threads.c (scm_threads_mark_stacks): Bugfix: Changed
1671 thread->base --> t->base.
1672
1673 * eval.c (SCM_CEVAL): Don't cast argument of SCM_STACK_OVERFLOW_P.
1674
47dee228
MV
16752003-05-20 Marius Vollmer <marius.vollmer@uni-dortmund.de>
1676
1677 * deprecated.h, deprecated.c (scm_makstr, scm_makfromstr,
1678 scm_variable_set_name_hint, scm_builtin_variable,
1679 scm_internal_with_fluids, scm_make_gsubr,
1680 scm_make_gsubr_with_generic, scm_create_hook, SCM_LIST0,
1681 SCM_LIST1, SCM_LIST2, SCM_LIST3, SCM_LIST4, SCM_LIST5, SCM_LIST6,
1682 SCM_LIST7, SCM_LIST8, SCM_LIST9, scm_listify, scm_sloppy_memq,
85494587
MV
1683 scm_sloppy_memv, scm_sloppy_member, scm_read_and_eval_x,
1684 scm_subr_entry, SCM_SUBR_DOC, scm_make_subr,
1685 scm_make_subr_with_generic, scm_make_subr_opt,
1686 scm_call_catching_errors, scm_make_smob_type_mfpe,
1687 scm_set_smob_mfpe, scm_strprint_obj, scm_read_0str, scm_eval_0str,
1688 SCM_CHARS, SCM_UCHARS, SCM_LENGTH): Re-added from the release_1_6
1689 branch. Some have been slightly rewritten.
1690 (scm_i_object_chars, scm_i_object_length): New, to support
1691 SCM_CHARS, SCM_UCHARS, and SCM_LENTH.
1692
e681d187
DH
16932003-05-19 Dirk Herrmann <D.Herrmann@tu-bs.de>
1694
1695 * eval.c (scm_m_do, unmemocopy, SCM_CEVAL): Reversed order of
1696 names and inits in the memoized code of do.
1697
7e59d9d4
MD
16982003-05-19 Mikael Djurfeldt <djurfeldt@nada.kth.se>
1699
1700 * c-tokenize.lex (yyget_lineno, yyget_in, yyget_out, yyget_leng,
1701 yyget_text, yyset_lineno, yyset_in, yyset_out, yyget_debug,
1702 yyset_debug, yylex_destroy): Added prototypes (otherwise we'll get
1703 a compilation error if error-on-warning is enabled).
1704
9950a42c
MV
17052003-05-17 Marius Vollmer <mvo@zagadka.de>
1706
1707 * c-tokenize.lex: Gobble up complete lines after a '#'. This
1708 removes preprocessor directives from the snarfage that might
1709 otherwise confuse us. These directives appear when compiling with
1710 "-g3", for example.
1711
0068984b
HWN
17122003-05-16 Han-Wen Nienhuys <hanwen@cs.uu.nl>
1713
26e68795
HWN
1714 * ChangeLog: add my surname
1715
0068984b
HWN
1716 * srcprop.c (scm_finish_srcprop): use
1717 scm_gc_register_collectable_memory()
1718 (scm_make_srcprops): idem.
1719
131805f0
HWN
17202003-05-14 Han-Wen Nienhuys <hanwen@cs.uu.nl>
1721
1722 * gc-malloc.c (scm_gc_register_collectable_memory): avoid
1723 wrap-around for scm_mtrigger
1724 (scm_gc_register_collectable_memory): abort on overflowing
1725 scm_mallocated().
1726
d4611024
KR
17272003-05-13 Kevin Ryde <user42@zip.com.au>
1728
1729 * numbers.c (xmpz_cmp_d): New macro, handling infs if gmp doesn't.
1730 (scm_num_eq_p, scm_less_p, scm_max, scm_min): Use it.
1731
7aaf8dc9
MD
17322003-05-12 Mikael Djurfeldt <djurfeldt@nada.kth.se>
1733
dfd03fb9
MD
1734 * backtrace.c (scm_display_error_message): Introduced fancy
1735 printing with max level 7 and length 10. (Purpose: avoid printing
1736 gigantic objects in error messages.)
1737
1738 * print.c, print.h (scm_i_port_with_print_state): New function.
1739
1740 * print.c (scm_iprin1, scm_printer_apply,
1741 scm_port_with_print_state): Use scm_i_port_with_print_state.
1742 (scm_simple_format): Modified not to destroy print states.
1743 (print_state_mutex): New mutex.
1744 (scm_make_print_state, scm_free_print_state, scm_prin1):
1745 Lock/unlock print_state_mutex.
1746
7aaf8dc9
MD
1747 * deprecated.h (SCM_GC8MARKP, SCM_SETGC8MARK, SCM_CLRGC8MARK):
1748 Use current names in definitions.
1749
a4d9ffa1
KR
17502003-05-10 Kevin Ryde <user42@zip.com.au>
1751
1752 * numbers.c (scm_num_eq_p, scm_less_p): Don't pass NaN to mpz_cmp_d.
1753
d25e96a4
KR
1754 * numbers.c (scm_integer_length): On negative bignums, adjust
1755 mpz_sizeinbase to account for it looking at absolute value where we
1756 want ones-complement.
1757
1758 * numbers.c (scm_gcd): In bignum/inum, don't pass yy==0 to mpz_gcd_ui
1759 since we're only using the ulong return value, and x might not fit.
1760
5bf6a6f0
DH
17612003-05-06 Dirk Herrmann <D.Herrmann@tu-bs.de>
1762
1763 * eval.c, eval.h, read.c, read.h (scm_sym_dot): Moved from eval to
1764 read. This will allow to make the definition in read.c static.
1765
f58c472a
DH
17662003-05-06 Dirk Herrmann <D.Herrmann@tu-bs.de>
1767
1768 * eval.c, eval.h, evalext.c, evalext.h (scm_m_undefine): Moved
1769 from evalext to eval. This will allow to make some of the
1770 definitions in eval.c static.
1771
90382aeb
KR
17722003-05-06 Kevin Ryde <user42@zip.com.au>
1773
1774 * numbers.c (scm_difference): In inum - bignum, handle negative inum.
1775 (scm_logcount): Use mpz_com, not mpz_neg.
1776
3b88ed2a
DH
17772003-05-04 Dirk Herrmann <D.Herrmann@tu-bs.de>
1778
1779 The purpose of this patch is to make guile's internal memoizers
1780 distinguishable from memoizing macros created on the scheme level
1781 or from user provided primitive memoizing macros. The reason is,
1782 that the internal memoizers are the only ones that are allowed to
1783 transform their scheme input into memoizer byte code, while all
1784 other memoizing macros may only transform scheme code into new
1785 scheme code.
1786
1787 To achieve this, a new macro type 'builtin-macro!' is introduced.
1788 Currently, 'builtin-macro!'s are handled as memoizing macros, but
1789 this will change when the memoizer and executor are separated.
1790
1791 * macros.[ch] (scm_i_makbimacro): New.
1792
1793 * macros.h (SCM_BUILTIN_MACRO_P): New.
1794
1795 * macros.c (macro_print, scm_macro_type): Support builtin-macro!s.
1796
1797 * eval.c, goops.c: All of guile's primitive memoizing macros are
1798 primitive builtin-macros now.
1799
1800 * eval.c (scm_macroexp, SCM_CEVAL): Make sure the primitive
1801 builtin-macros are handled equally to memoizing macros.
1802
b0780eb1
MV
18032003-05-04 Marius Vollmer <mvo@zagadka.de>
1804
1805 * throw.c (scm_ithrow): Remove "asm volatile" hack. It used to
1806 work around a bug in GCC 2.95.2 but is now a bug in itself.
1807
1cbf4fe9
MV
18082003-05-02 Marius Vollmer <mvo@zagadka.de>
1809
1810 * deprecated.h (scm_rstate, scm_rng, SCM_SLOPPY_CONSP,
1811 SCM_SLOPPY_NCONSP, scm_tc7_ssymbol, scm_tc7_msymbol,
1812 scm_tcs_symbols): New.
1813
1a61d41b
MV
18142003-04-30 Marius Vollmer <marius.vollmer@uni-dortmund.de>
1815
096ecbaf
MV
1816 * deprecated.h, deprecated.c (scm_protect_object,
1817 scm_unprotect_object, SCM_SETAND_CAR, SCM_SETOR_CAR,
1818 SCM_SET_AND_CDR, SCM_SET_OR_CDR, SCM_FREEP, SCM_NFREEP,
1819 SCM_GC8MARKP, SCM_SETGC8MARK, SCM_CLRGC8MARK, SCM_GCTYP16,
1820 SCM_GCCDR, scm_remember, scm_the_root_module, scm_make_module,
1821 scm_ensure_user_module, scm_load_scheme_module, scm_port,
1822 scm_ptob_descriptor, scm_port_rw_active,
1823 scm_close_all_ports_except): New.
1824
1a61d41b
MV
1825 * ports.c (scm_c_port_for_each): New function, mostly copied from
1826 scm_port_for_each.
1827 (scm_port_for_each): Reimplemented using scm_c_port_for_each.
1828 * ports.h (scm_c_port_for_each): New prototype.
1829
c8e1d354
MD
18302003-04-28 Mikael Djurfeldt <djurfeldt@nada.kth.se>
1831
1832 * eval.c (scm_m_atdispatch): Removed until actually needed. (This
1833 macro was introduced in anticipation of GOOPS method compilation
1834 code.)
1835
1836 * goops.c: Removed binding of @dispatch.
1837
a4aa2134
DH
18382003-04-28 Dirk Herrmann <D.Herrmann@tu-bs.de>
1839
1840 * eval.c, goops.c (@dispatch, @slot-ref, @slot-set!): Move the
1841 instructions that bind the macros on the scheme level back to
1842 goops.c in order to make sure again that the bindings go into the
1843 (oop goops) module and are not visible from the outside.
1844
9fbee57e
DH
18452003-04-27 Dirk Herrmann <D.Herrmann@tu-bs.de>
1846
1847 * eval.c: Non functional change: Separated R5RS and non-R5RS
1848 macros into different sections of the file and ordered the
1849 memoizers alphabetically.
1850
12841895
DH
18512003-04-27 Dirk Herrmann <D.Herrmann@tu-bs.de>
1852
1853 * eval.c (scm_ilookup): Rewritten to improve readability.
1854
6a3f13f0
DH
18552003-04-27 Dirk Herrmann <D.Herrmann@tu-bs.de>
1856
1857 * eval.c (scm_i_call_closure_0, call_closure_1, call_closure_2):
1858 Partially reverted patch from 2003-04-23 in oder to find a better
1859 compromise between readability and debuggability.
1860
b0c5d67b
DH
18612003-04-25 Dirk Herrmann <D.Herrmann@tu-bs.de>
1862
1863 * eval.c, eval.h, goops.c, goops.h (scm_m_atslot_ref,
1864 scm_m_atslot_set_x, scm_m_atdispatch): Move the declarations and
1865 definitions of the special goops memoizers from goops.[ch] to
1866 eval.[ch]. Hmm... it seems that scm_m_atdispatch is not used
1867 throughout guile.
1868
b9ad392e
MD
18692003-04-24 Mikael Djurfeldt <mdj@kvast.blakulla.net>
1870
1871 * ports.c, ports.h (scm_i_port_table_mutex): New mutex.
1872
1873 * fports.c (scm_evict_ports): Lock/unlock scm_i_port_table_mutex.
1874
1875 * ports.c (scm_close_port, scm_flush_all_ports): Ditto.
1876
1877 * ioext.c (scm_fdes_to_ports): Ditto.
1878
1879 * vports.c (scm_make_soft_port): Changed SCM_DEFER/ALLOW_INTS into
1880 lock/unlock scm_i_port_table_mutex.
1881
1882 * strports.c (scm_mkstrport): Ditto.
1883
1884 * ports.c (scm_void_port, scm_port_for_each): Ditto.
1885
1886 * fports.c (scm_fdes_to_port): Ditto.
1887
d0b07b5d
DH
18882003-04-23 Dirk Herrmann <D.Herrmann@tu-bs.de>
1889
1890 This set of patches contains no functional changes, only debatable
1891 minor stylistic ones. Still, in order to prepare a patch between
1892 my local copy and the CVS version, I decided to submit the changes
1893 below. Then, the patch will hopefully only contain relevant
1894 modifications :-)
1895
1896 * eval.c (iqq): Added const specifier.
1897
1898 * eval.c (scm_trampoline_0, scm_trampoline_1, scm_trampoline_2):
1899 Use NULL instead of 0 to indicate that a pointer is returned.
1900 Removed some misleading 'fall through' comments.
1901
1902 * eval.c (scm_i_call_closure_0, call_closure_1, call_closure_2):
1903 Split up long expressions into smaller ones to be more debugging
1904 friendly.
1905
a98e8e98
DH
19062003-04-23 Dirk Herrmann <D.Herrmann@tu-bs.de>
1907
1908 * eval.h (SCM_ENTER_FRAME_HDLR, SCM_APPLY_FRAME_HDLR,
1909 SCM_EXIT_FRAME_HDLR): Use SCM_PACK to convert data to a SCM value
1910 rather than casting to SCM.
1911
c178c3a6
DH
19122003-04-23 Dirk Herrmann <D.Herrmann@tu-bs.de>
1913
1914 * sort.c, pairs.h: Removed unnecessary includes.
1915
d339981a
DH
19162003-04-23 Dirk Herrmann <D.Herrmann@tu-bs.de>
1917
1918 * sort.c: Replaced hand-made trampline code by the new official
1919 mechanism from eval.c. This fixes a segfault in the new test file
1920 sort.test.
1921
1922 (quicksort, compare_function, scm_restricted_vector_sort_x,
1923 scm_sorted_p, scm_merge, scm_merge_list_x, scm_merge_x,
1924 scm_merge_list_step, scm_sort_x, scm_sort, scm_merge_vector_x,
1925 scm_merge_vector_step, scm_stable_sort_x, scm_stable_sort,
1926 scm_sort_list_x, scm_sort_list): Use trampoline mechanism from
1927 eval.c.
1928
1929 (subr2less, lsubrless, closureless, applyless, scm_cmp_function,
1930 cmp_fun_t): Removed.
1931
1932 (compare_function): Added.
1933
1934 * sort.c (quicksort, SWAP, stack_node): Replaced pointer
1935 arithmetics with index arithmetics. Changed quicksort to work on
1936 an array of SCM values instead of an array of characters. Avoid
1937 bytewise copying of SCM elements. Avoid allocating memory on the
1938 stack with alloca. Fixed some comments.
1939
821f18a4
DH
19402003-04-21 Dirk Herrmann <D.Herrmann@tu-bs.de>
1941
1942 * eval.c (EXTEND_ENV): Eliminated.
1943
1944 (unmemocopy, SCM_CEVAL, SCM_APPLY): Use SCM_EXTEND_ENV instead of
1945 EXTEND_ENV.
1946
94fb5a6e
DH
19472003-04-21 Dirk Herrmann <D.Herrmann@tu-bs.de>
1948
1949 * __scm.h (SCM_DEBUG_DEBUGGER_SUPPORT): New compile-time option.
1950
1951 * gc.card.c (scm_gc_marked_p): Fixed compiler warning when
1952 compiling with SCM_DEBUG==1 by moving definition behind prototype.
1953
1954 * gc.card.c (scm_dbg_t_list_cell, scm_dbg_t_double_cell,
1955 scm_dbg_gc_marked_p, scm_dbg_gc_get_card, scm_dbg_gc_get_bvec,
1956 scm_t_list_cell_struct, scm_t_list_cell, scm_t_double_cell,
1957 scm_gc_marked_p, scm_gc_get_card, scm_gc_get_bvec): Fixed
1958 functions such that they check if the object is a non-immediate.
1959 Further, renamed identifiers to use the scm_dbg_ prefix and made
1960 their inclusion into the lib dependent of the
1961 SCM_DEBUG_DEBUGGER_SUPPORT compile time option.
1962
fce0b22d
DH
19632003-04-21 Dirk Herrmann <D.Herrmann@tu-bs.de>
1964
1965 * __scm.h: Fixed comment about the SCM_DEBUG_TYPING_STRICTNESS
1966 debug option.
1967
1685446c
DH
19682003-04-21 Dirk Herrmann <D.Herrmann@tu-bs.de>
1969
821f18a4 1970 * list.c (scm_ilength, scm_last_pair), unif.c (l2ra): Prefer
1685446c
DH
1971 !SCM_CONSP over SCM_NCONSP. Now, guile itself does not include
1972 any calls to SCM_NCONSP any more.
1973
1974 * unif.c (l2ra): Eliminate redundant check.
1975
9ff1720f
DH
19762003-04-21 Dirk Herrmann <D.Herrmann@tu-bs.de>
1977
1978 * list.c (scm_cons_star), ramap.c (scm_ra_sum, scm_ra_product,
1979 scm_array_map_x), unif.c (l2ra): Prefer !SCM_NULLP over
1980 SCM_NNULLP. Now, guile itself does not include any calls to
1981 SCM_NNULLP any more.
1982
05b15362
DH
19832003-04-21 Dirk Herrmann <D.Herrmann@tu-bs.de>
1984
1985 * eval.c (unmemocopy, SCM_APPLY, scm_map, scm_for_each,
1986 scm_copy_tree): Place assignment expressions which are part of
1987 other expressions into an expression of their own.
1988
0c88d7df
DH
19892003-04-21 Dirk Herrmann <D.Herrmann@tu-bs.de>
1990
1991 * goops.c (TEST_CHANGE_CLASS, scm_sys_initialize_object): Don't
1992 compare SCM values with !=.
1993
5cb22e96
DH
19942003-04-20 Dirk Herrmann <D.Herrmann@tu-bs.de>
1995
1996 * eval.c, eval.h, evalext.c, evalext.h (scm_sym_setter,
1997 scm_m_generalized_set_x, scm_init_evalext): Move the declaration
1998 and definition of the memoizer for the generalized set! macro from
1999 evalext.[ch] to eval.[ch]. Use the SCM_SYNTAX snarfer macro to
2000 define the macro object.
2001
2002 * eval.c, eval.h (s_set_x, scm_s_set_x, scm_m_set_x,
2003 scm_m_generalized_set_x): Since now scm_s_set_x is only used in
2004 eval.c, it is made static and renamed to s_set_x.
2005
2006 * evalext.c (scm_defined_p, scm_m_undefine): Prefer !SCM_<foo>
2007 over SCM_N<foo>.
2008
a44a9715
DH
20092003-04-20 Dirk Herrmann <D.Herrmann@tu-bs.de>
2010
2011 * eval.c, root.h (scm_undefineds, SCM_NUM_PROTECTS, undefineds,
2012 scm_init_eval): Made scm_undefineds static in eval.c, renamed it
2013 to undefineds and registered the object as a permanent object.
2014
2015 * eval.c, eval.h (scm_f_apply, scm_init_eval): Made scm_f_apply
2016 static in eval.c, renamed it to f_apply and registered the object
2017 as a permanent object.
2018
1b43d24c
DH
20192003-04-20 Dirk Herrmann <D.Herrmann@tu-bs.de>
2020
5cb22e96 2021 * eval.c (SCM_BIT7, SCM_BIT8, unmemocopy, SCM_CEVAL): Renamed
1b43d24c
DH
2022 file-local macro SCM_BIT8 to SCM_BIT7, which is more appropriate.
2023
aec16f99
DH
20242003-04-20 Dirk Herrmann <D.Herrmann@tu-bs.de>
2025
2026 * numbers.c (scm_logtest): Fixed argument bug in the call to
2027 mpz_and, which showed up when compiling with SCM_DEBUG defined.
2028
f96460ce
DH
20292003-04-20 Dirk Herrmann <D.Herrmann@tu-bs.de>
2030
2031 * gc-card.c (scm_i_sweep_card, scm_i_init_card_freelist): Fixed
2032 type errors that showed up when compiling with SCM_DEBUG defined.
2033
d0f6ceb8
DH
20342003-04-20 Dirk Herrmann <D.Herrmann@tu-bs.de>
2035
2036 * continuations.c, continuations.h, eval.c, eval.h, extensions.c,
2037 gsubr.c, guile.c, init.c, read.c, root.c, root.h, stackchk.h,
2038 throw.c: Removed uses of DEBUG_EXTENSIONS and DYNAMIC_LINKING to
2039 fix compile errors with --disable-deprecated.
2040
19a7a089
RB
20412003-04-17 Rob Browning <rlb@defaultvalue.org>
2042
2043 * numbers.c (scm_integer_expt): fix case where we were declaring
2044 vars in the middle of a statement block. Thanks to Thamer
2045 Al-Harbash.
2046
47cd67db
MD
20472003-04-17 Mikael Djurfeldt <djurfeldt@nada.kth.se>
2048
0fd7dcd3
MD
2049 * goops.c (TEST_CHANGE_CLASS): Update variable class after class
2050 change.
2051
47cd67db
MD
2052 * eq.c (scm_eqv_p): Turned into a primitive generic.
2053
3b8b889c
RB
20542003-04-16 Rob Browning <rlb@defaultvalue.org>
2055
312006bb
RB
2056 * gc_os_dep.c: Added patch for UnixWare and OpenUNIX support.
2057 Thanks to Boyd Gerber.
2058 Added check for __arm__ in addition to arm for LINUX and copied
2059 __s390__ defines from upstream libgc. Thanks to James Treacy for
2060 reporting the problems.
c7ef2ea1 2061
3b8b889c
RB
2062 * numbers.c (PTRDIFF_MIN): use SCM_CHAR_BIT.
2063
2064 * socket.c: use SCM_CHAR_BIT.
2065
2066 * random.c (scm_c_random_bignum): use SCM_CHAR_BIT.
2067
2068 * num2integral.i.c (NUM2INTEGRAL): use SCM_CHAR_BIT.
2069
43261b39
MD
20702003-04-16 Mikael Djurfeldt <mdj@kvast.blakulla.net>
2071
2072 * feature.c (scm_init_feature): Always add threads feature.
2073
58241edc
MD
20742003-04-15 Mikael Djurfeldt <djurfeldt@nada.kth.se>
2075
2076 * goops.c (scm_sys_fast_slot_ref): Use SCM_SLOT instead of
2077 scm_at_assert_bound_ref. (We don't want the unbound check. See
2078 oop/goops/active-slot.scm.)
2079
94e91275
RB
20802003-04-14 Rob Browning <rlb@defaultvalue.org>
2081
2082 * tags.h: scm_t_intptr should have been intptr_t.
2083
3071ea27
RB
20842003-04-13 Rob Browning <rlb@defaultvalue.org>
2085
2086 * __scm.h (SCM_FLUSH_REGISTER_WINDOWS): don't just rely on "sparc"
2087 test. Instead use
2088 #if defined (sparc) || defined (__sparc__) || defined (__sparc)
2089 as gc_os_dep.c suggests is appropriate.
2090
2091 * goops.c (prep_hashsets): make static to match prototype.
2092 (scm_sym_args): SCM_SYMBOL -> SCM_GLOBAL_SYMBOL. Thanks to Albert
2093 Chin.
2094
2095 * c-tokenize.lex: remove trailing comma from enum. Thanks to
2096 Albert Chin.
2097
2098 * gc_os_dep.c: add NetBSD powerpc config info. Thanks to Thomas
2099 Klausner.
2100
21ab2aeb
MD
21012003-04-13 Mikael Djurfeldt <djurfeldt@nada.kth.se>
2102
2103 * goops.c (scm_sys_prep_layout_x): Instance allocation is now
2104 indicated through extra fields in getters-n-setters.
2105 (scm_add_slot): Adapted to new format of getters_n_setters slot.
2106 (Thanks to Andy Wingo.)
2107
dff96e95
HWN
21082003-02-25 Han-Wen Nienhuys <hanwen@cs.uu.nl>
2109
2110 * gc-segment.c: add comment
2111
07921c76
RB
21122003-04-07 Rob Browning <rlb@defaultvalue.org>
2113
b5331f10
RB
2114 * debug.h: change "id" arg name to "info_id" to avoid objective-c
2115 clash.
2116
07921c76
RB
2117 * num2integral.i.c (NUM2INTEGRAL): fix bug pointed out by Mikael
2118 and add regression test to standalone/.
2119
21202003-04-06 Rob Browning <rlb@defaultvalue.org>
2121
2122 * strings.c (scm_mem2string): use memcpy rather than by-hand loop.
2123 Thanks to Dale P. Smith.
2124
2125 * random.c: #include gmp.h.
2126 (scm_c_random_bignum): normalize result on return.
2127
2128 * init.c: #include gmp.h.
2129
2130 * numbers.h: remove the gmp.h #include (not needed now).
2131
2132 * posix.h: change occurences of "id" to something else so we don't
2133 cause trouble when included via objective-c (can't hurt, might
2134 help). Still have usage in debug.h, though.
2135
938f6b7c
MD
21362003-04-06 Mikael Djurfeldt <djurfeldt@nada.kth.se>
2137
372691d8
MD
2138 * random.c (scm_c_random_bignum): Don't generate a random number
2139 equal to m (the second argument of scm_c_random_bignum); only
2140 generate numbers in the range 0 <= r < m.
c5f268f8
MD
2141 (scm_c_default_rstate): Use SCM_VARIABLE_REF to access
2142 scm_var_random_state.
372691d8 2143
938f6b7c
MD
2144 * num2integral.i.c (INTEGRAL2BIG): Put negation of n inside then
2145 clause.
2146
6cdb8c3f
RB
21472003-04-05 Rob Browning <rlb@defaultvalue.org>
2148
938f6b7c 2149 * modules.c (scm_module_import_interface): move declaration of
6cdb8c3f
RB
2150 uses before any code.
2151
15635be5
MD
21522003-04-05 Mikael Djurfeldt <djurfeldt@nada.kth.se>
2153
1ecfd013
MD
2154 * Makefile.am (scmconfig.h): Look for config.h in top_builddir,
2155 not top_srcdir.
2156
15635be5
MD
2157 * hashtab.c (rehash_after_gc): Clear to_rehash list before
2158 processing it in order to avoid an infinite loop.
2159
2160 * print.c (scm_prin1): Remember old state of pstate->writingp.
2161
73be1d9e
MV
21622003-04-05 Marius Vollmer <mvo@zagadka.de>
2163
2164 * Changed license terms to the plain LGPL thru-out.
2165
ad815c06
RB
21662003-04-04 Rob Browning <rlb@defaultvalue.org>
2167
2168 * socket.c (FLIPCPY_NET_HOST_128): new macro.
2169 (ipv6_net_to_num, ipv6_num_to_net, bignum_in_ipv6_range_p):
2170 rewrite to handle GMP bignums.
2171
2172
2173 * random.c (scm_c_random_bignum): rewrite to handle GMP bignums.
2174
2175 * ports.c (scm_getc): minor tweak.
2176
2177 * numbers.h: remove SCM_BIGDIG conditionals, reorganize, and
2178 rewrite to handle GMP bignums.
2179
2180 * numbers.c: rewrite *many* functions to handle GMP bignums.
2181
2182 * num2integral.i.c (NUM2INTEGRAL, INTEGRAL2NUM, INTEGRAL2BIG):
2183 handle GMP bignums.
2184
2185 * num2float.i.c (NUM2FLOAT): handle GMP bignums.
2186
2187 * init.c (check_config): remove SCM_BIGDIG conditionals.
2188 (scm_init_guile_1): test to make sure mpz_t fits in a double_cell.
2189
2190 * gc-card.c ("sweep_card"): handle new mpz_t bignums.
2191
2192 * eval.c: remove SCM_BIGDIG conditionals.
2193
2194 * eq.c (s_scm_eqv_p): scm_i_bigcomp -> scm_i_bigcmp.
2195
6cdb8c3f
RB
21962003-03-31 Rob Browning <rlb@defaultvalue.org>
2197
2198 * Makefile.am (scmconfig.h): change srcdir to builddir. (Thanks
2199 to Kevin Ryde.)
2200
22012003-03-27 Rob Browning <rlb@defaultvalue.org>
2202
2203 * threads.h: fix various preprocessor usages of new public
2204 symbols to expect 0 or 1 values rather than 1 or undefined.
2205 i.e. change #ifdef to #if, etc.
2206
2207 * threads.c: fix various preprocessor usages of new public
2208 symbols to expect 0 or 1 values rather than 1 or undefined.
2209 i.e. change #ifdef to #if, etc.
2210
2211 * tags.h: fix various preprocessor usages of new public
2212 symbols to expect 0 or 1 values rather than 1 or undefined.
2213 i.e. change #ifdef to #if, etc.
2214
2215 * stacks.c: fix various preprocessor usages of new public
2216 symbols to expect 0 or 1 values rather than 1 or undefined.
2217 i.e. change #ifdef to #if, etc.
2218
2219 * stackchk.h: fix various preprocessor usages of new public
2220 symbols to expect 0 or 1 values rather than 1 or undefined.
2221 i.e. change #ifdef to #if, etc.
2222
2223 * stackchk.c: fix various preprocessor usages of new public
2224 symbols to expect 0 or 1 values rather than 1 or undefined.
2225 i.e. change #ifdef to #if, etc.
2226
2227 * sort.c: fix various preprocessor usages of new public
2228 symbols to expect 0 or 1 values rather than 1 or undefined.
2229 i.e. change #ifdef to #if, etc.
2230
2231 * read.c: fix various preprocessor usages of new public
2232 symbols to expect 0 or 1 values rather than 1 or undefined.
2233 i.e. change #ifdef to #if, etc.
2234
2235 * random.c: fix various preprocessor usages of new public
2236 symbols to expect 0 or 1 values rather than 1 or undefined.
2237 i.e. change #ifdef to #if, etc.
2238
2239 * print.c: fix various preprocessor usages of new public
2240 symbols to expect 0 or 1 values rather than 1 or undefined.
2241 i.e. change #ifdef to #if, etc.
2242
2243 * objects.c: fix various preprocessor usages of new public
2244 symbols to expect 0 or 1 values rather than 1 or undefined.
2245 i.e. change #ifdef to #if, etc.
2246
2247 * numbers.h: fix various preprocessor usages of new public
2248 symbols to expect 0 or 1 values rather than 1 or undefined.
2249 i.e. change #ifdef to #if, etc.
2250
2251 * null-threads.c: fix various preprocessor usages of new public
2252 symbols to expect 0 or 1 values rather than 1 or undefined.
2253 i.e. change #ifdef to #if, etc.
2254
2255 * lang.c: fix various preprocessor usages of new public
2256 symbols to expect 0 or 1 values rather than 1 or undefined.
2257 i.e. change #ifdef to #if, etc.
2258
2259 * lang.h: fix various preprocessor usages of new public
2260 symbols to expect 0 or 1 values rather than 1 or undefined.
2261 i.e. change #ifdef to #if, etc.
2262
2263 * iselect.h: fix various preprocessor usages of new public
2264 symbols to expect 0 or 1 values rather than 1 or undefined.
2265 i.e. change #ifdef to #if, etc.
2266
2267 * init.c: fix various preprocessor usages of new public
2268 symbols to expect 0 or 1 values rather than 1 or undefined.
2269 i.e. change #ifdef to #if, etc.
2270
2271 * gh_data.c: fix various preprocessor usages of new public
2272 symbols to expect 0 or 1 values rather than 1 or undefined.
2273 i.e. change #ifdef to #if, etc.
2274
2275 * gh.h: fix various preprocessor usages of new public
2276 symbols to expect 0 or 1 values rather than 1 or undefined.
2277 i.e. change #ifdef to #if, etc.
2278
2279 * gen-scmconfig.c: change most new public symbols to be defined to
2280 0 or 1 rather than being either 1 or undefined.
2281
2282 * gc_os_dep.c: fix various preprocessor usages of new public
2283 symbols to expect 0 or 1 values rather than 1 or undefined.
2284 i.e. change #ifdef to #if, etc.
2285 (STACK_GROWS_DOWN): define to 0 or 1 rather than 1 or undef.
2286
2287 * gc.h: fix various preprocessor usages of new public
2288 symbols to expect 0 or 1 values rather than 1 or undefined.
2289 i.e. change #ifdef to #if, etc.
2290
2291 * gc-card.c: fix various preprocessor usages of new public
2292 symbols to expect 0 or 1 values rather than 1 or undefined.
2293 i.e. change #ifdef to #if, etc.
2294
2295 * gc-mark.c: fix various preprocessor usages of new public
2296 symbols to expect 0 or 1 values rather than 1 or undefined.
2297 i.e. change #ifdef to #if, etc.
2298
2299 * feature.c: fix various preprocessor usages of new public
2300 symbols to expect 0 or 1 values rather than 1 or undefined.
2301 i.e. change #ifdef to #if, etc.
2302
2303 * evalext.c: fix various preprocessor usages of new public
2304 symbols to expect 0 or 1 values rather than 1 or undefined.
2305 i.e. change #ifdef to #if, etc.
2306
2307 * eval.h: fix various preprocessor usages of new public
2308 symbols to expect 0 or 1 values rather than 1 or undefined.
2309 i.e. change #ifdef to #if, etc.
2310
2311 * eval.c: fix various preprocessor usages of new public
2312 symbols to expect 0 or 1 values rather than 1 or undefined.
2313 i.e. change #ifdef to #if, etc.
2314
2315 * eq.c: fix various preprocessor usages of new public
2316 symbols to expect 0 or 1 values rather than 1 or undefined.
2317 i.e. change #ifdef to #if, etc.
2318
2319 * coop.c: fix various preprocessor usages of new public
2320 symbols to expect 0 or 1 values rather than 1 or undefined.
2321 i.e. change #ifdef to #if, etc.
2322
2323 * coop-threads.c: fix various preprocessor usages of new public
2324 symbols to expect 0 or 1 values rather than 1 or undefined.
2325 i.e. change #ifdef to #if, etc.
2326
2327 * coop-pthreads.c: fix various preprocessor usages of new public
2328 symbols to expect 0 or 1 values rather than 1 or undefined.
2329 i.e. change #ifdef to #if, etc.
2330
2331 * coop-defs.h: fix various preprocessor usages of new public
2332 symbols to expect 0 or 1 values rather than 1 or undefined.
2333 i.e. change #ifdef to #if, etc.
2334
2335 * convert.i.c: fix various preprocessor usages of new public
2336 symbols to expect 0 or 1 values rather than 1 or undefined.
2337 i.e. change #ifdef to #if, etc.
2338
2339 * continuations.c: fix various preprocessor usages of new public
2340 symbols to expect 0 or 1 values rather than 1 or undefined.
2341 i.e. change #ifdef to #if, etc.
2342
2343 * _scm.h: fix various preprocessor usages of new public symbols to
2344 expect 0 or 1 values rather than 1 or undefined. i.e. change
2345 #ifdef to #if, etc.
2346
d11d697a
MV
23472003-03-26 Marius Vollmer <marius.vollmer@uni-dortmund.de>
2348
9686f86d
MV
2349 * init.c (scm_init_guile_1): Call scm_i_init_deprecated.
2350
2351 * deprecated.c, deprecated.h: New files, to collect deprecated
2352 things in one place.
2353 * Makefile.am: Added them in all the right places.
2354
d11d697a
MV
2355 * Makefile.am (EXTRA_DIST): Added "scmconfig.h.top".
2356 (scmconfig.h): Get "scmconfig.h.top" from $(srcdir) so that VPATH
2357 builds work.
9686f86d
MV
2358 (DOT_X_FILES): Removed "iselect.x".
2359 (DOT_DOC_FILES): Removed "iselect.doc".
d11d697a 2360
e3c0c3b9
RB
23612003-03-25 Rob Browning <rlb@defaultvalue.org>
2362
2363 * win32-socket.h: #include "libguile/__scm.h". Replace usage of
2364 HAVE_WINSOCK2_H with SCM_HAVE_WINSOCK2_H.
2365
2366 * win32-socket.c: #include <config.h> if HAVE_CONFIG_H.
2367
2368 * vports.c: #include <config.h> if HAVE_CONFIG_H.
2369
2370 * unif.c: #include <config.h> if HAVE_CONFIG_H. Replace usage of
2371 HAVE_LONG_LONGS with "SCM_SIZEOF_LONG_LONG != 0".
2372
2373 * threads.h: replace usage of struct timespect with
2374 scm_t_timespec. Replace usage of USE_PTHREAD_THREADS with
2375 SCM_USE_PTHREAD_THREADS. Remove typedef for struct timespec in
2376 favor of scm_t_timespec from scmconfig.h.
2377
2378 * threads.c: move libguile/_scm.h include to the top so we pick up
2379 any critical defines like _GNU_SOURCE early. Replace usage of
2380 struct timespect with scm_t_timespec. Replace usage of
2381 STACK_GROWS_UP with SCM_STACK_GROWS_UP. Replace usage of
2382 USE_PTHREAD_THREADS with SCM_USE_PTHREAD_THREADS.
2383
2384 * threads-plugin.h: replace usage of struct timespect with
2385 scm_t_timespec.
2386
2387 * threads-plugin.c: #include <config.h> if HAVE_CONFIG_H. Replace
2388 usage of struct timespect with scm_t_timespec.
2389
2390 * tags.h: move HAVE_STDINT_H handling to scmconfig.h. Move
2391 HAVE_INTTYPES_H handling to scmconfig.h. #include
2392 "libguile/__scm.h". Rework handling for scm_t_bits,
2393 scm_t_signed_bits, SCM_T_BITS_MAX, SCM_T_SIGNED_BITS_MAX,
2394 SCM_T_SIGNED_BITS_MIN, and SIZEOF_SCM_T_BITS to use scm_t_intptr,
2395 scm_t_uintptr, SCM_SIZEOF_INTPTR_T, and SCM_SIZEOF_UINTPTR_T, and
2396 SCM_SIZEOF_UNSIGNED_LONG. Rename usage of HAVE_ARRAYS to
2397 SCM_HAVE_ARRAYS.
2398
2399 * symbols.c: #include <config.h> if HAVE_CONFIG_H.
2400
2401 * struct.c: #include <config.h> if HAVE_CONFIG_H.
2402
2403 * strports.c: #include <config.h> if HAVE_CONFIG_H.
2404
2405 * strop.c: #include <config.h> if HAVE_CONFIG_H.
2406
2407 * stime.h: move handling of time related headers to scmconfig.h.
2408
2409 * stime.c: #include <config.h> if HAVE_CONFIG_H.
2410
2411 * stacks.c: replace usage of STACK_GROWS_UP with
2412 SCM_STACK_GROWS_UP.
2413
2414 * sort.c: #include <config.h> if HAVE_CONFIG_H. Rename usage of
2415 HAVE_ARRAYS to SCM_HAVE_ARRAYS.
2416
2417 * socket.c: #include <config.h> if HAVE_CONFIG_H. Replace usage
2418 of uint32 and HAVE_UINT_32 with scm_t_int32.
2419
2420 * smob.c: #include <config.h> if HAVE_CONFIG_H.
2421
2422 * simpos.c: #include <config.h> if HAVE_CONFIG_H.
2423
2424 * script.c: #include <config.h> if HAVE_CONFIG_H.
2425
2426 * scmsigs.c: #include <config.h> if HAVE_CONFIG_H.
2427
2428 * scmconfig.h.top: new file -- preamble for scmconfig.h.
2429
2430 * rw.c: #include <config.h> if HAVE_CONFIG_H.
2431
2432 * regex-posix.c: #include <config.h> if HAVE_CONFIG_H.
2433
2434 * read.c: rename usage of HAVE_ARRAYS to SCM_HAVE_ARRAYS.
2435
2436 * rdelim.c: #include <config.h> if HAVE_CONFIG_H.
2437
2438 * random.c: #include <config.h> if HAVE_CONFIG_H. Replace usage
2439 of LONG32, LONG64, SIZEOF_LONG, and HAVE_LONG_LONGS with
2440 scm_t_int32, scm_t_int64, and SCM_HAVE_T_INT64. Rename usage of
2441 HAVE_ARRAYS to SCM_HAVE_ARRAYS.
2442
2443 * ramap.c: replace usage of HAVE_LONG_LONGS with
2444 "SCM_SIZEOF_LONG_LONG != 0".
2445
2446 * putenv.c: #include <config.h> if HAVE_CONFIG_H. #include
2447 "libguile/scmconfig.h".
2448
2449 * pthread-threads.c: #include <config.h> if HAVE_CONFIG_H.
2450
2451 * print.c: rename usage of HAVE_ARRAYS to SCM_HAVE_ARRAYS.
2452 Replace usage of HAVE_LONG_LONGS with "SCM_SIZEOF_LONG_LONG != 0".
2453
2454 * posix.c: #include <config.h> if HAVE_CONFIG_H.
2455
2456 * ports.c: #include <config.h> if HAVE_CONFIG_H.
2457
2458 * objects.c: rename usage of HAVE_ARRAYS to SCM_HAVE_ARRAYS.
2459
2460 * numbers.h: replace usage of HAVE_FLOATINGPOINT_H with
2461 SCM_HAVE_FLOATINGPOINT_H. Replace usage of HAVE_IEEEFP_H with
2462 SCM_HAVE_IEEEFP_H. Replace usage of HAVE_NAN_H with
2463 SCM_HAVE_NAN_H. Replace usage of STDC_HEADERS with
2464 SCM_HAVE_STDC_HEADERS. Replace usage of ptrdiff_t with
2465 scm_t_ptrdiff. Replace usage of HAVE_LONG_LONGS with
2466 "SCM_SIZEOF_LONG_LONG != 0".
2467
2468 * numbers.c: #include <config.h> if HAVE_CONFIG_H. Replace usage
2469 of HAVE_LONG_LONGS with "SCM_SIZEOF_LONG_LONG != 0". Replace
2470 usage of ptrdiff_t with scm_t_ptrdiff. Replace usage of
2471 SIZEOF_PTRDIFF_T with SCM_SIZEOF_SCM_T_PTRDIFF.
2472
2473 * num2integral.i.c: #include <config.h> if HAVE_CONFIG_H.
2474
2475 * null-threads.h: replace usage of struct timespect with
2476 scm_t_timespec.
2477
2478 * net_db.c: #include <config.h> if HAVE_CONFIG_H.
2479
2480 * mkstemp.c: #include <config.h> if HAVE_CONFIG_H. #include
2481 "libguile/__scm.h". Remove definition of gcc_uint64_t in favor of
2482 scm_t_uint64 and rename usages.
2483
2484 * mallocs.c: #include <config.h> if HAVE_CONFIG_H.
2485
2486 * load.c: #include <config.h> if HAVE_CONFIG_H.
2487
2488 * iselect.h: move handling of time related headers to scmconfig.h.
2489 Rename usage of HAVE_SYS_SELECT_H to SCM_HAVE_SYS_SELECT_H.
2490 Rename usage of HAVE_WINSOCK2_H to SCM_HAVE_WINSOCK2_H. Rename
2491 usage of USE_COOP_THREADS to SCM_USE_COOP_THREADS.
2492
2493 * iselect.c: #include <config.h> if HAVE_CONFIG_H. Rename usage
2494 of USE_COOP_THREADS to SCM_USE_COOP_THREADS. Rename usage of
2495 USE_NULL_THREADS to SCM_USE_NULL_THREADS.
2496
2497 * ioext.c: #include <config.h> if HAVE_CONFIG_H.
2498
2499 * inline.h: #include "libguile/__scm.h" at the top. Change code
2500 to use SCM_C_INLINE and SCM_INLINE_C_INCLUDINT_INLINE_H to decide
2501 what to do instead of creating a new public #define. Rename usage
2502 of USE_COOP_THREADS to SCM_USE_COOP_THREADS. Rename usage of
2503 USE_NULL_THREADS to SCM_USE_NULL_THREADS. Rename usage of
2504 USE_COPT_THREADS to SCM_USE_COPT_THREADS.
2505
2506 * inline.c: rearrange handling -- now we just #define
2507 SCM_INLINE_C_INCLUDING_INLINE_H to 1 and #include
2508 "libguile/inline.h". scmconfig.h will define SCM_C_INLINE as
2509 appropriate, and we use that in inline.h along with the above
2510 define to determine how to respond.
2511
2512 * init.c: #include <config.h> if HAVE_CONFIG_H. Rename usage of
2513 HAVE_ARRAYS to SCM_HAVE_ARRAYS.
2514
2515 * guile.c: #include <config.h> if HAVE_CONFIG_H.
2516
2517 * gh_data.c: #include <config.h> if HAVE_CONFIG_H. Rename usage
2518 of HAVE_ARRAYS to SCM_HAVE_ARRAYS.
2519
2520 * gh.h: rename usage of HAVE_ARRAYS to SCM_HAVE_ARRAYS.
2521
2522 * gen-scmconfig.h.in: new file -- see gen-scmconfig.c for details.
2523
2524 * gen-scmconfig.c: new file -- see comments in file for details.
2525
2526 * gdbinit.c: #include <config.h> if HAVE_CONFIG_H.
2527
2528 * gc_os_dep.c: #include <config.h> if HAVE_CONFIG_H. Replace
2529 usage of STACK_GROWS_UP with SCM_STACK_GROWS_UP.
2530
2531 * gc.h: replace usage of SIZEOF_LONG with
2532 SCM_SIZEOF_UNSIGNED_LONG. Replace usage of USE_PTHREAD_THREADS
2533 with SCM_USE_PTHREAD_THREADS. Remove SCM_SIZEOF_LONG definition
2534 since we handle that in scmconfig.h now.
2535
2536 * gc.c: #include <config.h> if HAVE_CONFIG_H.
2537
2538 * gc-mark.c: #include <config.h> if HAVE_CONFIG_H. Rename usage
2539 of HAVE_ARRAYS to SCM_HAVE_ARRAYS. Replace usage of
2540 HAVE_LONG_LONGS with "SCM_SIZEOF_LONG_LONG != 0".
2541
2542 * gc-malloc.c: #include <config.h> if HAVE_CONFIG_H.
2543
2544 * gc-card.c: rename usage of HAVE_ARRAYS to SCM_HAVE_ARRAYS.
2545 Replace usage of HAVE_LONG_LONGS with "SCM_SIZEOF_LONG_LONG != 0".
2546
2547 * fports.c: #include <config.h> if HAVE_CONFIG_H.
2548
2549 * filesys.c: #include <config.h> if HAVE_CONFIG_H.
2550
2551 * feature.c: #include <config.h> if HAVE_CONFIG_H. Rename usage
2552 of USE_NULL_THREADS to SCM_USE_NULL_THREADS.
2553
2554 * extensions.c: #include <config.h> if HAVE_CONFIG_H.
2555
2556 * evalext.c: rename usage of HAVE_ARRAYS to SCM_HAVE_ARRAYS.
2557 Replace usage of HAVE_LONG_LONGS with "SCM_SIZEOF_LONG_LONG != 0".
2558
2559 * eval.c: #include <config.h> if HAVE_CONFIG_H. #include
2560 "libguile/__scm.h" rather than scmconfig.h. Rename usage of
2561 HAVE_ARRAYS to SCM_HAVE_ARRAYS. Replace usage of HAVE_LONG_LONGS
2562 with "SCM_SIZEOF_LONG_LONG != 0".
2563
2564 * error.c: #include <config.h> if HAVE_CONFIG_H.
2565
2566 * eq.c: #include <config.h> if HAVE_CONFIG_H. Rename usage of
2567 HAVE_ARRAYS to SCM_HAVE_ARRAYS. Replace usage of HAVE_LONG_LONGS
2568 with "SCM_SIZEOF_LONG_LONG != 0".
2569
2570 * deprecation.c: #include <config.h> if HAVE_CONFIG_H.
2571
2572 * coop.c: replace usage of struct timespect with scm_t_timespec.
2573 #include <config.h> if HAVE_CONFIG_H.
2574
2575 * coop-threads.c: #include "libguile/_scm.h" early. Replace
2576 usage of struct timespect with scm_t_timespec. Replace usage of
2577 STACK_GROWS_UP with SCM_STACK_GROWS_UP.
2578
2579 * coop-pthreads.c: #include "libguile/_scm.h" early. Replace
2580 usage of struct timespect with scm_t_timespec. Replace usage of
2581 STACK_GROWS_UP with SCM_STACK_GROWS_UP.
2582
2583 * coop-defs.h: move handling of time related headers to
2584 scmconfig.h. Add #include "libguile/__scm.h". Rename usage of
2585 HAVE_WINSOCK2_H to SCM_HAVE_WINSOCK2_H. Replace usage of struct
2586 timespect with scm_t_timespec.
2587
2588 * convert.i.c: rename usage of HAVE_ARRAYS to SCM_HAVE_ARRAYS.
2589
2590 * convert.h: rename usage of HAVE_ARRAYS to SCM_HAVE_ARRAYS.
2591
2592 * convert.c: #include <config.h> if HAVE_CONFIG_H. Rename usage
2593 of HAVE_ARRAYS to SCM_HAVE_ARRAYS.
2594
2595 * continuations.c: move libguile/_scm.h include to the top so we
2596 pick up any critical defines like _GNU_SOURCE early.
2597
2598 * backtrace.c: #include <config.h> if HAVE_CONFIG_H.
2599
2600 * async.c: #include <config.h> if HAVE_CONFIG_H.
2601
2602 * alloca.c: #include <config.h> if HAVE_CONFIG_H.
2603
2604 * _scm.h: #include <config.h> if HAVE_CONFIG_H.
2605 Rename usage of USE_PTHREAD_THREADS to SCM_USE_PTHREAD_THREADS.
2606
2607 * __scm.h: move libguile/scmconfig.h include up to the top, so
2608 we're sure to pick up any critical defines like _GNU_SOURCE early.
2609 #include <limits.h> removed in favor of scmconfig.h inclusion when
2610 appropriate. STDC_HEADERS based inclusion of stdlib.h,
2611 sys/types.h, stddef.h, and sys/stdtypes.h removed in favor of
2612 scmconfig.h inclusion when appropriate. Various Win32 related
2613 definitions removed in favor of scmconfig.h inclusion when
2614 appropriate.
2615 (HAVE_UINTPTR_T): definition removed (see NEWS).
2616 (SIZEOF_PTRDIFF_T): definition removed (see NEWS).
2617 (HAVE_LONG_LONGS): definition removed (see NEWS).
2618 (HAVE_LONG_LONG): definition removed (see NEWS).
2619 (HAVE_PTRDIFF_T): definition removed (see NEWS).
2620
2621 * Makefile.am: scmconfig.h is now generated by building and
2622 running gen-scmconfig.h and capturing its output. gen-scmconfig
2623 uses config.h and the configure.in generated gen-scmconfig.h to
2624 decide what to output. See gen-scmconfig.c for details.
2625 (noinst_PROGRAMS): add gen-scmconfig.
2626 (gen_scmconfig_SOURCES): new variable.
2627 (gen-scmconfig.$(OBJEXT)): new target - be careful to handle
2628 cross-compiling right.
2629 (scmconfig.h): build scmconfig.h from gen-scmconfig's output.
2630 (BUILT_SOURCES): add scmconfig.h.
2631
25e0bf97
MV
26322003-03-19 Marius Vollmer <mvo@zagadka.de>
2633
2634 * gc_os_dep.c: Added defines for sparc-unknown-netbsdelf1.5 from
2635 Adrian Bunk. Thanks!
2636
74b6d6e4
MD
26372003-03-19 Mikael Djurfeldt <djurfeldt@nada.kth.se>
2638
2639 * goops.c (make_class_from_template): New fourth arg:
2640 applicablep.
2641 (scm_class_extended_generic_with_setter, scm_class_self): Fixed
2642 cpls.
2643
2644 * smob.c (scm_set_smob_apply): Call scm_i_inherit_applicable.
2645
2646 * goops.c, objects.c, objects.h (scm_make_extended_class): New
2647 second arg: applicablep.
2648 (scm_i_inherit_applicable): New function.
2649
2650 * goops.c, goops.h (scm_class_applicable,
2651 scm_class_extended_accessor): New classes.
2652
5c9e7dad
DH
26532003-03-18 Dirk Herrmann <D.Herrmann@tu-bs.de>
2654
2655 * procs.c (scm_procedure_documentation): Removed redundant
2656 SCM_NIMP test and replaced other calls to SCM_IMP by more explicit
2657 predicates.
2658
f8af5c6d
MD
26592003-03-11 Mikael Djurfeldt <djurfeldt@nada.kth.se>
2660
c614a00b
MD
2661 * list.c, list.h (scm_filter, scm_filter_x): New functions.
2662
109c2c9f
MD
2663 * modules.c (scm_module_import_interface): New function.
2664
f8af5c6d
MD
2665 * goops.c, goops.h (scm_class_accessor_method): Renamed from
2666 scm_class_accessor.
2667 (scm_class_accessor): New class.
2668
a48d60b1
MD
26692003-03-06 Mikael Djurfeldt <djurfeldt@nada.kth.se>
2670
2671 * goops.c (scm_primitive_generic_generic): Enable primitive
2672 generic if not enabled.
2673 (scm_sys_goops_loaded): Setup unextended primitive generics.
2674
2675 * goops.c, goops.h (scm_c_extend_primitive_generic): New function.
2676
2677 * snarf.h (SCM_PRIMITIVE_GENERIC, SCM_PRIMITIVE_GENERIC_1): New
2678 snarf macros.
2679
2680 * numbers.c (scm_abs): Use SCM_PRIMITIVE_GENERIC. (This is only a
2681 testing example. All uses of SCM_GPROC should be converted.)
2682
2683 * procprop.c (scm_stand_in_scm_proc): Use scm_assq instead of
2684 scm_assoc.
2685
2686 * eq.c (scm_equal_p): Turned into a primitive generic.
2687
84edc049
RB
26882003-02-27 Rob Browning <rlb@defaultvalue.org>
2689
2690 * Makefile.am (scmconfig.h): new target -- generate file from
2691 ../config.h.
2692 (modinclude_HEADERS): remove version.h.
2693 (nodist_modinclude_HEADERS): add version.h.
2694
ea5c9285
MD
26952003-02-24 Mikael Djurfeldt <djurfeldt@nada.kth.se>
2696
b4a1358c
MD
2697 This fixes a serious GC bug, introduced during the latest
2698 reorganization of the GC, which disabled freeing of structs and
2699 GOOPS objects:
2700
2701 * struct.c (scm_struct_prehistory): Init scm_i_structs_to_free to
2702 SCM_EOL.
53af8255
MD
2703 (scm_struct_prehistory): Move scm_free_structs to
2704 scm_before_mark_c_hook.
ea5c9285 2705
b4a1358c
MD
2706 * gc-card.c (sweep_card): Check that we haven't swept structs on
2707 this card before. That can happen if scm_i_sweep_all_segments has
2708 been called from some other place than scm_igc.
2709
c35738c1
MD
27102003-02-19 Mikael Djurfeldt <djurfeldt@nada.kth.se>
2711
231a4ea8
MD
2712 * environments.c (DEFAULT_OBARRAY_SIZE): Changed from 137 to 31
2713 (since hash tables now adapt their size).
2714
2715 * modules.c (scm_modules_prehistory): Changed from 2001 to 1533
2716 (current number of prehistory bindings; hashtable code will select
2717 a prime which is greater than this value).
2718
2719 * symbols.c (scm_symbols_prehistory): Changed from 1009 to 2139
2720 (current number of initial symbols).
2721
2722 * properties.c (scm_init_properties): Don't specify size of
2723 scm_properties_whash.
2724
2725 * objprop.c (scm_init_objprop): Don't specify size of
2726 scm_object_whash.
2727
2728 * keywords.c (scm_init_keywords): Don't specify a hash table size.
2729
c35738c1
MD
2730 * hooks.c (scm_c_hook_add): Fixed bug in append mode.
2731
2732 The following changes introduce the use of resizable hash tables
2733 throughout Guile. It also renames the old *-hash-table* functions
2734 to *-alist-vector* and places them, together with the rest of the
2735 weak vector support, in the module (ice-9 weak-vector). We should
2736 probably introduce a new, better, API for weak references, for
2737 example "weak pairs" a la MIT-Scheme. (In Chez scheme, they even
2738 look like and are used like ordinary pairs.)
2739
2740 * environments.c (obarray_enter, obarray_retrieve, obarray_remove,
2741 leaf_environment_fold, obarray_remove_all): Use hashtable
2742 accessors.
2743
2744 * gc.c (scm_init_storage): Moved hook initialization to
2745 scm_storage_prehistory.
2746 (scm_storage_prehistory): New function.
2747 (scm_igc): Added commentary about placement of
2748 scm_after_sweep_c_hook.
2749
2750 * gc-mark.c (scm_mark_all): Use hashtable accessors.
2751 (scm_gc_mark_dependencies): Use SCM_WVECT_WEAK_KEY_P and
2752 SCM_WVECT_WEAK_VALUE_P.
2753
2754 * hashtab.c, hashtab.h (scm_hash_for_each, scm_hash_map): New
2755 functions.
2756 (scm_vector_to_hash_table, scm_c_make_resizing_hash_table):
2757 Removed.
2758 (scm_make_weak_key_hash_table, scm_make_weak_value_hash_table,
2759 scm_make_doubly_weak_hash_table): Moved here from weaks.c.
2760
2761 * init.c (scm_init_guile_1): Removed call to scm_init_weaks; Added
2762 calls to scm_storage_prehistory and scm_hashtab_prehistory.
2763
2764 * modules.c (module-reverse-lookup): Use hashtable accessors.
2765
2766 * symbols.c, symbols.h (scm_i_hash_symbol): New function.
2767
2768 * weaks.c, weaks.h (scm_make_weak_key_alist_vector,
2769 scm_make_weak_value_alist_vector,
2770 scm_make_doubly_weak_alist_vector): New functions.
2771
2772 * weaks.c (scm_init_weaks_builtins): New function.
2773
2774 * weaks.h (SCM_WVECTF_WEAK_KEY, SCM_WVECTF_WEAK_VALUE,
2775 SCM_WVECTF_NOSCAN, SCM_WVECT_WEAK_KEY_P, SCM_WVECT_WEAK_VALUE_P,
2776 SCM_WVECT_NOSCAN_P): New macros.
2777
2778 * weaks.c (scm_scan_weak_vectors): Use SCM_WVECT_WEAK_KEY_P
2779 and SCM_WVECT_WEAK_VALUE_P.
2780
2781 * weaks.c, weaks.h (scm_i_allocate_weak_vector): Renamed from
2782 allocate_weak_vector and exported.
2783
0a4c1355
MD
27842003-02-13 Mikael Djurfeldt <djurfeldt@nada.kth.se>
2785
2786 * hashtab.c: Undid thread safety. (We decided that it's better to
2787 let the user explicitly protect the tables (or not) according what
2788 is suitable for the application.)
2789
87ca11ff
MD
27902003-02-12 Mikael Djurfeldt <djurfeldt@nada.kth.se>
2791
2792 * hashtab.c (scm_hash_fn_remove_x, scm_internal_hash_fold): Made
2793 thread safe and handle resizing tables.
2794 (scm_ihashx, scm_sloppy_assx, scm_delx_x): Removed
2795 SCM_DEFER/ALLOW_INTS.
2796
f59a096e
MD
27972003-02-11 Mikael Djurfeldt <djurfeldt@nada.kth.se>
2798
2799 * hashtab.c (scm_vector_to_hash_table,
2800 scm_c_make_resizing_hash_table, scm_make_hash_table): New
2801 functions.
2802 (scm_hash_fn_get_handle, scm_hash_fn_create_handle_x): Made thread
2803 safe and handle resizing tables.
2804
2805 * weaks.c (scm_make_weak_key_hash_table,
2806 scm_make_weak_value_hash_table, scm_make_doubly_weak_hash_table):
2807 Size argument made optional. Return resizable table if not
2808 specified.
2809
4b612c5b
MD
28102003-02-10 Mikael Djurfeldt <djurfeldt@nada.kth.se>
2811
2812 * eval.c (scm_trampoline_0, scm_trampoline_1, scm_trampoline_2):
2813 Fixed formals tests for closures. (Thanks to Kevin Ryde.)
2814
b3d7f6df
MD
28152003-02-05 Mikael Djurfeldt <djurfeldt@nada.kth.se>
2816
2817 * debug.c (scm_procedure_source): Handle all objects for which
2818 procedure? is #t. (Thanks to Bill Schottstaedt.)
2819
756414cf
MD
28202003-01-23 Mikael Djurfeldt <djurfeldt@nada.kth.se>
2821
361d631f
MD
2822 * futures.c (mark_futures): Don't need to mark data of recycled
2823 futures.
2824 (scan_futures, cleanup_undead): Be smarter about marking
2825 futures---avoid unnecessary passes through future lists.
2826
756414cf
MD
2827 * futures.h, futures.c: New files; Introduced recycling of
2828 futures. For fine-grained threading this lifts performance to
2829 another level. We can now use parallelization in inner loops of
2830 Guile programs without impossible overhead.
2831
2832 * threads.h, threads.c: Moved futures to their own file.
2833
2834 * Makefile.am (libguile_la_SOURCES): Added futures.c.
2835 (DOT_X_FILES): Added futures.x.
2836 (DOT_DOC_FILES): Added futures.doc.
2837 (modinclude_HEADERS): Added futures.h.
2838
2839 * threads.c, threads.h (scm_i_create_thread): Renamed from
2840 create_thread and made global.
2841
2842 * futures.c (scm_make_future): New procedure.
2843
2844 * eval.c: #include "libguile/futures.h".
2845
2846 * init.c: #include "futures.h"
2847 (scm_init_guile_1): Call scm_init_futures.
2848
2849 * stime.c (SCM_TIME_UNITS_PER_SECOND): Renamed from CLKTCK.
2850
2851 * stime.h (SCM_TIME_UNITS_PER_SECOND): Definition moved here.
2852
2853 * eval.c, eval.h (scm_trampoline_0, scm_i_call_closure_0): New
2854 functions.
2855
2856 * eval.c (scm_trampoline_1): Fixed arguments test for closures.
2857
b4debead
MD
28582003-01-22 Mikael Djurfeldt <djurfeldt@nada.kth.se>
2859
2860 * threads.c (create_thread): Don't unwind dynwind chain of parent
2861 thread before creation. Just start the new thread with an empty
2862 dynwind chain.
2863
93f26b7b
MD
28642003-01-20 Mikael Djurfeldt <djurfeldt@nada.kth.se>
2865
2866 * evalext.c, evalext.h (scm_self_evaluating_p): New function.
2867
38d8927c
MD
28682003-01-10 Mikael Djurfeldt <djurfeldt@nada.kth.se>
2869
41c96c32
MD
2870 * threads.c (scm_timed_wait_condition_variable): Support timed
2871 waiting also for simple condition variables.
2872
38d8927c
MD
2873 * goops.c (TEST_CHANGE_CLASS): Use scm_change_object_class instead
2874 of calling the procedure change-object-class.
2875
9cf5d9b7
MD
28762003-01-09 Mikael Djurfeldt <djurfeldt@nada.kth.se>
2877
2878 * ramap.c (scm_ramapc): Typo in error message.
2879
bbf8d523
MD
28802003-01-08 Mikael Djurfeldt <djurfeldt@nada.kth.se>
2881
b46fae00
MD
2882 * goops.c (scm_sys_prep_layout_x): Bugfix: Only create layout for
2883 slots with instance allocation.
2884
bbf8d523
MD
2885 * goops.c, goops.h (scm_class_extended_generic_with_setter): New
2886 class.
2887 (scm_compute_applicable_methods): Use scm_generic_function_methods.
2888
2889 * goops.c (scm_generic_function_methods): Support extended
2890 generic functions.
2891
ebf9b47c
MD
28922002-12-29 Mikael Djurfeldt <djurfeldt@nada.kth.se>
2893
2894 * eval.c (unmemocopy): Bugfix: scm_sym_delay --> scm_sym_future.
2e37d6a2 2895 Thanks to Neil for pointing this out!
ebf9b47c 2896
14a9ba3f
NJ
28972002-12-29 Neil Jerram <neil@ossau.uklinux.net>
2898
2899 * lang.h: Remove declarations matching definitions removed from
2900 lang.c (just below).
2901
c6a040a8
NJ
29022002-12-28 Neil Jerram <neil@ossau.uklinux.net>
2903
6054d805
NJ
2904 * lang.c (scm_nil_cons, scm_nil_car, scm_nil_cdr, scm_null,
2905 scm_m_while, scm_nil_eq): Remove definitions that were superfluous
2906 and already commented out.
2907
c6a040a8
NJ
2908 * read.h (scm_lreadparen), read.c (scm_lreadr, scm_read_token,
2909 scm_lreadparen): Support reading vectors with Elisp syntax if
2910 SCM_ELISP_READ_EXTENSIONS is defined. (SCM_ELISP_READ_EXTENSIONS
2911 is not currently defined, and there isn't even a configure switch
2912 to enable it yet.)
2913
3742c12f
MV
29142002-12-26 Marius Vollmer <mvo@zagadka.ping.de>
2915
2916 * Makefile.am (c-tokenize.o): Refer to source via $< so that vpath
2917 builds work.
2918 (EXTRA_DIST): Added version.h.in.
2919
fb50ef08
MD
29202002-12-21 Mikael Djurfeldt <djurfeldt@nada.kth.se>
2921
2922 This change makes it possible for one thread to do lazy sweeping
2923 while other threads are running. Now only the mark phase need to
2924 have all threads asleep. We should look further into this issue.
2925 Presently, I've put the locking of scm_i_sweep_mutex at
2926 "conservative" places due to my current lack of knowledge about
2927 the garbage collector. Please feel free to restrict these regions
2928 further to allow for maximal parallelism!
2929
2930 * gc.c, gc.h (scm_i_sweep_mutex): New mutex.
2931
2932 * gc.c (scm_gc_for_newcell), gc-malloc.c (scm_realloc,
2933 scm_gc_register_collectable_memory): Substitute locking of
2934 scm_i_sweep_mutex for calls to scm_i_thread_put_to_sleep.
2935 (scm_igc): Lock sweep mutex here instead of in callers; Calls to
2936 scm_i_thread_put_to_sleep/scm_i_thread_wake_up used to demarkate
2937 the single-thread section (which now only contains the mark
2938 phase).
2939 (scm_gc): Don't lock sweeo mutex here since scm_igc locks it;
2940 Removed SCM_DEFER/ALLOW_INTS. Simply call scm_igc directly.
2941
2942 * threads.c (gc_section_mutex): Removed.
2943
9ed24633
MD
29442002-12-19 Mikael Djurfeldt <mdj@kvast.blakulla.net>
2945
0d48aca5
MD
2946 * threads.c (create_thread): Clear parent field in root state in
2947 order not to unnecessarily remember dead threads.
2948
9ed24633
MD
2949 * eval.c (call_subr2o_1, call_lsubr2_2): New functions.
2950 (scm_trampoline_1, scm_trampoline_2): Use them.
2951
29717c89
MD
29522002-12-18 Mikael Djurfeldt <mdj@kvast.blakulla.net>
2953
2954 Partial introduction of real plugin interface.
2955
2956 * Makefile.am (modinclude_HEADERS): Added threads-plugin.h.
2957 (EXTRA_DIST): Added threads-plugin.c.
2958
2959 * threads-plugin.h, threads-plugin.c: New files.
2960
2961 * threads.h: #include "libguile/threads-plugin.h".
2962
2963 * threads.c: #include "libguile/threads-plugin.c".
2964
2965 * pthread-threads.c: Temporarily remove debugging functions.
2966
2967 * threads.c, threads.h (scm_yield): Added back.
2968
e29e0b09
MD
29692002-12-18 Mikael Djurfeldt <mdj@kvast.blakulla.net>
2970
2971 * threads.c (really_launch): Detach before unlocking
2972 thread_admin_mutex in order not to risk being joined.
2973 (scm_i_thread_put_to_sleep, scm_i_thread_wake_up): Keep
2974 thread_admin_mutex locked during GC.
2975
2976 * pthread-threads.c, pthread-threads.h: Improvements to debugging
2977 functions.
2978
0b6843b1 29792002-12-16 Mikael Djurfeldt <mdj@kvast.blakulla.net>
93cd4dcd 2980
6da2dfc4
MD
2981 * pthread-threads.c, pthread-threads.h (SCM_DEBUG_THREADS): Added
2982 support for debugging mutex operations.
2983
1b92fb6b
MD
2984 * threads.c (scm_thread): Removed filed joining_threads.
2985 (thread_print): Print thread number as well as address of thread
2986 structure.
0b6843b1
MD
2987 (scm_join_thread): Bugfix.
2988 (scm_lock_mutex, scm_try_mutex, scm_unlock_mutex,
2989 scm_timed_wait_condition_variable, scm_signal_condition_variable,
2990 scm_broadcast_condition_variable): Use the low-level API.
2991 (scm_all_threads): Return copy of thread list (to prevent
2992 unintended destruction).
2993 (scm_threads_prehistory): Initialize heap_mutex of fake thread.
1b92fb6b 2994
93cd4dcd
MD
2995 * pthread-threads.c, pthread-threads.h, threads.c: Fixes to
2996 pthread "native" recursive mutex support.
2997
2ff4f181
MD
29982002-12-15 Mikael Djurfeldt <djurfeldt@nada.kth.se>
2999
28d52ebb
MD
3000 * __scm.h (SCM_DEFER_INTS, SCM_ALLOW_INTS): New definitions.
3001 Simply lock a thread C API recursive mutex.
3002 (SCM_NONREC_CRITICAL_SECTION_START,
3003 SCM_NONREC_CRITICAL_SECTION_END, SCM_REC_CRITICAL_SECTION_START,
3004 SCM_REC_CRITICAL_SECTION_END): Removed.
3005
3006 * eval.c: Replaced SOURCE_SECTION_START / SOURCE_SECTION_END with
3007 direct calls to scm_rec_mutex_lock / unlock around the three calls
3008 to scm_m_expand_body.
3009
3010 * eval.c, eval.h (promise_free): New function.
3011 (scm_force): Rewritten; Now thread-safe; Removed
3012 SCM_DEFER/ALLOW_INTS.
3013
3014 * pthread-threads.h: Added partially implemented plugin interface
3015 for recursive mutexes. These are, for now, only intended to be
3016 used internally within the Guile implementation.
3017
3018 * pthread-threads.c: New file.
3019
3020 * threads.c: Conditionally #include "pthread-threads.c".
3021
3022 * eval.c, eval.h (scm_makprom, scm_force): Rewritten to be
3023 thread-safe;
3024
3025 * snarf.h (SCM_MUTEX, SCM_GLOBAL_MUTEX, SCM_REC_MUTEX,
3026 SCM_GLOBAL_REC_MUTEX): New macros.
3027
3028 * eval.c, threads.c, threads.h, snarf.h: Rewrote critical section
3029 macros---use mutexes instead.
3030
3031 * tags.h (SCM_IM_FUTURE): New tag.
3032
3033 * eval.c (scm_m_future): New primitive macro.
3034 (SCM_CEVAL): Support futures.
3035 (unmemocopy): Support unmemoization of futures.
3036
3037 * print.c (scm_isymnames): Name of future isym.
3038
2ff4f181
MD
3039 * version.c: Unmade some changes to my private copy that got
3040 committed by mistake.
3041
392d2833
MD
30422002-12-11 Mikael Djurfeldt <mdj@kvast.blakulla.net>
3043
e200ddee
MD
3044 * gc-malloc.c, gc.h, init.c: Reverted gc-malloc change of
3045 2002-12-10.
3046
392d2833
MD
3047 * gc.c (scm_igc): Don't call scm_i_thread_invalidate_freelists.
3048
3049 * gc.c (scm_gc_sweep): Call it here instead, which is a more
3050 logical place.
3051
3052 * threads.c (create_thread): Remember root object until the handle
3053 of the new thread is on all_threads list.
3054
3055 * root.c (scm_make_root): Moved copying of fluids until after
3056 creation of root handle so that the fluids are GC protected. Also
3057 removed the critical section.
3058
c4c52ebe
MD
30592002-12-10 Mikael Djurfeldt <mdj@kvast.blakulla.net>
3060
960c408c
MD
3061 * gc-malloc.c, gc.h (scm_gc_malloc_prehistory): New function.
3062
3cdde9d6 3063 * gc-malloc.c (malloc_mutex): New mutex.
960c408c 3064 (scm_gc_malloc_prehistory): Initialize it.
3cdde9d6
MD
3065 (scm_realloc): Serialize call to realloc
3066 (scm_calloc): Same for calloc.
3067 Thanks to Wolfgang Jaehrling!
3068 (Now we have to make sure all calls to malloc/realloc are made
3069 through scm_malloc.)
3070
960c408c
MD
3071 * init.c (scm_init_guile_1): Call scm_gc_malloc_prehistory.
3072
c4c52ebe
MD
3073 * threads.c (really_launch): Release heap (to prevent deadlock).
3074 (create_thread): Release heap before locking thread admin mutex.
3075
b0dc3d71
MD
30762002-12-10 Mikael Djurfeldt <mdj@kvast.blakulla.net>
3077
3078 * threads.c (scm_i_thread_invalidate_freelists): New
3079 function.
3080
3081 * gc.c (scm_igc): Call scm_i_thread_invalidate_freelists.
3082
3083 * modules.c (scm_export): Inserted a return statement.
3084
06e80f59
HWN
30852002-12-10 Han-Wen Nienhuys <hanwen@cs.uu.nl>
3086
3087 * modules.c (scm_export): new function
3088
3089 * gc-card.c: add a note about malloc()/free() overhead.
3090
a12611c3
MD
30912002-12-10 Mikael Djurfeldt <mdj@kvast.blakulla.net>
3092
3093 * Makefile.am (c-tokenize.$(OBJEXT)): Don't look for c-tokenize.c
3094 in srcdir.
3095
c7fabadf
MD
30962002-12-10 Mikael Djurfeldt <djurfeldt@nada.kth.se>
3097
3098 These changes remove scm_ints_disabled (which hasn't has any
3099 effect in Guile for quite some time).
3100
3101 * async.c, error.h (scm_ints_disabled): Removed.
3102
3103 * gc.c (scm_gc_for_newcell), init.c (scm_init_guile_1),
3104 root.c (scm_internal_cwdr), gdbint.c (SCM_BEGIN_FOREIGN_BLOCK,
3105 SCM_END_FOREIGN_BLOCK): Don't touch scm_ints_disabled.
3106 (old_ints): Removed.
3107
3108 * __scm.h (SCM_DEFER_INTS, SCM_ALLOW_INTS): Define as a recursive
3109 critical section.
3110 (SCM_REDEFER_INTS, SCM_ALLOW_INTS): Define as SCM_DEFER_INTS and
3111 SCM_ALLOW_INTS.
3112
9bc4701c
MD
31132002-12-09 Mikael Djurfeldt <djurfeldt@nada.kth.se>
3114
52340b65
MD
3115 * threads.c (scm_mutex_lock, scm_cond_wait, scm_cond_timedwait):
3116 Removed accidental #if 0 around these functions.
3117
9bc4701c
MD
3118 These changes are the start of support for preemptive
3119 multithreading. Marius and I have agreed that I commit this code
3120 into the repository although it isn't thoroughly tested and surely
3121 introduces many bugs. The bugs should only be exposed when using
3122 threads, though. Signalling and error handling for threads is
3123 very likely broken. Work on making the implementation cleaner and
3124 more efficient is needed.
3125
3126 * __scm.h (SCM_ALLOW_INTS_ONLY): Removed.
3127 (SCM_NONREC_CRITICAL_SECTION_START,
3128 SCM_NONREC_CRITICAL_SECTION_END, SCM_REC_CRITICAL_SECTION_START,
3129 SCM_REC_CRITICAL_SECTION_END): New macros.
3130 (SCM_CRITICAL_SECTION_START/END): Defined here.
3131
3132 * eval.c: Insert SOURCE_SECTION_START / SOURCE_SECTION_END around
3133 the three calls to scm_m_expand_body.
3134
3135 * gc.h: #include "libguile/pthread-threads.h";
3136 (SCM_FREELIST_CREATE, SCM_FREELIST_LOC): New macros.
3137
3138 * gc.c (scm_i_freelist, scm_i_freelist2): Defined to be of type
3139 scm_t_key;
3140
3141 * gc.c, gc-freelist.c, inline.h: Use SCM_FREELIST_LOC for freelist
3142 access.
3143
3144 * gc-freelist.c (scm_gc_init_freelist): Create freelist keys.
3145
3146 * gc-freelist.c, threads.c (really_launch): Use
3147 SCM_FREELIST_CREATE.
3148
3149 * gc-malloc.c (scm_realloc, scm_gc_register_collectable_memory):
3150
3151 * gc.c (scm_i_expensive_validation_check, scm_gc,
3152 scm_gc_for_newcell): Put threads to sleep before doing GC-related
3153 heap administration so that those pieces of code are executed
3154 single-threaded. We might consider rewriting these code sections
3155 in terms of a "call_gc_code_singly_threaded" construct instead of
3156 calling the pair of scm_i_thread_put_to_sleep () and
3157 scm_i_thread_wake_up (). Also, we would want to have as many of
3158 these sections eleminated.
3159
3160 * init.c (scm_init_guile_1): Call scm_threads_prehistory.
3161
3162 * inline.h: #include "libguile/threads.h"
3163
3164 * pthread-threads.h: Macros now conform more closely to the
3165 pthreads interface. Some of them now take a second argument.
3166
3167 * threads.c, threads.h: Many changes.
3168
31692002-12-09 Mikael Djurfeldt <djurfeldt@nada.kth.se>
3170
3171 * Makefile.am (version.h): Changed $^ --> $< in rule for
3172 version.h.
3173
b2cbe8d8
RB
31742002-12-08 Rob Browning <rlb@defaultvalue.org>
3175
3176 * version.h.in (SCM_MICRO_VERSION): use @--@ substitution now.
3177 (SCM_MINOR_VERSION): use @--@ substitution now.
3178 (SCM_MICRO_VERSION): use @--@ substitution now.
3179 (scm_effective_version): new function prototype.
3180
3181 * version.c (scm_effective_version): new function, also add
3182 effective-version.
3183
3184 * Makefile.am (schemelibdir): VERSION -> GUILE_EFFECTIVE_VERSION.
3185 (libpath.h): use GUILE_EFFECTIVE_VERSION to compute
3186 SCM_LIBRARY_DIR.
3187 (version.h): generate this here rather than configure.in. This
3188 approach tracks source edits better (i.e. more immediately).
3189 Might be worth considering for other .in files too.
3190
5441c65c
MV
31912002-12-02 Marius Vollmer <mvo@zagadka.ping.de>
3192
3193 Reorganized thread package selection. A thread package now only
3194 implements a small set of pthread like functions and Guile
3195 implements the rest on top of that. Guile's implementation is
3196 what the "coop-pthreads" package has been previously. Support for
3197 "coop" threads has been removed until I get time to add it again.
3198
3199 * Makefile.am (libguile_la_SOURCES): Removed iselect.c.
3200 (noinst_HEADERS): Removed coop-threads.c, coop-threads.h, coop.c,
3201 null-threads.c, coop-pthreads.c.
3202 (modinclude_HEADERS): Removed coop-defs.h, coop-pthreads.h. Added
3203 pthread-threads.h.
3204
3205 * validate.h (SCM_VALIDATE_THREAD): Moved to threads.h.
3206
3207 * threads.h: Do not include "libguile/coop-defs.h". Include
3208 "libguile/pthread-threads.h" for USE_COPT_THREADS. Removed
3209 (previously deprecated) C level thread API prototypes. They are
3210 now in the thread package specific headers, "null-threads.h" and
3211 "pthread-threads.h".
3212 (SCM_VALIDATE_THREAD, SCM_VALIDATE_MUTEX, SCM_VALIDATE_CONDVAR):
3213 New.
3214 (scm_threads_init): Removed.
3215 (SCM_CRITICAL_SECTION_START, SCM_CRITICAL_SECTION_END,
3216 SCM_THREAD_SWITCHING_CODE, scm_i_switch_counter,
3217 SCM_I_THREAD_SWITCH_COUNT): Define here.
3218 (scm_single_thread_p): Removed.
3219 (scm_call_with_new_thread): Take two args directly instead of list
3220 of two args.
3221 (scm_i_thread_data, scm_i_set_thread_data, SCM_THREAD_LOCAL_DATA,
3222 SCM_SET_THREAD_LOCAL_DATA): Define here.
3223
3224 * threads.c: Merged with "coop-pthreads.c".
3225
3226 * null-threads.h: Implement pthread-like API as a set of macros.
3227
3228 * pthread-threads.h: New, implement pthread-like API by deferring
3229 to pthread itself.
3230
3231 * init.c (scm_init_guile_1): Do not call scm_init_iselect, which
3232 has been lost in the reorganization.
3233
504d99c5
MD
32342002-12-01 Mikael Djurfeldt <mdj@linnaeus>
3235
3236 The following change makes it possible to move procedure
3237 application dispatch outside inner loops. The motivation was
3238 clean implementation of efficient replacements of R5RS primitives
3239 in SRFI-1.
3240
3241 The semantics is clear: scm_trampoline_N returns an optimized
3242 version of scm_call_N (or NULL if the procedure isn't applicable
3243 on N args).
3244
3245 Applying the optimization to map and for-each increases efficiency
3246 noticeably. For example, (map abs ls) is 8 times faster than
3247 before.
3248
3249 * eval.h (scm_t_trampoline_1, scm_t_trampoline_2): New types.
3250
3251 * eval.c, eval.h (scm_trampoline_1, scm_trampoline_2): New functions.
3252
3253 * eval.c (call_subr2_2, call_lsubr_2, call_closure_2): New functions;
3254 (map, for-each): Handle also application on two args as a special
3255 case; Use trampolines.
3256
3257 Other changes:
3258
3259 * sort.c (scm_cmp_function): Choose subr2less for scm_tc7_subr_2o;
3260 (subr2oless): Removed.
3261 (scm_restricted_vector_sort_x): Use scm_return_first to keep the
3262 vector GC protected.
3263
3264 * eval.c (check_map_args): Use scm_out_of_range_pos instead of
3265 scm_out_of_range.
3266
63dd3413
DH
32672002-11-24 Dirk Herrmann <D.Herrmann@tu-bs.de>
3268
3269 * evalext.[ch] (scm_m_undefine, undefine): Deprecated.
3270
4ba5f279
MD
32712002-11-17 Mikael Djurfeldt <mdj@linnaeus>
3272
3273 * debug.c (scm_make_iloc): Added missing "return".
3274
56ae231f
MV
32752002-11-17 Marius Vollmer <mvo@zagadka.ping.de>
3276
3277 * strports.c (scm_eval_string_in_module): Validate second arg to
3278 be a module. Thanks to Arno Peters!
3279
80b28865
DH
32802002-11-16 Dirk Herrmann <D.Herrmann@tu-bs.de>
3281
3282 * .cvsignore: remove goops.c
3283
c88b1456
DH
32842002-11-16 Dirk Herrmann <D.Herrmann@tu-bs.de>
3285
3286 * modules.c (scm_env_top_level, scm_lookup_closure_module,
3287 module_variable, scm_module_lookup_closure,
3288 scm_module_transformer, scm_sym2var, scm_module_reverse_lookup,
3289 scm_system_module_env_p): Don't compare SCM values with C
3290 operators == or !=. Avoid SCM_IMP predicates. Prefer !SCM_FALSEP
3291 over SCM_NFALSEP.
3292
a8a19efc
DH
32932002-11-16 Dirk Herrmann <D.Herrmann@tu-bs.de>
3294
3295 * eval.h (SCM_MAKE_ILOC): New macro.
3296
3297 * debug.c (scm_make_iloc): Use SCM_MAKE_ILOC instead of computing
3298 the iloc bitpattern here.
3299
76734914
MD
33002002-11-14 Mikael Djurfeldt <mdj@linnaeus>
3301
3302 * coop-pthreads.c, coop-pthreads.h: scm_internal_select should be
3303 part of the API, otherwise it's difficult to write Guile
3304 extensions using non-blocking I/O => moved #include
3305 "libguile/iselect.h" from coop-pthreads.c --> coop-pthreads.h.
3306
3307 * coop-pthreads.c (scm_unlock_mutex): Changed s_lock_mutex -->
3308 s_unlock_mutex.
3309
8b5b4a75
MV
33102002-11-10 Marius Vollmer <mvo@zagadka.ping.de>
3311
3312 * __scm.h (USE_THREADS, GUILE_ISELECT): Do not define here. They
3313 are defined in configure.in.
3314
3315 * threads.c: Removed SCM_API from function definitions. SCM_API
3316 is only for declarations.
3317
e5a83084
MD
33182002-11-07 Mikael Djurfeldt <mdj@linnaeus>
3319
9be8bb45
MD
3320 * coop-pthreads.h: Added support for thread specific data to the
3321 generic C API for the coop-pthreads case.
3322
e5a83084
MD
3323 * threads.c, threads.h (scm_cond_init): Undo unintentional API
3324 change.
6c214b62 3325 (scm_cond_broadcast): Added missing function.
e5a83084 3326
7edf178e
MV
33272002-11-04 Marius Vollmer <marius.vollmer@uni-dortmund.de>
3328
3329 * coop.c (coop_next_runnable_thread): Removed, wich should have
3330 happened when GUILE_ISELECT was hard-wired.
3331
7f5b1b77
MV
33322002-11-03 Marius Vollmer <mvo@zagadka.ping.de>
3333
7caa1b07
MV
3334 * Makefile.am (libguile_la_SOURCES): Added threads.c
3335 (DOT_DOC_FILES): Added threads.doc.
3336 (DOT_X_FILES): Added threads.x.
3337 (EXTRA_libguile_la_SOURCES): Removed threads.c.
3338 (noinst_HEADERS): Added coop-pthreads.c.
3339 (modinclude_HEADERS): Added coop-pthreads.h.
3340
3341 * __scm.h (USE_THREADS, GUILE_ISELECT): Define when
3342 SCM_DEBUG_DEPRECATED. Removed their use thru-out Guile.
3343
bb11cbf4
MV
3344 * iselect.c: Include "_scm.h" before testing HAVE_UNISTD_H.
3345 Thanks to Bill Schottstaedt!
3346
1d4cbbed
MV
3347 * numbers.c (scm_integer_expt): Make 0^z == 0 for z != 0.
3348
7f5b1b77
MV
3349 * _scm.h (HAVE_RESTARTABLE_SYSCALLS): Do define even when
3350 SCM_COPT_THREADS is defined.
3351 (SCM_SYSCALL): Use EINTR-expection version when SCM_COPT_THREADS
3352 is defined.
3353
3354 * coop-pthreads.c: Some harmless renamings of internal stuff.
3355 (create_thread): New, generalized version of
3356 scm_call_with_new_thread.
3357 (scm_call_with_new_thread): Use it.
3358 (scm_spawn_thread): New, use create_thread.
3359
d52f53b1
MV
33602002-11-02 Marius Vollmer <mvo@zagadka.ping.de>
3361
3362 * coop-pthreads.c, coop-pthreads.h: Redone completely, you might
3363 start testing it now.
3364
3365 * _scm.h: Include <errno.h< so that SCM_SYSCALL is correctly
3366 defined when HAVE_RESTARTABLE_SYSCALLS is not defined.
3367 (HAVE_RESTARTABLE_SYSCALLS): Do not define when USE_COPT_THREADS
3368 is defined.
3369
30f920c3
MV
33702002-10-27 Marius Vollmer <mvo@zagadka.ping.de>
3371
3372 * scmsigs.c (signal_cell_handlers, install_handler_data,
3373 scm_delq_spine_x, really_install_handler, install_handler): New
3374 scheme for triggering signal handlers, to simplify take_signal.
3375 (take_signal): Simplified, to avoid race conditions.
3376 (scm_sigaction_for_thread): Use new Scheme. Validate that thread
3377 hasn't exited yet.
3378
3379 * async.c (scm_async_click): Reset pending_asyncs, handle
3380 signal_asyncs. Don't set cdr of a non-signal async to #f.
3381 (scm_i_queue_async_cell): Do not check cdr of cell for #f, queue
3382 always. Set pending_asyncs.
3383 (scm_system_async_mark_for_thread): Check that thread has not
3384 exited.
3385 (scm_unmask_signals, decrease_block): Call scm_async_click after
3386 block_asyncs becomes zero.
3387
3388 * __scm.h (SCM_ASYNC_CLICK): Check pending_asyncs instead of
3389 active_asyncs.
3390
3391 * root.h (scm_root_state): Added pending_asyncs and signal_asyncs
3392 fields.
3393 * root.c (root_mark): Mark them.
3394 (make_root): Initialize them.
3395
3396 * iselect.c, iselect.h: Replaced GUILE_ISELECT with
3397 USE_COOP_THREADS.
3398 (scm_internal_select): Define one version for USE_COOP_THREADS and
3399 one for USE_NULL_THREADS.
3400 (scm_init_iselect): Likewise.
3401
3402 * inline.h (scm_cell, scm_double_cell): Also allow
3403 USE_COPT_THREADS to not protect the slot initializers.
3404
3405 * init.c (scm_init_guile_1): Call scm_init_thread_procs. This is
3406 because threads need to be initialized before the stack, but
3407 gsubrs such as scm_timed_condition_variable_wait can only be
3408 created later.
3409
3410 * threads.h: Include "coop-pthreads.h" when requested.
3411 (scm_threads_make_mutex, scm_threads_lock_mutex,
3412 scm_threads_unlock_mutex, scm_threads_monitor): Removed, they were
3413 not implemented anyway.
3414 (scm_init_thread_procs, scm_try_mutex,
3415 scm_timed_condition_variable_wait,
3416 scm_broadcast_condition_variable, scm_c_thread_exited_p,
3417 scm_thread_exited_p): New prototypes.
3418 (struct timespec): Define if not already defined.
3419 (scm_t_mutex, scm_mutex_init, scm_mutex_lock, scm_mutex_trylock,
3420 scm_mutex_unlock, scm_mutex_destroy, scm_t_cond, scm_cond_init,
3421 scm_cond_wait, scm_cond_timedwait, scm_cond_signal,
3422 scm_cond_broadcast, scm_cond_destroy): Declarations moved here and
3423 deprecated.
3424
3425 * threads.c: Include <errno.h>. Include "coop-pthreads.c" when
3426 requested.
3427 (scm_thread_exited_p): New.
3428 (scm_try_mutex, scm_broadcast_condition_variable): Newly
3429 registered procedures.
3430 (scm_wait_condition_variable, scm_timed_wait_condition_variable):
3431 Use the latter as the procedure for "wait-condition-variable",
3432 thus offering a optional timeout parameter to Scheme.
3433 (scm_wait_condition_variable): Implement in terms of
3434 scm_timed_wait_condition_variable.
3435 (scm_mutex_init, scm_mutex_lock, scm_mutex_trylock,
3436 scm_mutex_unlock, scm_mutex_destroy, scm_cond_init,
3437 scm_cond_wait, scm_cond_timedwait, scm_cond_signal,
3438 scm_cond_broadcast, scm_cond_destroy): Implement in terms of
3439 scm_make_mutex, etc, and deprecate.
3440 (scm_init_threads): Do not create smobs, leave this to
3441 scm_threads_init. Do not include "threads.x" file.
3442 (scm_init_thread_procs): New, include "threads.x" here.
3443
3444 * null-threads.h (scm_null_mutex, scm_null_mutex_init,
3445 scm_null_mutex_lock, scm_null_mutex_unlock,
3446 scm_null_mutex_destroy, scm_null_condvar, scm_null_condvar_init,
3447 scm_null_condvar_wait, scm_null_condvar_signal,
3448 scm_null_condvar_destroy): Removed.
3449 (scm_mutex_init, scm_mutex_lock, scm_mutex_unlock, scm_cond_init,
3450 scm_cond_wait, scm_cond_signal, scm_cond_broadcast,
3451 scm_cond_destory): Do not define, they are now deprecated and
3452 handled by threads.{h,c}.
3453
3454 * null-threads.c (scm_null_mutex, scm_null_cond): Define here.
3455 (scm_threads_init): Create smobs here, using the appropriate
3456 sizes.
3457 (block): Removed, now unused.
3458 (scm_c_thread_exited_p): New.
3459 (scm_null_mutex_init, scm_null_mutex_lock, scm_null_mutex_unlock,
3460 scm_null_mutex_destroy, scm_null_condvar_init,
3461 scm_null_condvar_wait, scm_null_condvar_signal,
3462 scm_null_condvar_destroy): Removed and updated users to do their
3463 task directly.
3464 (scm_try_mutex, timeval_subtract,
3465 scm_timed_wait_condition_variable,
3466 scm_broadcast_condition_variable): New.
3467 (scm_wait_condition_variable): Removed.
3468
3469 * coop-defs.h (coop_m): Added 'level' field.
3470 (scm_t_mutex, scm_mutex_init, scm_mutex_lock, scm_mutex_trylock,
3471 scm_mutex_unlock, scm_mutex_destroy, scm_t_cond, scm_cond_init,
3472 scm_cond_wait, scm_cond_timedwait, scm_cond_signal,
3473 scm_cond_broadcast, scm_cond_destroy, struct timespec): Do not
3474 define.
3475 (coop_condition_variable_broadcast): New.
3476
3477 * coop-threads.c (scm_threads_init): Create smobs here, using the
3478 appropriate sizes.
3479 (scm_c_thread_exited_p, scm_try_mutex,
3480 scm_timed_wait_condition_variable,
3481 scm_broadcast_condition_variable): New.
3482 (scm_wait_condition_variable): Removed.
3483
3484 * coop.c (coop_new_mutex_init): Initialize level.
3485 (coop_mutex_trylock, coop_mutex_lock, coop_mutex_unlock): maintain
3486 level.
3487 (coop_condition_variable_signal): Renamed to
3488 coop_condition_variable_broadcast and reimplemented in terms of
3489 that. Thus...
3490 (coop_condition_variable_broadcast): New.
3491
3492 * goops.c (hell_mutex): Reimplemented using scm_make_mutex, etc.
3493
3494 * coop-pthreads.h, coop-pthreads.c: New, but unfinished.
3495
087ed40d
MV
34962002-10-21 Marius Vollmer <mvo@zagadka.ping.de>
3497
65a23095
MV
3498 * null-threads.c: Include <time.h>. Also, use <...> for inclusion
3499 of system headers.
3500
087ed40d
MV
3501 * async.c, goops.h, modules.h, validate.h (SCM_MAKE_VALIDATE_MSG):
3502 New. Use it instead of SCM_MAKE_VALIDATE in lots of places to
30f920c3 3503 give better error messages. Thanks to Bill Schottstaedt!
087ed40d 3504
5ec1d2c8
DH
35052002-10-19 Dirk Herrmann <D.Herrmann@tu-bs.de>
3506
3507 * evalext.h, evalext.c (scm_definedp, scm_defined_p): Renamed
3508 scm_definedp to scm_defined_p and deprecated scm_definedp.
3509
100ae50d
DH
35102002-10-19 Dirk Herrmann <D.Herrmann@tu-bs.de>
3511
3512 * async.h, async.c (scm_system_async): Fixed deprecation to work
3513 correctly when deprecated features are excluded.
3514
2794cb50
MV
35152002-10-16 Marius Vollmer <marius.vollmer@uni-dortmund.de>
3516
3517 * async.c (scm_system_async_mark_for_thread): Validate thread
3518 argument.
3519
3520 * coop-threads.c (scm_i_thread_root): Do not validate argument.
3521
3522 * feature.c (scm_init_feature): Don't add 'threads' for
3523 USE_NULL_THREADS.
3524
3525 * inline.h (scm_cell, scm_double_cell): Also allow
3526 USE_NULL_THREADS to not protect the slot initializers.
3527
3528 * scmsigs.c (scm_sigaction_for_thread): It's "USE_THREADS" not
3529 "USE_THREAD".
3530
3531 * Makefile.am (noinst_HEADERS): Added null-threads.c.
3532 (modinclude_HEADERS): Added null-threads.h.
3533
3534 * threads.h: Include null-threads.h when !USE_COOP_THREADS.
3535 * threads.c: Include null-threads.c when !USE_COOP_THREADS.
3536 (scm_init_threads): Use generic type names scm_t_mutex and
3537 scm_t_cond instead of coop_m and coop_c.
3538
3539 * null-threads.c, null-threads.h: New files.
3540
ff810d7a
MV
35412002-10-15 Marius Vollmer <mvo@zagadka.ping.de>
3542
3543 * Makefile.am: Replaced "$<" in non-pattern rules with its value.
3544 This is to support makes that know about "$<" only in pattern
3545 rules, like Sun's make.
3546
a90bdb73
MV
35472002-10-13 Marius Vollmer <mvo@zagadka.ping.de>
3548
3549 * Makefile.am (libpath.h): Fixed typo in top_srcdir_absolute
3550 substitution. Thanks to David Allouche!
3551
e71a8bf2
DH
35522002-10-13 Dirk Herrmann <D.Herrmann@tu-bs.de>
3553
3554 * evalext.h: Replaced SCM_DEBUG_DEPRECATED with
3555 !SCM_ENABLE_DEPRECATED.
3556
41f77ff5
MV
35572002-10-11 Marius Vollmer <marius.vollmer@uni-dortmund.de>
3558
504d99c5 3559 * async.c (scm_system_async_mark_for_thread): Only call
41f77ff5
MV
3560 scm_i_thread_root when USE_THREADS is defined. Use scm_root
3561 otherwise.
3562
3563 * scmsigs.c (take_signal): Only call scm_i_thread_root when
3564 USE_THREADS is defined. Use scm_root otherwise.
3565 (scm_sigaction_for_thread): Ignore THREAD argument when
3566 USE_THREADS is not defined. Also, move THREAD argument defaulting
3567 out of HAVE_SIGACTION section, which was a bug.
3568
6d16b125
MV
35692002-10-10 Marius Vollmer <marius.vollmer@uni-dortmund.de>
3570
3571 * scmsigs.c (scm_sigaction_for_thread): Store original handler in
3572 signal_handlers, not the closure that is used as the async.
3573 The closure is stored in signal_handler_cells, as previously.
3574
acfa1f52
MV
35752002-10-10 Marius Vollmer <mvo@zagadka.ping.de>
3576
3577 * root.h (scm_root_state): Added 'block_async' slot.
3578 (scm_active_asyncs): Removed abbrev.
3579 * root.c (scm_make_root): Initialize 'block_asyncs' slot.
3580
3581 * __scm.h (SCM_ASYNC_TICK): Do without the scm_active_asyncs
3582 abbrev.
3583
3584 * async.h (scm_call_with_blocked_asyncs,
3585 scm_call_with_unblocked_asyncs, scm_c_call_with_blocked_asyncs,
3586 scm_c_call_with_unblocked_asyncs): New prototypes.
3587 (scm_mask_signals, scm_unmask_signals): Deprecated.
3588 (scm_mask_ints): Turned into a macro.
3589 * async.c (scm_mask_ints): Removed.
3590 (scm_run_asyncs): Do not set scm_mask_ints while running an async.
3591 this should not be necessary.
3592 (scm_async_click): Test block_asyncs instead of scm_mask_ints.
3593 (scm_mask_signals, scm_unmask_signals): Deprecated. Emit
3594 deprecation warning and check for errornous use. Set block_asyncs
3595 instead of scm_mask_ints.
3596 (increase_block, decrease_block, scm_call_with_blocked_asyncs,
3597 scm_call_with_unblocked_asyncs, scm_c_call_with_blocked_asyncs,
3598 scm_c_call_with_unblocked_asyncs): New.
3599
3600 * script.c (scm_compile_shell_switches): Do not set scm_mask_ints.
3601 Asyncs are enabled by default.
3602
34010f56
NJ
36032002-10-09 Neil Jerram <neil@ossau.uklinux.net>
3604
3605 * vports.c (scm_make_soft_port): Allow vector argument to carry a
3606 6th element: an input waiting thunk.
3607 (sf_input_waiting): New.
3608
9310d6f2
MV
36092002-10-05 Marius Vollmer <mvo@zagadka.ping.de>
3610
3611 * root.c (root_mark): Mark active_asyncs slot.
3612
3613 * async.c (scm_async_click): Set the cdr of a executed handler
3614 cell to SCM_BOOL_F, not SCM_EOL.
3615 (scm_i_queue_async_cell): Queue the cell at the end of the list,
3616 and only if the handler procedure is not already present.
3617 (scm_system_async_mark_for_thread): Initialize cdr of handler cell
3618 with SCM_BOOL_F.
3619 * scmsigs.c (scm_sigaction_for_thread): Likewise.
3620
ac48c719
RB
36212002-10-04 Rob Browning <rlb@defaultvalue.org>
3622
1360a142
RB
3623 * guile.c (main): switch to scm_lt_dlset_preloaded_symbols;
3624
3625 * dynl.c (sysdep_dynl_link): switch to scm_lt_dlhandle,
3626 scm_lt_dlopenext, and scm_lt_dlerror.
3627 (sysdep_dynl_unlink): switch to scm_lt_dlhandle, scm_lt_dlclose,
3628 and scm_lt_dlerror.
3629 (sysdep_dynl_func): switch to scm_lt_dlhandle, scm_lt_dlsym,
3630 and scm_lt_dlerror.
3631 (sysdep_dynl_init): switch to scm_lt_dlinit();
3632
3633 * Makefile.am (libguile_la_LIBADD): switch to use
3634 libguile-ltdl.la.
3635
504d99c5 3636 * numbers.c (scm_integer_expt): (expt 0 1) should be 1.
ac48c719 3637
497092c9
MV
36382002-10-04 Marius Vollmer <mvo@zagadka.ping.de>
3639
3640 * scmsigs.h (scm_sigaction_for_thread): New prototype.
3641 * scmsigs.c (got_signal): Removed.
3642 (signal_handler_cells, signal_handler_threads): New.
3643 (take_signal): Queue the cell of the signal for the specified
3644 thread. Reset the signal handler on systems that don't have
3645 sigaction.
3646 (sys_deliver_signals): Removed.
3647 (close_1): New.
3648 (scm_sigaction_for_thread): Renamed from scm_sigaction and
3649 extended to also set the thread of a signal and allocate a cell
3650 for it. Keep the Scheme name "sigaction". Check that signum is
3651 within range. Also, use SCM_VECTOR_REF instead of SCM_VELTS.
3652 (scm_sigaction): Implement in terms of scm_sigaction_for_thread.
3653 (scm_init_scmsigs): Allocate signal_handler_cells and
3654 signal_handler_threads vectors.
3655
3656 * async.c: Removed GUILE_OLD_ASYNC_CLICK code. Reorganized so
3657 that system asnycs and user asyncs are separated. Reimplemented
3658 system asyncs to work per-thread.
3659
3660 * gc.c (scm_init_gc): Do not use scm_system_async.
3661
3662 * async.h (scm_asyncs_pending, scm_set_tick_rate,
3663 scm_set_switch_rate, scm_system_async_mark_from_signal_handler):
3664 Removed prototypes.
3665 (scm_i_queue_async_cell): New.
3666
3667 * __scm.h (scm_asyncs_pending_p): Removed.
3668 (SCM_ASYNC_CLICK): Check scm_active_asyncs instead of
3669 scm_asyncs_pending_p.
3670
3671 * async.h (scm_system_async_mark_for_thread): New prototype.
3672
3673 * __scm.h: Removed GUILE_OLD_ASYNC_CLICK code.
3674
3675 * root.h (scm_root_state): Added new "active_asyncs" slot.
3676 * root.c (scm_make_root): Initialize it to SCM_EOL.
3677
3678 * coop-defs.h (coop_t): Added new "handle" slot.
3679 * coop-threads.c (all_threads, scm_current_thread,
3680 scm_all_threads, scm_i_thread_root): New.
3681 (scm_threads_init): Add main thread to all_threads.
3682 (scheme_launch_thread): Remove thread from all_threads when it
3683 terminates.
3684 (scm_call_with_new_thread): Initialize handle slot of coop_t
3685 structure and add new thread to all_threads.
3686 (scm_spawn_thread): Likewise.
3687
3688 * threads.h (scm_current_thread, scm_all_threads): New prototypes.
3689 * threads.c (scm_current_thread, scm_all_threads): Register as
3690 primitives.
3691
3692 * dynl.c: Use scm_lt_ prefix for libltdl functions.
3693
480fa28d
NJ
36942002-09-29 Neil Jerram <neil@ossau.uklinux.net>
3695
3696 * script.c (scm_compile_shell_switches): Fix bad spelling of
3697 `explicitly' in comment.
3698
36992002-09-28 Neil Jerram <neil@ossau.uklinux.net>
3700
3701 * posix.c (scm_geteuid, scm_getegid, scm_seteuid, scm_setegid):
3702 Refer to provided? in doc string rather than deprecated feature?.
3703
3553e1d1
GH
37042002-09-24 Gary Houston <ghouston@arglist.com>
3705
3706 * inline.h (scm_double_cell): prevent reordering of statements
3707 with any following code (for GCC 3 strict-aliasing).
3708 * numbers.c (scm_make_real), num2float.i.c (FLOAT2NUM): removed
3709 the earlier version of the reordering prevention.
3710
4ad0814a
HWN
37112002-09-19 Han-Wen Nienhuys <hanwen@cs.uu.nl>
3712
3713 * inline.h (scm_double_cell): move SET_GCMARK set out of if body.
3714
e88e4f2e
HWN
37152002-09-09 Han-Wen Nienhuys <hanwen@cs.uu.nl>
3716
3717 * gc-malloc.c (scm_gc_register_collectable_memory): more overflow
3718 protection.
3719
1e71eafb
HWN
37202002-09-08 Han-Wen Nienhuys <hanwen@cs.uu.nl>
3721
3722 * inline.h: include stdio.h
3723
3724 * smob.c (free_print): abort if scm_debug_cell_accesses_p is set
3725
61ef9c1f
HWN
37262002-09-05 Han-Wen Nienhuys <hanwen@cs.uu.nl>
3727
dac04e9f
HWN
3728 * gc-segment.c (scm_i_make_initial_segment): check user settings
3729 for sanity.
3730
3731 * gc-malloc.c (scm_gc_init_malloc): check user settings for
3732 sanity.
dac04e9f
HWN
3733
3734 * gc-freelist.c (scm_init_freelist): check user settings for sanity.
3735
ffd72400
HWN
3736 * struct.h: change scm_structs_to_free to scm_i_structs_to_free
3737
3738 * gc-malloc.c (scm_gc_register_collectable_memory): use floats;
1e71eafb
HWN
3739 these won't ever wrap around with high memory usage. Thanks to
3740 Sven Hartrumpf for finding this.
ffd72400 3741
5bd4a949
HWN
3742 * gc-freelist.c: include <stdio.h>
3743
61ef9c1f
HWN
3744 * gc-malloc.c: add DEBUGINFO for mtrigger GCs.
3745
ffd0ef3b
MV
37462002-09-01 Marius Vollmer <mvo@zagadka.ping.de>
3747
a27e3d14
MV
3748 * vectors.h (SCM_VECTOR_REF): New.
3749
ffd0ef3b
MV
3750 * snarf.h (SCM_DEFINE_PUBLIC): New.
3751
f8a1712b
MV
37522002-08-30 Marius Vollmer <mvo@zagadka.ping.de>
3753
3754 * socket.c (scm_addr_vector): Added size of address to arguments.
3755 Use it to avoid accessing a non-existent path in a sockaddr_un.
3756 Changed all callers.
3757
7200a36b
HWN
37582002-08-29 Han-Wen Nienhuys <hanwen@cs.uu.nl>
3759
1383773b
HWN
3760 * gc.h: remove DOUBLECELL card flags.
3761
3762 * gc-malloc.c (scm_calloc): try to use calloc() before calling
3763 scm_realloc().
3764
3765 * gc-segment.c (scm_i_initialize_heap_segment_data): remove card
3766 init loop; handle this from scm_init_card_freelist()
3767
3768 * gc-card.c (scm_init_card_freelist): init bit vector here.
3769
7200a36b 3770 * numbers.c (scm_make_real): prevent reordering of statements
8fa5786d 3771 num2float.i.c (FLOAT2NUM): idem
7200a36b 3772
9981de3a
HWN
37732002-08-27 Han-Wen Nienhuys <hanwen@cs.uu.nl>
3774
3775 * eval.h: prepend libguile/ to include path
3776
19647556
MV
37772002-08-26 Marius Vollmer <mvo@zagadka.ping.de>
3778
3779 * script.c (scm_compile_shell_switches): Added "2002" to Copyright
3780