* eval.c (s_defun): New static identifier.
[bpt/guile.git] / libguile / ChangeLog
CommitLineData
70c1c108
DH
12003-10-22 Dirk Herrmann <D.Herrmann@tu-bs.de>
2
3 * eval.c (s_defun): New static identifier.
4
5 (scm_m_nil_cond, scm_m_atfop, scm_m_undefine): Add comments. Use
6 ASSERT_SYNTAX to signal syntax errors. Avoid unnecessary consing
7 when creating the memoized code.
8
0ee39677
KR
92003-10-19 Kevin Ryde <user42@zip.com.au>
10
11 * numbers.c (scm_ash): Revise docstring as per recent update to manual.
12
13 * numbers.c (scm_i_big2dbl): Rewrite, carefully rounding to "closest"
14 in accordance with R5RS, which just mpz_get_d doesn't really give.
15
9a848baf
DH
162003-10-18 Dirk Herrmann <D.Herrmann@tu-bs.de>
17
18 * eval.c (s_bad_slot_number): New static identifier.
19
20 (scm_m_atslot_ref, scm_m_atslot_set_x): Use ASSERT_SYNTAX to
21 signal syntax errors. Avoid unnecessary consing when creating the
22 memoized code.
23
da48db62
DH
242003-10-18 Dirk Herrmann <D.Herrmann@tu-bs.de>
25
26 * eval.c (scm_m_cont, scm_m_at_call_with_values,
27 scm_m_generalized_set_x): Use ASSERT_SYNTAX to signal syntax
28 errors. Avoid unnecessary consing when creating the memoized
29 code.
30
31 (scm_m_generalized_set_x): Let scm_m_set_x handle the R5RS
32 standard case. Make sure line and file information are copied to
33 every created expression.
34
82b3e2c6
DH
352003-10-18 Dirk Herrmann <D.Herrmann@tu-bs.de>
36
37 * eval.c (scm_m_set_x, scm_m_apply, scm_m_atbind): Use
38 ASSERT_SYNTAX to signal syntax errors. Avoid unnecessary consing
39 when creating the memoized code.
40
41 (scm_m_atbind): Reversed the order, in which the init expressions
42 are stored and executed. The order of execution is now equal to
43 the order in which the initializers of the let-forms are executed.
44 Use check_bindings and transform_bindings.
45
46 (SCM_CEVAL): Eliminated SCM_NIMP in favor of more appropriate
47 !SCM_NULLP. Added some comments.
48
21628685
DH
492003-10-18 Dirk Herrmann <D.Herrmann@tu-bs.de>
50
51 * eval.c: Sorted include files alphabetically.
52
53 (scm_m_begin): Added comment.
54
55 (scm_m_or): Use ASSERT_SYNTAX to signal syntax errors. Avoid
56 unnecessary consing when creating the memoized code.
57
58 (iqq, scm_m_quasiquote, scm_m_quote): Use ASSERT_SYNTAX to signal
59 syntax errors. Be more specific about the kind of error that was
60 detected.
61
62 (scm_m_quote, unmemocopy): As an optimization, vector constants
63 are now inserted unquoted into the memoized code. During
64 unmemoization the quotes are added again to provide syntactically
65 correct code.
66
d6754c23
DH
672003-10-18 Dirk Herrmann <D.Herrmann@tu-bs.de>
68
69 * eval.c (scm_m_let, scm_m_letstar, scm_m_letrec,
70 scm_m_expand_body, check_bindings): Extracted syntax checking of
71 bindings to new static function check_bindings.
72
73 (scm_m_let, memoize_named_let): Extracted handling of named let to
74 new static function memoize_named_let.
75
76 (transform_bindings, scm_m_let, scm_m_letstar, scm_m_letrec): Use
77 ASSERT_SYNTAX to signal syntax errors. Be more specific about the
78 kind of error that was detected. Avoid use of SCM_CDRLOC. Avoid
79 unnecessary consing when creating the memoized code.
80
03a3e941
DH
812003-10-12 Dirk Herrmann <D.Herrmann@tu-bs.de>
82
83 * eval.c (s_bad_formals, s_bad_formal, s_duplicate_formal): New
84 static identifiers.
85
86 (s_clauses, s_formals, s_duplicate_formals): Removed.
87
88 (scm_m_lambda): Use ASSERT_SYNTAX to signal syntax errors. Be more
89 specific about the kind of error that was detected. Prepare for
90 easier integration of changes for separated memoization.
91
da48db62 922003-10-12 Dirk Herrmann <D.Herrmann@tu-bs.de>
4610b011
DH
93
94 * eval.c (s_duplicate_binding): New static identifier.
95
96 (scm_m_case): Call scm_c_memq instead of implementing it inline.
97
98 (scm_m_define): Added comment about how we check for duplicate
99 formals.
100
101 (scm_m_do): Added check for duplicate bindings.
102
103 (scm_m_if): Use ASSERT_SYNTAX to signal syntax errors. Avoid
104 unnecessary consing when creating the memoized code.
105
106 (scm_c_improper_memq, c_improper_memq, scm_m_lambda): Renamed
107 scm_c_improper_memq to c_improper_memq, since it is not exported.
108
109 (transform_bindings): Call scm_c_memq rather than
110 scm_c_improper_memq.
111
112 (SCM_CEVAL): Simplified handling of SCM_IM_IF forms.
113
da48db62 1142003-10-12 Dirk Herrmann <D.Herrmann@tu-bs.de>
a954ce1d
DH
115
116 * eval.c (s_bad_bindings, s_bad_binding, s_bad_exit_clause): New
117 static identifiers.
118
119 (scm_m_do): Use ASSERT_SYNTAX to signal syntax errors. Be more
120 specific about the kind of error that was detected. Avoid use of
121 SCM_CDRLOC. Avoid unnecessary consing when creating the memoized
122 code, this way also making sure that file name, line number
123 information etc. remain available.
124
da48db62 1252003-10-12 Dirk Herrmann <D.Herrmann@tu-bs.de>
8ae95199
DH
126
127 * eval.c (memoize_as_thunk_prototype): New static function.
128
129 (scm_m_delay, scm_m_future): Use memoize_as_thunk_prototype.
130 Avoid unnecessary consing when creating the memoized code.
131
9b9a35b6
KR
1322003-10-12 Kevin Ryde <user42@zip.com.au>
133
134 * list.c (scm_append): Track argument number and use in error.
135
cc56ba80
DH
1362003-10-11 Dirk Herrmann <D.Herrmann@tu-bs.de>
137
138 * eval.c (s_missing_expression, s_bad_variable): New static
139 identifiers.
140
141 (scm_m_define): Use ASSERT_SYNTAX to signal syntax errors. Prefer
142 R5RS terminology for the naming of variables. Be more specific
143 about the kind of error that was detected. Make sure file name,
144 line number etc. are added to all freshly created expressions.
145 Avoid unnecessary consing when creating the memoized code.
146
609a8b86
DH
1472003-10-11 Dirk Herrmann <D.Herrmann@tu-bs.de>
148
149 * eval.c (s_extra_expression, s_misplaced_else_clause,
150 s_bad_cond_clause, s_missing_recipient): New static identifiers.
151
152 (s_extra_case_clause): Removed.
153
154 (scm_m_case, scm_m_cond): If a clause appears after an else
155 clause, report a misplaced else clause.
156
157 (scm_m_cond): Use ASSERT_SYNTAX to signal syntax errors. Be more
158 specific about the kind of error that was detected. Handle bound
159 'else and '=>. Avoid unnecessary consing when creating the
160 memoized code.
161
162 (scm_m_cond, unmemocopy, SCM_CEVAL): Use SCM_IM_ELSE to memoize
163 the syntactic keyword 'else and SCM_IM_ARROW to memoize the
164 syntactic keyword '=>.
165
58a2510b
DH
1662003-10-11 Dirk Herrmann <D.Herrmann@tu-bs.de>
167
168 * eval.c (scm_m_case): Allow empty lists of case labels.
169
2a6f7afe
DH
1702003-10-11 Dirk Herrmann <D.Herrmann@tu-bs.de>
171
172 * tags.h (SCM_IM_ELSE, SCM_IM_ARROW): New memoizer codes.
173
174 * print.c (scm_isymnames): Add names for the new memoizer codes.
175
176 * eval.c (s_missing_clauses, s_bad_case_clause,
177 s_extra_case_clause, s_bad_case_labels, s_duplicate_case_label,
178 literal_p): New static identifiers.
179
180 (scm_m_case): Use ASSERT_SYNTAX to signal syntax errors. Be more
181 specific about the kind of error that was detected. Check for
182 duplicate case labels. Handle bound 'else. Avoid unnecessary
183 consing when creating the memoized code.
184
185 (scm_m_case, unmemocopy, SCM_CEVAL): Use SCM_IM_ELSE to memoize
186 the syntactic keyword 'else.
187
e6729603
DH
1882003-10-10 Dirk Herrmann <D.Herrmann@tu-bs.de>
189
190 * eval.c (s_bad_expression, syntax_error_key, syntax_error,
191 ASSERT_SYNTAX, ASSERT_SYNTAX_2): New static identifiers.
192
193 (scm_m_and): Use ASSERT_SYNTAX to signal syntax errors. Avoid
194 unnecessary consing when creating the memoized code.
195
9ddeb776
KR
1962003-10-09 Kevin Ryde <user42@zip.com.au>
197
198 * numbers.c (scm_inexact_to_exact): Don't depend on what double->long
199 cast gives for values bigger than a long, or for nan or inf.
200
df5af69a
DH
2012003-10-08 Dirk Herrmann <D.Herrmann@tu-bs.de>
202
203 * smob.h (scm_make_smob_type): Made the declaration match the
204 definition.
205
da0e6c2b
MV
2062003-10-07 Marius Vollmer <mvo@zagadka.de>
207
208 * goops.c, objects.h, smob.c, smob.h: Make type names char
209 const * instead of char *. Thanks to Paul Jarc!
210
591924eb
KR
2112003-10-02 Kevin Ryde <user42@zip.com.au>
212
ff6ea7b9 213 * strports.c (scm_call_with_output_string): scm_get_output_string
591924eb
KR
214 rather than scm_strport_to_string, so as to guard against the port
215 having been closed by the called procedure. Reported by Nic Ferrier.
216
f03314f9
DH
2172003-09-18 Dirk Herrmann <D.Herrmann@tu-bs.de>
218
219 * numbers.h (SCM_INEXACTP): Removed uses of SCM_TYP16S.
220
221 * tags.h, deprecated.h (SCM_TYP16S): Deprecated and moved from
222 tags.h to deprecated.h.
223
534c55a9
DH
2242003-09-18 Dirk Herrmann <D.Herrmann@tu-bs.de>
225
226 This set of patches introduces a new tc7 code scm_tc7_number for
227 numbers. Bignums, reals and complex numbers are turned from smobs
228 into subtypes of scm_tc7_number.
229
230 * tags.h (scm_tc7_number): New.
231
232 * eq.c (scm_equal_p), eval.c (SCM_CEVAL), evalext.c
233 (scm_self_evaluating_p), gc-card.c (scm_i_sweep_card), gc-mark.c
234 (scm_gc_mark_dependencies), goops.c (create_smob_classes), hash.c
235 (scm_hasher), numbers.c, numbers.h (SCM_NUMP), objects.c
236 (scm_class_of), print.c (scm_iprin1), smob.c
237 (scm_smob_prehistory): Don't handle bignums, reals and complex
238 numbers as subtypes of scm_tc7_smob any more.
239
240 * numbers.h, tags.h (scm_tc16_big, scm_tc16_real,
241 scm_tc16_complex): Moved definitions from tags.h to numbers.h.
242
29c4382a
DH
2432003-09-18 Dirk Herrmann <D.Herrmann@tu-bs.de>
244
245 * numbers.c (scm_make_complex), gc-card.c (scm_i_sweep_card): Use
246 sizeof (scm_t_complex) to determine the memory size of the
247 malloc'd area for complex numbers.
248
47ae1f0e
DH
2492003-09-17 Dirk Herrmann <D.Herrmann@tu-bs.de>
250
251 * numbers.c (scm_bigequal): Fixed.
252
859b6b2f
MV
2532003-09-16 Marius Vollmer <mvo@zagadka.de>
254
255 * stime.c (scm_current_time): 'time' does not set errno so don't
256 use SCM_SYSERROR for reporting errors.
257
e17d318f
DH
2582003-09-16 Dirk Herrmann <D.Herrmann@tu-bs.de>
259
260 This set of patches eliminates the dependency between the
261 implementation of evaluator specific memoization codes and special
262 constants like #f, '() etc. ('flags'), which are not evaluator
263 specific. The goal is to remove definitions of evaluator
264 memoization codes completely from the public interface. This will
265 make it possible to experiment more freely with optimizations of
266 guile's internal representation of memoized code.
267
268 * objects.c (scm_class_of): Eliminate dependency on SCM_ISYMNUM.
269
270 * print.c (iflagnames): New array, holding the printed names of
271 guile's special constants ('flags').
272
273 (scm_isymnames): Now holds only the printed names of the
274 memoization codes.
275
276 (scm_iprin1): Separate the handling of memoization codes and
277 guile's special constants.
278
279 * tags.h (scm_tc9_flag, SCM_ITAG9, SCM_MAKE_ITAG9, SCM_ITAG9_DATA,
280 SCM_IFLAGNUM): new
281
282 (scm_tc8_char, scm_tc8_iloc, SCM_BOOL_F, SCM_BOOL_T,
283 SCM_UNDEFINED, SCM_EOF_VAL, SCM_EOL, SCM_UNSPECIFIED, SCM_UNBOUND,
284 SCM_ELISP_NIL, SCM_IM_DISPATCH, SCM_IM_SLOT_REF,
285 SCM_IM_SLOT_SET_X, SCM_IM_DELAY, SCM_IM_FUTURE,
286 SCM_IM_CALL_WITH_VALUES, SCM_IM_NIL_COND, SCM_IM_BIND): Changed
287 values.
288
289 (SCM_IFLAGP): SCM_IFLAGP now only tests for flags.
290
291 (SCM_IFLAGP, SCM_MAKIFLAG, SCM_IFLAGNUM): Generalized to use the
292 tc9 macros and scm_tc9_flag.
293
eecac806
MV
2942003-09-15 Marius Vollmer <mvo@zagadka.de>
295
296 * posix.c (scm_setgroups): Check that the gid list is not too
297 long. Thanks to Paul Jarc!
298
22f2cf2d
DH
2992003-09-14 Dirk Herrmann <D.Herrmann@tu-bs.de>
300
301 * tags.h: Reduced the number of short instructions from 14 to 13.
302 The typecode of the former 14th short instruction is now used to
303 represent long instructions. Changed some comments to reflect
304 this fact.
305
306 (SCM_MAKISYM): ISYMs get a new tc7 code, namely the one that was
307 previously used by SCM_IM_DEFINE.
308
309 (SCM_IM_DEFINE): Turned into a long instruction.
310
311 * eval.c (unmemocopy, SCM_CEVAL): Treat SCM_IM_DEFINE as a long
312 instruction.
313
314 * eval.c (SCM_CEVAL): Since characters and iflags have now a tc7
315 code that is separate from all instructions, one level of dispatch
316 for long instructions can be eliminated.
317
318 * print.c (scm_isymnames): Removed some commented code.
319
62f548e1
MV
3202003-09-12 Marius Vollmer <mvo@zagadka.de>
321
97a61c5f
MV
322 * __scm.h (SCM_FENCE): Use __memory_barrier with the Intel
323 compiler on IA64.
324
50e0ba57
MV
325 * hashtab.h (scm_tc16_hashtable): Added "extern" declaration.
326
327 * modules.c (scm_module_reverse_lookup): Check that the obarray
328 really is a hashtable and do nothing if not.
329
62f548e1
MV
330 * inline.h: Use "extern inline" only with GCC. Use "static
331 inline" else.
332
0d5e3480
DH
3332003-09-06 Dirk Herrmann <D.Herrmann@tu-bs.de>
334
335 * numbers.h (SCM_INEXACTP, SCM_REALP, SCM_COMPLEXP): Removed uses
336 of SCM_SLOPPY_INEXACTP, SCM_SLOPPY_REALP and SCM_SLOPPY_COMPLEXP.
337
338 * numbers.h, deprecated.h (SCM_SLOPPY_INEXACTP, SCM_SLOPPY_REALP,
339 SCM_SLOPPY_COMPLEXP): Deprecated and moved from numbers.h to
340 deprecated.h.
341
6b412e91
DH
3422003-09-06 Dirk Herrmann <D.Herrmann@tu-bs.de>
343
344 * eq.c (scm_eqv_p, scm_equal_p): Removed uses of
345 SCM_SLOPPY_INEXACTP, SCM_SLOPPY_REALP and SCM_SLOPPY_COMPLEXP.
346
347 * eq.c (scm_eqv_p, scm_equal_p): Reordered comparisons from
348 0.0==some_expression to some_expression==0.0. The latter is
349 better readable. The former is preferred by some people, since it
350 leads to a compiler error when confusing == with =. However, when
351 using gcc, a warning will be issued if in an if-statement an
352 assigment appears. Since many Guile developers are using gcc,
353 such errors will not remain unnoticed anyway. We can therefore
354 focus on better readability.
355
7e3b25bf
DH
3562003-09-04 Dirk Herrmann <D.Herrmann@tu-bs.de>
357
358 * tags.h: Added description of Guile's type system. Removed some
359 old and misleading comments.
360
3ea39242
DH
3612003-09-04 Dirk Herrmann <D.Herrmann@tu-bs.de>
362
363 * unit.c (scm_cvref): Eliminate unnecessary uses of SCM_NIMP,
364 SCM_SLOPPY_REALP and SCM_SLOPPY_COMPLEXP.
365
5d7d39ff
DH
3662003-09-04 Dirk Herrmann <D.Herrmann@tu-bs.de>
367
368 * numbers.h (SCM_MAKINUM): Define in terms of scm_tc2_int.
369
370 (SCM_INEXACTP, SCM_REALP, SCM_COMPLEXP): Define in terms of the
371 respective SLOPPY macro.
372
baa84a20
DH
3732003-09-04 Dirk Herrmann <D.Herrmann@tu-bs.de>
374
375 * eq.c (scm_equal_p): Use SCM_TYP7 to check if an object is of
376 type string, not SCM_TYP7S.
377
ba15f500
KR
3782003-09-03 Kevin Ryde <user42@zip.com.au>
379
380 * numbers.c (scm_lognot): Correction to docstring, ones-complement not
381 2s-complement.
382
53bb8782
KR
383 * stime.c (scm_strptime): Add comment about glibc strptime %s and
384 current timezone requiring SCM_DEFER_INTS.
385
defdc4b4
NJ
3862003-08-30 Neil Jerram <neil@ossau.uklinux.net>
387
388 * script.c (scm_compile_shell_switches): Make -s switch optional
389 if file to be loaded does not begin with a `-'. (Thanks to Aaron
390 VanDevender for the patch!)
391
0f008a15
KR
3922003-08-30 Kevin Ryde <user42@zip.com.au>
393
394 * numbers.c (scm_lognot): Rewrite using ~ and mpz_com, for directness
395 and to have non-integer types rejected as per other logical funcs.
396
438a3ba1
KR
3972003-08-28 Kevin Ryde <user42@zip.com.au>
398
399 * gc.h (scm_remember_upto_here_1): Revise comments on the asm form.
400
98dceb37
KR
4012003-08-23 Kevin Ryde <user42@zip.com.au>
402
403 * simpos.c (scm_system): Remove SCM_DEFER_INTS, system() should be
404 thread safe, and could take a long time too.
405
1fa79a38
KR
4062003-08-22 Kevin Ryde <user42@zip.com.au>
407
408 * numbers.c (scm_difference): Correction to bignum - negative inum.
409
d97f9b42
KR
4102003-08-14 Kevin Ryde <user42@zip.com.au>
411
412 * gc.h (scm_remember_upto_here_1, scm_remember_upto_here_2)
413 [__GNUC__]: Use volatile asm macros rather than a function call.
414 * gc.c (scm_remember_upto_here_1, scm_remember_upto_here_2): Undefine
415 macros while defining functions.
416
417 * simpos.c (getenv): Use <stdlib.h> for prototype.
418 (scm_system): In docstring, refer to status:exit-val rather than
419 "functions above".
420
b9052fcc
KR
4212003-08-09 Kevin Ryde <user42@zip.com.au>
422
423 * srcprop.c (scm_source_properties): Return plist from hash if it's a
424 list set by source-properties! rather than an SRCPROPS object,
425
8e5b4b9e
KR
4262003-07-29 Kevin Ryde <user42@zip.com.au>
427
428 * properties.c (scm_primitive_property_ref): In docstring, note
429 parameters to not-found-proc, use hyphens rather than underscores for
430 that parameter name.
431 (scm_primitive_property_set_x): In docstring, VAL is the value
432 parameter not CODE.
433
20703ac4
MV
4342003-07-27 Marius Vollmer <mvo@zagadka.de>
435
c6ccee34
MV
436 * print.c (scm_print_symbol_name): handle more weird characters by
437 escaping the symbol name properly. Thanks to Paul Jarc!
438
2f4931bf
MV
439 * posix.h (scm_setgroups): New prototype.
440 * posix.c (scm_setgroups): New. Thanks to Paul Jarc!
441 (scm_getgroups): Handle groups ids that don't fit into a fixnum.
442 Don't use SCM_WRITABLE_VELTS.
443
265c456f
MV
444 * gc.h (SCM_GC_SET_CELL_BVEC): New.
445 * gc-card.c (scm_i_init_card_freelist): Use it. Thanks to
446 Matthias Koeppe!
447
20703ac4
MV
448 * __scm.h (SCM_C_INLINE_KEYWORD): New.
449 * numbers.c: Use it in place of SCM_C_INLINE so that the code
450 compiles when SCM_C_INLINE is undefined.
451
59c4bb82
DH
4522003-07-24 Dirk Herrmann <D.Herrmann@tu-bs.de>
453
454 * __scm.h: Reformulated the architecture and compiler properties
455 in terms of properties of scm_t_bits and SCM variables rather than
456 in terms of c standard types. This is since it is not known which
457 of the standard types scm_t_bits and SCM variables will be defined
458 to.
459
d7850c8d
KR
4602003-07-24 Kevin Ryde <user42@zip.com.au>
461
462 * numbers.c (scm_angle): Use scm_flo0 for non-negative inum, bignum
463 and real.
464
8a0c514f
KR
4652003-07-18 Kevin Ryde <user42@zip.com.au>
466
467 * numbers.c (scm_product): In complex * bignum, correction to
468 REAL/IMAG fetch, x is the complex, not y.
469
0aacf84e
MD
4702003-07-13 Mikael Djurfeldt <djurfeldt@nada.kth.se>
471
472 * numbers.c (scm_odd_p, scm_even_p): Bugfix: Treat result of
473 scm_inf_p test as Scheme values.
474 (scm_sum): Bugfix: Normalize bignum created from a negative bignum
475 and a positive inum.
476 Use GNU indentation style.
477
192de9a4
DH
4782003-07-12 Dirk Herrmann <D.Herrmann@tu-bs.de>
479
480 * values.c (scm_values): Build lists of length 1 by using
481 scm_list_1 instead of using scm_cons.
482
bbb4438a
KR
4832003-07-10 Kevin Ryde <user42@zip.com.au>
484
b58c85ce
KR
485 * deprecation.c (scm_c_issue_deprecation_warning_fmt): Add va_end.
486 * list.c (scm_list_n): Ditto.
487
bbb4438a
KR
488 * gc-malloc.c (scm_gc_realloc): Define "ptr" at start of function.
489
287f8ad1
KR
4902003-07-08 Matthias Koeppe <mkoeppe@merkur.math.uni-magdeburg.de>
491
492 * tags.h (scm_t_bits, scm_t_signed_bits, etc): Avoid solaris empty
493 defines of INTPTR_MAX and UINTPTR_MAX, combine conditionals for
494 scm_t_bits and scm_t_signed_bits to avoid any chance of one and not
495 the other using intptr_t.
496
005d2366
KR
4972003-07-08 Kevin Ryde <user42@zip.com.au>
498
0aacf84e 499 * numbers.c (scm_make_polar): Use sincos, when available.
005d2366
KR
500 (scm_magnitude): Use hypot.
501
502 * ports.c (scm_char_ready_p, scm_peek_char): In docstrings, don't use
503 @footnote since it doesn't go through to guile-procedures.txt.
504
505 * threads.c (scm_call_with_new_thread): In docstring, use "( )"
506 outside @var to quieten makeinfo, and use @code.
507
cbfe8e62
HWN
5082003-07-06 Han-Wen Nienhuys <hanwen@cs.uu.nl>
509
510 * gc-malloc.c (decrease_mtrigger): new function
511 (increase_mtrigger): new function, separate debug registering and
512 mtrigger administration.
513 (scm_gc_realloc): bugfix: do mtrigger administration before the
514 actual realloc, for the realloc might invalidate a GC-d segment of
515 memory. Thanks to Sam Hocevar for pointing this out.
516 (scm_gc_realloc): use scm_malloc_reregister instead of
517 unregistering and registering in sequence.
518
aeb4c2e1
HWN
5192003-07-03 Han-Wen Nienhuys <hanwen@cs.uu.nl>
520
521 * __scm.h (SCM_ASSERT): change "else" expansion to "do { } while (0)"
522
4c27f8d2
HWN
5232003-07-02 Han-Wen Nienhuys <hanwen@cs.uu.nl>
524
525 * __scm.h (SCM_ASRTGO): add "else" to macro expansions with if
526 clauses.
527
983e697d
MV
5282003-06-29 Marius Vollmer <mvo@zagadka.de>
529
530 * deprecated.h (SCM_OPDIRP, scm_fport, scm_option, scm_srcprops,
531 scm_srcprops_chunk, scm_info_frame, scm_stack, scm_array,
532 scm_array_dim, SCM_ARRAY_CONTIGUOUS, SCM_FUNC_NAME, SCM_WTA,
533 RETURN_SCM_WTA, SCM_VALIDATE_NUMBER_COPY,
534 SCM_VALIDATE_NUMBER_DEF_COPY, SCM_VALIDATE_OPDIR): Re-added from
535 the release_1_6 branch.
536
78b6566e
SJ
5372003-06-25 Stefan Jahn <stefan@lkcc.org>
538
539 * continuations.c: Redeclaration of getcontext() via the
540 __asm__ ("getcontext") directive.
541
542 * continuations.h: Include <ucontext.h> instead of
543 <sys/ucontext.h>.
544
1ebb8497
KR
5452003-06-21 Kevin Ryde <user42@zip.com.au>
546
547 * numbers.c (_GNU_SOURCE): #define, to get C99 things.
548 (scm_asinh, scm_acosh, scm_atanh, scm_truncate, $asinh, $acosh,
549 $atanh, truncate): Use C library asinh, acosh, atanh and trunc, when
550 available.
551 (scm_inexact_to_exact): Expand isfinite to its definition !xisinf.
552 (isfinite): Remove, conflicts with C99 isfinite().
553
fbf85ba4
MV
5542003-06-19 Marius Vollmer <mvo@zagadka.de>
555
556 * deprecated.h, deprecated.c (scm_strhash, scm_sym2ovcell_soft,
557 scm_sym2ovcell, scm_intern_obarray_soft, scm_intern_obarray,
558 scm_symbol_value0, scm_string_to_obarray_symbol scm_intern_symbol,
559 scm_unintern_symbol, scm_symbol_binding, scm_symbol_interned_p,
560 scm_symbol_bound_p, scm_symbol_set_x, scm_gentemp): Re-added from
561 the release_1_6 branch.
562
fcc5d734
SJ
5632003-06-14 Stefan Jahn <stefan@lkcc.org>
564
565 * threads.h: Redefined scm_getspecific() and scm_setspecific()
566 to be functions instead of macros.
567
568 * threads.c: Conditionalized inclusion of <sys/time.h> and
569 <unistd.h>.
570 (scm_getspecific, scm_setspecific): Made these two function
571 real part of the API.
572
573 * posix.c (s_scm_putenv): Added some code to make a
574 (putenv "FOO="), i.e. setting an empty string, work also on
575 Win32 systems. Thanks to Kevin Ryde for the proposal.
576
c3ae8e07
KR
5772003-06-12 Kevin Ryde <user42@zip.com.au>
578
75b14838
KR
579 * posix.c (scm_putenv): Free temporary ptr in mingw unset. Add
580 freebsd to comment about need to use unsetenv.
c3ae8e07 581
9d9fa092
MV
5822003-06-02 Marius Vollmer <mvo@zagadka.de>
583
584 * ports.c (scm_peek_char): Safe the column of the port around the
585 getc/ungetc calls. Thanks to Dr. Peter Ivanyi!
586
f2478375
KR
5872003-06-07 Kevin Ryde <user42@zip.com.au>
588
589 * tags.h: Use inttypes.h and stdint.h when available, for INTPTR_MAX
590 and friends required by scm_t_bits setups.
591
6375e040
DH
5922003-06-06 Dirk Herrmann <D.Herrmann@tu-bs.de>
593
594 * tags.h (scm_tc2_int): Added.
595
596 * tags.h (scm_tc3_int_1, scm_tc3_int_2): Expressed in terms of
597 scm_tc2_int.
598
599 * tags.h (scm_tcs_cons_imcar, scm_tcs_cons_nimcar, scm_tcs_struct,
600 scm_tcs_closures): Hard coded values replaced by symbolic ones.
601
f5c6ec2f
DH
6022003-06-05 Dirk Herrmann <D.Herrmann@tu-bs.de>
603
604 * eval.c: Partially undid my patch from 2003-05-31. This patch
605 caused the segfault referenced in the previous changelog entry.
606
47dbd81e
DH
6072003-06-05 Dirk Herrmann <D.Herrmann@tu-bs.de>
608
609 * tags.h: Fixed comment about the immediate type code layout.
610
611 * eval.c: Fixed handling of non-special instructions. Without
612 this patch, guile will segfault on (#\0) and similar instructions.
613
3ec52c51
KR
6142003-06-05 Kevin Ryde <user42@zip.com.au>
615
616 * numbers.c (scm_max, scm_min): For inum, bignum and real, if other
617 operand is NaN, then return NaN. Also avoid passing NaN to mpz_cmp_d.
618
e418bd7c
KR
619 * read.c (scm_input_error): Pass arg list parameter to scm_error_scm,
620 rather than SCM_EOL. Needed by "Unknown # object" case in scm_lreadr.
621
d0624e39
DH
6222003-06-04 Dirk Herrmann <D.Herrmann@tu-bs.de>
623
624 * __scm.h, gc-card.c (SCM_DEBUG_DEBUGGER_SUPPORT,
625 SCM_DEBUG_DEBUGGING_SUPPORT): Renamed macro
626 SCM_DEBUG_DEBUGGER_SUPPORT to SCM_DEBUG_DEBUGGING_SUPPORT and
627 generalized it to apply not only to C level functions but also to
628 scheme level functions.
629
630 * debug.c, debug.h, eval.c (make-iloc, scm_make_iloc, iloc?,
631 scm_iloc_p, dbg-make-iloc, scm_dbg_make_iloc, dbg-iloc?,
632 scm_dbg_iloc_p): Moved functions scm_make_iloc, scm_iloc_p to
633 eval.c, made them available under SCM_DEBUG_DEBUGGING_SUPPORT == 1
634 only and renamed them to scm_dbg_make_iloc, scm_dbg_iloc_p,
635 respectively.
636
637 * deprecated.h, eval.c, eval.h (SCM_ILOC00, SCM_IDINC,
638 SCM_IDSTMSK): Deprecated. The macro definitions are moved from
639 eval.h into eval.c and a copy is placed into deprecated.h.
640
641 * eval.c, eval.h (SCM_MAKE_ILOC): Removed from eval.h and placed
642 into eval.c. This definition was not part of the API in any
643 officially released version of guile and thus does not need to go
644 through a phase of deprecation.
645
e90c3a89
DH
6462003-06-02 Dirk Herrmann <D.Herrmann@tu-bs.de>
647
d0624e39
DH
648 * deprecated.c, deprecated.h, eval.c, eval.h (scm_s_expression,
649 scm_s_test, scm_s_body, scm_s_bindings, scm_s_variable,
650 scm_s_clauses, scm_s_formals): Deprecated. In eval.c the
e90c3a89
DH
651 definitions are make static and renamed from scm_s_xxx to s_xxx.
652 In deprecated.c the original definitions are copied.
653
d0624e39
DH
654 * deprecated.h, eval.c, eval (SCM_EVALIM2, SCM_EVALIM, SCM_XEVAL,
655 SCM_XEVALCAR): Deprecated. The macro definitions are moved from
e90c3a89
DH
656 eval.h into eval.c and a copy (slightly modified to work in user
657 code) is placed into deprecated.h.
658
659 * eval.c: Use the local static s_xxx definitions instead of the
660 scm_s_xxx definitions throughout.
661
14b18ed6
DH
6622003-06-01 Dirk Herrmann <D.Herrmann@tu-bs.de>
663
664 This set of patches separates the representation of the cxr family
665 of functions (car, cdr etc.) from the dsubr family of functions
666 (i. e. functions that take a double precision floating point
667 argument). Further, the algorithm for handling the cxr function
668 is improved.
669
670 * eval.c (SCM_CEVAL, SCM_APPLY, scm_trampoline_1), numbers.c
671 (scm_asinh, scm_acosh, scm_atanh, scm_truncate, scm_round, floor,
672 ceil, sqrt, fabs, exp, log, sin, cos, tan, asin, acos, atan, sinh,
673 cosh, tanh), objects.c (scm_class_of), procprop.c
674 (scm_i_procedure_arity), ramap.c (scm_array_map_x), tags.h
675 (scm_tc7_dsubr, scm_tcs_subrs): Introduce scm_tc7_dsubr as new
676 typecode for the dsubr family of functions.
677
678 * ramap.c (ramap_cxr, ramap_dsubr): Renamed ramap_cxr to
679 ramap_dsubr.
680
681 * eval.c (SCM_CEVAL, SCM_APPLY, call_cxr_1), pairs.c
682 (scm_init_pairs): Make use of the (now usable) second cell element
683 of a scm_tc7_cxr function to implement the cxr family of functions
684 more efficiently.
685
2ca0d207
DH
6862003-05-31 Dirk Herrmann <D.Herrmann@tu-bs.de>
687
688 * eval.c (SCM_CEVAL, SCM_APPLY, scm_trampoline_0,
689 scm_trampoline_1, scm_trampoline_2): Postpone error cases to the
690 end of an if-else-if-sequence of checks.
691
9a069bdd
DH
6922003-05-30 Dirk Herrmann <D.Herrmann@tu-bs.de>
693
694 * eval.c (SCM_CEVAL): Improved readability of call-with-values
695 execution. Generalize apply_closure to apply_proc and use that
696 for call-with-values.
697
e910e9d2
DH
6982003-05-30 Dirk Herrmann <D.Herrmann@tu-bs.de>
699
700 * eval.c (SCM_CEVAL): Avoid one level of indirection when applying
701 a non closure.
702
1e498fbd
SJ
7032003-05-30 Stefan Jahn <stefan@lkcc.org>
704
705 * posix.c (s_scm_putenv): Use the new HAVE_UNSETENV
706 appropriately for mingw32 hosts.
707
708 * numbers.h: Defining copysign(), isnan() and finite() to
709 be prefixed by a single '_' for mingw32 hosts.
710
c47e2599
KR
7112003-05-30 Kevin Ryde <user42@zip.com.au>
712
713 * numbers.c (z_negative_one): New variable.
714 (scm_init_numbers): Initialize it.
715 (scm_logcount): Use it and mpz_hamdist to count zeros for negatives.
716
2e945bcc
SJ
7172003-05-29 Stefan Jahn <stefan@lkcc.org>
718
719 * win32-dirent.c: Use malloc() instead of scm_malloc().
720
721 * stime.c (s_scm_strftime): Add a type cast to avoid compiler
722 warning.
723
724 * posix.c (s_scm_putenv): Disable use of unsetenv() for the
725 mingw32 build.
726
727 * modules.c (s_scm_module_import_interface): Renamed local
728 variable interface to _interface. Seems like 'interface'
729 is a special compiler directive for the mingw32 compiler.
730
731 * mkstemp.c: Provide prototype to avoid compiler warning.
732
733 * load.c (s_scm_search_path): Fixed absolute and relative
734 path detections for native Windows platforms.
735
736 * gc.h, threads.h: Export some more symbols using SCM_API (necessary
737 to build on mingw32).
738
739 * gc-freelist.c ("s_scm_map_free_list",
740 "s_scm_gc_set_debug_check_freelist_x"): Fixed use of FUNC_NAME.
741
742 * fports.c (fport_fill_input): Disable use of
743 fport_wait_for_input() on Win32 platforms.
744
745 * filesys.c (s_scm_basename): Fixed __MINGW32__ code.
746
747 * Makefile.am: Modified some rules for cross compiling.
748
ddd8f927
DH
7492003-05-25 Dirk Herrmann <D.Herrmann@tu-bs.de>
750
751 * eval.c (SCM_CEVAL): In case of an application, all checks for a
752 proper function object and the correct number of arguments are now
753 performed in the application part of SCM_CEVAL.
754
755 (scm_badformalsp): Removed.
756
f8ba2197
DH
7572003-05-25 Dirk Herrmann <D.Herrmann@tu-bs.de>
758
759 * deprecated.c (scm_read_and_eval_x): Fixed C99-ism.
760
79f55b7c
MD
7612003-05-22 Mikael Djurfeldt <djurfeldt@nada.kth.se>
762
a502595f
MD
763 * num2integral.i.c (NUM2INTEGRAL): Avoid warning about conditional
764 always being false by inserting preprocessor conditional. (Thanks
765 to Bruce Korb.)
766
79f55b7c
MD
767 * __scm.h (SCM_STACK_PTR): New macro. (Cast argument through
768 (void *) in order to avoid an aliasing warning; thanks to Bruce
769 Korb.)
770
771 * stackchk.h (SCM_STACK_OVERFLOW_P): Use SCM_STACK_PTR.
772
773 * threads.c (suspend, launch_thread, scm_threads_mark_stacks): Use
774 SCM_STACK_PTR.
775
776 * threads.c (scm_threads_mark_stacks): Bugfix: Changed
777 thread->base --> t->base.
778
779 * eval.c (SCM_CEVAL): Don't cast argument of SCM_STACK_OVERFLOW_P.
780
47dee228
MV
7812003-05-20 Marius Vollmer <marius.vollmer@uni-dortmund.de>
782
783 * deprecated.h, deprecated.c (scm_makstr, scm_makfromstr,
784 scm_variable_set_name_hint, scm_builtin_variable,
785 scm_internal_with_fluids, scm_make_gsubr,
786 scm_make_gsubr_with_generic, scm_create_hook, SCM_LIST0,
787 SCM_LIST1, SCM_LIST2, SCM_LIST3, SCM_LIST4, SCM_LIST5, SCM_LIST6,
788 SCM_LIST7, SCM_LIST8, SCM_LIST9, scm_listify, scm_sloppy_memq,
85494587
MV
789 scm_sloppy_memv, scm_sloppy_member, scm_read_and_eval_x,
790 scm_subr_entry, SCM_SUBR_DOC, scm_make_subr,
791 scm_make_subr_with_generic, scm_make_subr_opt,
792 scm_call_catching_errors, scm_make_smob_type_mfpe,
793 scm_set_smob_mfpe, scm_strprint_obj, scm_read_0str, scm_eval_0str,
794 SCM_CHARS, SCM_UCHARS, SCM_LENGTH): Re-added from the release_1_6
795 branch. Some have been slightly rewritten.
796 (scm_i_object_chars, scm_i_object_length): New, to support
797 SCM_CHARS, SCM_UCHARS, and SCM_LENTH.
798
e681d187
DH
7992003-05-19 Dirk Herrmann <D.Herrmann@tu-bs.de>
800
801 * eval.c (scm_m_do, unmemocopy, SCM_CEVAL): Reversed order of
802 names and inits in the memoized code of do.
803
7e59d9d4
MD
8042003-05-19 Mikael Djurfeldt <djurfeldt@nada.kth.se>
805
806 * c-tokenize.lex (yyget_lineno, yyget_in, yyget_out, yyget_leng,
807 yyget_text, yyset_lineno, yyset_in, yyset_out, yyget_debug,
808 yyset_debug, yylex_destroy): Added prototypes (otherwise we'll get
809 a compilation error if error-on-warning is enabled).
810
9950a42c
MV
8112003-05-17 Marius Vollmer <mvo@zagadka.de>
812
813 * c-tokenize.lex: Gobble up complete lines after a '#'. This
814 removes preprocessor directives from the snarfage that might
815 otherwise confuse us. These directives appear when compiling with
816 "-g3", for example.
817
0068984b
HWN
8182003-05-16 Han-Wen Nienhuys <hanwen@cs.uu.nl>
819
26e68795
HWN
820 * ChangeLog: add my surname
821
0068984b
HWN
822 * srcprop.c (scm_finish_srcprop): use
823 scm_gc_register_collectable_memory()
824 (scm_make_srcprops): idem.
825
131805f0
HWN
8262003-05-14 Han-Wen Nienhuys <hanwen@cs.uu.nl>
827
828 * gc-malloc.c (scm_gc_register_collectable_memory): avoid
829 wrap-around for scm_mtrigger
830 (scm_gc_register_collectable_memory): abort on overflowing
831 scm_mallocated().
832
d4611024
KR
8332003-05-13 Kevin Ryde <user42@zip.com.au>
834
835 * numbers.c (xmpz_cmp_d): New macro, handling infs if gmp doesn't.
836 (scm_num_eq_p, scm_less_p, scm_max, scm_min): Use it.
837
7aaf8dc9
MD
8382003-05-12 Mikael Djurfeldt <djurfeldt@nada.kth.se>
839
dfd03fb9
MD
840 * backtrace.c (scm_display_error_message): Introduced fancy
841 printing with max level 7 and length 10. (Purpose: avoid printing
842 gigantic objects in error messages.)
843
844 * print.c, print.h (scm_i_port_with_print_state): New function.
845
846 * print.c (scm_iprin1, scm_printer_apply,
847 scm_port_with_print_state): Use scm_i_port_with_print_state.
848 (scm_simple_format): Modified not to destroy print states.
849 (print_state_mutex): New mutex.
850 (scm_make_print_state, scm_free_print_state, scm_prin1):
851 Lock/unlock print_state_mutex.
852
7aaf8dc9
MD
853 * deprecated.h (SCM_GC8MARKP, SCM_SETGC8MARK, SCM_CLRGC8MARK):
854 Use current names in definitions.
855
a4d9ffa1
KR
8562003-05-10 Kevin Ryde <user42@zip.com.au>
857
858 * numbers.c (scm_num_eq_p, scm_less_p): Don't pass NaN to mpz_cmp_d.
859
d25e96a4
KR
860 * numbers.c (scm_integer_length): On negative bignums, adjust
861 mpz_sizeinbase to account for it looking at absolute value where we
862 want ones-complement.
863
864 * numbers.c (scm_gcd): In bignum/inum, don't pass yy==0 to mpz_gcd_ui
865 since we're only using the ulong return value, and x might not fit.
866
5bf6a6f0
DH
8672003-05-06 Dirk Herrmann <D.Herrmann@tu-bs.de>
868
869 * eval.c, eval.h, read.c, read.h (scm_sym_dot): Moved from eval to
870 read. This will allow to make the definition in read.c static.
871
f58c472a
DH
8722003-05-06 Dirk Herrmann <D.Herrmann@tu-bs.de>
873
874 * eval.c, eval.h, evalext.c, evalext.h (scm_m_undefine): Moved
875 from evalext to eval. This will allow to make some of the
876 definitions in eval.c static.
877
90382aeb
KR
8782003-05-06 Kevin Ryde <user42@zip.com.au>
879
880 * numbers.c (scm_difference): In inum - bignum, handle negative inum.
881 (scm_logcount): Use mpz_com, not mpz_neg.
882
3b88ed2a
DH
8832003-05-04 Dirk Herrmann <D.Herrmann@tu-bs.de>
884
885 The purpose of this patch is to make guile's internal memoizers
886 distinguishable from memoizing macros created on the scheme level
887 or from user provided primitive memoizing macros. The reason is,
888 that the internal memoizers are the only ones that are allowed to
889 transform their scheme input into memoizer byte code, while all
890 other memoizing macros may only transform scheme code into new
891 scheme code.
892
893 To achieve this, a new macro type 'builtin-macro!' is introduced.
894 Currently, 'builtin-macro!'s are handled as memoizing macros, but
895 this will change when the memoizer and executor are separated.
896
897 * macros.[ch] (scm_i_makbimacro): New.
898
899 * macros.h (SCM_BUILTIN_MACRO_P): New.
900
901 * macros.c (macro_print, scm_macro_type): Support builtin-macro!s.
902
903 * eval.c, goops.c: All of guile's primitive memoizing macros are
904 primitive builtin-macros now.
905
906 * eval.c (scm_macroexp, SCM_CEVAL): Make sure the primitive
907 builtin-macros are handled equally to memoizing macros.
908
b0780eb1
MV
9092003-05-04 Marius Vollmer <mvo@zagadka.de>
910
911 * throw.c (scm_ithrow): Remove "asm volatile" hack. It used to
912 work around a bug in GCC 2.95.2 but is now a bug in itself.
913
1cbf4fe9
MV
9142003-05-02 Marius Vollmer <mvo@zagadka.de>
915
916 * deprecated.h (scm_rstate, scm_rng, SCM_SLOPPY_CONSP,
917 SCM_SLOPPY_NCONSP, scm_tc7_ssymbol, scm_tc7_msymbol,
918 scm_tcs_symbols): New.
919
1a61d41b
MV
9202003-04-30 Marius Vollmer <marius.vollmer@uni-dortmund.de>
921
096ecbaf
MV
922 * deprecated.h, deprecated.c (scm_protect_object,
923 scm_unprotect_object, SCM_SETAND_CAR, SCM_SETOR_CAR,
924 SCM_SET_AND_CDR, SCM_SET_OR_CDR, SCM_FREEP, SCM_NFREEP,
925 SCM_GC8MARKP, SCM_SETGC8MARK, SCM_CLRGC8MARK, SCM_GCTYP16,
926 SCM_GCCDR, scm_remember, scm_the_root_module, scm_make_module,
927 scm_ensure_user_module, scm_load_scheme_module, scm_port,
928 scm_ptob_descriptor, scm_port_rw_active,
929 scm_close_all_ports_except): New.
930
1a61d41b
MV
931 * ports.c (scm_c_port_for_each): New function, mostly copied from
932 scm_port_for_each.
933 (scm_port_for_each): Reimplemented using scm_c_port_for_each.
934 * ports.h (scm_c_port_for_each): New prototype.
935
c8e1d354
MD
9362003-04-28 Mikael Djurfeldt <djurfeldt@nada.kth.se>
937
938 * eval.c (scm_m_atdispatch): Removed until actually needed. (This
939 macro was introduced in anticipation of GOOPS method compilation
940 code.)
941
942 * goops.c: Removed binding of @dispatch.
943
a4aa2134
DH
9442003-04-28 Dirk Herrmann <D.Herrmann@tu-bs.de>
945
946 * eval.c, goops.c (@dispatch, @slot-ref, @slot-set!): Move the
947 instructions that bind the macros on the scheme level back to
948 goops.c in order to make sure again that the bindings go into the
949 (oop goops) module and are not visible from the outside.
950
9fbee57e
DH
9512003-04-27 Dirk Herrmann <D.Herrmann@tu-bs.de>
952
953 * eval.c: Non functional change: Separated R5RS and non-R5RS
954 macros into different sections of the file and ordered the
955 memoizers alphabetically.
956
12841895
DH
9572003-04-27 Dirk Herrmann <D.Herrmann@tu-bs.de>
958
959 * eval.c (scm_ilookup): Rewritten to improve readability.
960
6a3f13f0
DH
9612003-04-27 Dirk Herrmann <D.Herrmann@tu-bs.de>
962
963 * eval.c (scm_i_call_closure_0, call_closure_1, call_closure_2):
964 Partially reverted patch from 2003-04-23 in oder to find a better
965 compromise between readability and debuggability.
966
b0c5d67b
DH
9672003-04-25 Dirk Herrmann <D.Herrmann@tu-bs.de>
968
969 * eval.c, eval.h, goops.c, goops.h (scm_m_atslot_ref,
970 scm_m_atslot_set_x, scm_m_atdispatch): Move the declarations and
971 definitions of the special goops memoizers from goops.[ch] to
972 eval.[ch]. Hmm... it seems that scm_m_atdispatch is not used
973 throughout guile.
974
b9ad392e
MD
9752003-04-24 Mikael Djurfeldt <mdj@kvast.blakulla.net>
976
977 * ports.c, ports.h (scm_i_port_table_mutex): New mutex.
978
979 * fports.c (scm_evict_ports): Lock/unlock scm_i_port_table_mutex.
980
981 * ports.c (scm_close_port, scm_flush_all_ports): Ditto.
982
983 * ioext.c (scm_fdes_to_ports): Ditto.
984
985 * vports.c (scm_make_soft_port): Changed SCM_DEFER/ALLOW_INTS into
986 lock/unlock scm_i_port_table_mutex.
987
988 * strports.c (scm_mkstrport): Ditto.
989
990 * ports.c (scm_void_port, scm_port_for_each): Ditto.
991
992 * fports.c (scm_fdes_to_port): Ditto.
993
d0b07b5d
DH
9942003-04-23 Dirk Herrmann <D.Herrmann@tu-bs.de>
995
996 This set of patches contains no functional changes, only debatable
997 minor stylistic ones. Still, in order to prepare a patch between
998 my local copy and the CVS version, I decided to submit the changes
999 below. Then, the patch will hopefully only contain relevant
1000 modifications :-)
1001
1002 * eval.c (iqq): Added const specifier.
1003
1004 * eval.c (scm_trampoline_0, scm_trampoline_1, scm_trampoline_2):
1005 Use NULL instead of 0 to indicate that a pointer is returned.
1006 Removed some misleading 'fall through' comments.
1007
1008 * eval.c (scm_i_call_closure_0, call_closure_1, call_closure_2):
1009 Split up long expressions into smaller ones to be more debugging
1010 friendly.
1011
a98e8e98
DH
10122003-04-23 Dirk Herrmann <D.Herrmann@tu-bs.de>
1013
1014 * eval.h (SCM_ENTER_FRAME_HDLR, SCM_APPLY_FRAME_HDLR,
1015 SCM_EXIT_FRAME_HDLR): Use SCM_PACK to convert data to a SCM value
1016 rather than casting to SCM.
1017
c178c3a6
DH
10182003-04-23 Dirk Herrmann <D.Herrmann@tu-bs.de>
1019
1020 * sort.c, pairs.h: Removed unnecessary includes.
1021
d339981a
DH
10222003-04-23 Dirk Herrmann <D.Herrmann@tu-bs.de>
1023
1024 * sort.c: Replaced hand-made trampline code by the new official
1025 mechanism from eval.c. This fixes a segfault in the new test file
1026 sort.test.
1027
1028 (quicksort, compare_function, scm_restricted_vector_sort_x,
1029 scm_sorted_p, scm_merge, scm_merge_list_x, scm_merge_x,
1030 scm_merge_list_step, scm_sort_x, scm_sort, scm_merge_vector_x,
1031 scm_merge_vector_step, scm_stable_sort_x, scm_stable_sort,
1032 scm_sort_list_x, scm_sort_list): Use trampoline mechanism from
1033 eval.c.
1034
1035 (subr2less, lsubrless, closureless, applyless, scm_cmp_function,
1036 cmp_fun_t): Removed.
1037
1038 (compare_function): Added.
1039
1040 * sort.c (quicksort, SWAP, stack_node): Replaced pointer
1041 arithmetics with index arithmetics. Changed quicksort to work on
1042 an array of SCM values instead of an array of characters. Avoid
1043 bytewise copying of SCM elements. Avoid allocating memory on the
1044 stack with alloca. Fixed some comments.
1045
821f18a4
DH
10462003-04-21 Dirk Herrmann <D.Herrmann@tu-bs.de>
1047
1048 * eval.c (EXTEND_ENV): Eliminated.
1049
1050 (unmemocopy, SCM_CEVAL, SCM_APPLY): Use SCM_EXTEND_ENV instead of
1051 EXTEND_ENV.
1052
94fb5a6e
DH
10532003-04-21 Dirk Herrmann <D.Herrmann@tu-bs.de>
1054
1055 * __scm.h (SCM_DEBUG_DEBUGGER_SUPPORT): New compile-time option.
1056
1057 * gc.card.c (scm_gc_marked_p): Fixed compiler warning when
1058 compiling with SCM_DEBUG==1 by moving definition behind prototype.
1059
1060 * gc.card.c (scm_dbg_t_list_cell, scm_dbg_t_double_cell,
1061 scm_dbg_gc_marked_p, scm_dbg_gc_get_card, scm_dbg_gc_get_bvec,
1062 scm_t_list_cell_struct, scm_t_list_cell, scm_t_double_cell,
1063 scm_gc_marked_p, scm_gc_get_card, scm_gc_get_bvec): Fixed
1064 functions such that they check if the object is a non-immediate.
1065 Further, renamed identifiers to use the scm_dbg_ prefix and made
1066 their inclusion into the lib dependent of the
1067 SCM_DEBUG_DEBUGGER_SUPPORT compile time option.
1068
fce0b22d
DH
10692003-04-21 Dirk Herrmann <D.Herrmann@tu-bs.de>
1070
1071 * __scm.h: Fixed comment about the SCM_DEBUG_TYPING_STRICTNESS
1072 debug option.
1073
1685446c
DH
10742003-04-21 Dirk Herrmann <D.Herrmann@tu-bs.de>
1075
821f18a4 1076 * list.c (scm_ilength, scm_last_pair), unif.c (l2ra): Prefer
1685446c
DH
1077 !SCM_CONSP over SCM_NCONSP. Now, guile itself does not include
1078 any calls to SCM_NCONSP any more.
1079
1080 * unif.c (l2ra): Eliminate redundant check.
1081
9ff1720f
DH
10822003-04-21 Dirk Herrmann <D.Herrmann@tu-bs.de>
1083
1084 * list.c (scm_cons_star), ramap.c (scm_ra_sum, scm_ra_product,
1085 scm_array_map_x), unif.c (l2ra): Prefer !SCM_NULLP over
1086 SCM_NNULLP. Now, guile itself does not include any calls to
1087 SCM_NNULLP any more.
1088
05b15362
DH
10892003-04-21 Dirk Herrmann <D.Herrmann@tu-bs.de>
1090
1091 * eval.c (unmemocopy, SCM_APPLY, scm_map, scm_for_each,
1092 scm_copy_tree): Place assignment expressions which are part of
1093 other expressions into an expression of their own.
1094
0c88d7df
DH
10952003-04-21 Dirk Herrmann <D.Herrmann@tu-bs.de>
1096
1097 * goops.c (TEST_CHANGE_CLASS, scm_sys_initialize_object): Don't
1098 compare SCM values with !=.
1099
5cb22e96
DH
11002003-04-20 Dirk Herrmann <D.Herrmann@tu-bs.de>
1101
1102 * eval.c, eval.h, evalext.c, evalext.h (scm_sym_setter,
1103 scm_m_generalized_set_x, scm_init_evalext): Move the declaration
1104 and definition of the memoizer for the generalized set! macro from
1105 evalext.[ch] to eval.[ch]. Use the SCM_SYNTAX snarfer macro to
1106 define the macro object.
1107
1108 * eval.c, eval.h (s_set_x, scm_s_set_x, scm_m_set_x,
1109 scm_m_generalized_set_x): Since now scm_s_set_x is only used in
1110 eval.c, it is made static and renamed to s_set_x.
1111
1112 * evalext.c (scm_defined_p, scm_m_undefine): Prefer !SCM_<foo>
1113 over SCM_N<foo>.
1114
a44a9715
DH
11152003-04-20 Dirk Herrmann <D.Herrmann@tu-bs.de>
1116
1117 * eval.c, root.h (scm_undefineds, SCM_NUM_PROTECTS, undefineds,
1118 scm_init_eval): Made scm_undefineds static in eval.c, renamed it
1119 to undefineds and registered the object as a permanent object.
1120
1121 * eval.c, eval.h (scm_f_apply, scm_init_eval): Made scm_f_apply
1122 static in eval.c, renamed it to f_apply and registered the object
1123 as a permanent object.
1124
1b43d24c
DH
11252003-04-20 Dirk Herrmann <D.Herrmann@tu-bs.de>
1126
5cb22e96 1127 * eval.c (SCM_BIT7, SCM_BIT8, unmemocopy, SCM_CEVAL): Renamed
1b43d24c
DH
1128 file-local macro SCM_BIT8 to SCM_BIT7, which is more appropriate.
1129
aec16f99
DH
11302003-04-20 Dirk Herrmann <D.Herrmann@tu-bs.de>
1131
1132 * numbers.c (scm_logtest): Fixed argument bug in the call to
1133 mpz_and, which showed up when compiling with SCM_DEBUG defined.
1134
f96460ce
DH
11352003-04-20 Dirk Herrmann <D.Herrmann@tu-bs.de>
1136
1137 * gc-card.c (scm_i_sweep_card, scm_i_init_card_freelist): Fixed
1138 type errors that showed up when compiling with SCM_DEBUG defined.
1139
d0f6ceb8
DH
11402003-04-20 Dirk Herrmann <D.Herrmann@tu-bs.de>
1141
1142 * continuations.c, continuations.h, eval.c, eval.h, extensions.c,
1143 gsubr.c, guile.c, init.c, read.c, root.c, root.h, stackchk.h,
1144 throw.c: Removed uses of DEBUG_EXTENSIONS and DYNAMIC_LINKING to
1145 fix compile errors with --disable-deprecated.
1146
19a7a089
RB
11472003-04-17 Rob Browning <rlb@defaultvalue.org>
1148
1149 * numbers.c (scm_integer_expt): fix case where we were declaring
1150 vars in the middle of a statement block. Thanks to Thamer
1151 Al-Harbash.
1152
47cd67db
MD
11532003-04-17 Mikael Djurfeldt <djurfeldt@nada.kth.se>
1154
0fd7dcd3
MD
1155 * goops.c (TEST_CHANGE_CLASS): Update variable class after class
1156 change.
1157
47cd67db
MD
1158 * eq.c (scm_eqv_p): Turned into a primitive generic.
1159
3b8b889c
RB
11602003-04-16 Rob Browning <rlb@defaultvalue.org>
1161
312006bb
RB
1162 * gc_os_dep.c: Added patch for UnixWare and OpenUNIX support.
1163 Thanks to Boyd Gerber.
1164 Added check for __arm__ in addition to arm for LINUX and copied
1165 __s390__ defines from upstream libgc. Thanks to James Treacy for
1166 reporting the problems.
c7ef2ea1 1167
3b8b889c
RB
1168 * numbers.c (PTRDIFF_MIN): use SCM_CHAR_BIT.
1169
1170 * socket.c: use SCM_CHAR_BIT.
1171
1172 * random.c (scm_c_random_bignum): use SCM_CHAR_BIT.
1173
1174 * num2integral.i.c (NUM2INTEGRAL): use SCM_CHAR_BIT.
1175
43261b39
MD
11762003-04-16 Mikael Djurfeldt <mdj@kvast.blakulla.net>
1177
1178 * feature.c (scm_init_feature): Always add threads feature.
1179
58241edc
MD
11802003-04-15 Mikael Djurfeldt <djurfeldt@nada.kth.se>
1181
1182 * goops.c (scm_sys_fast_slot_ref): Use SCM_SLOT instead of
1183 scm_at_assert_bound_ref. (We don't want the unbound check. See
1184 oop/goops/active-slot.scm.)
1185
94e91275
RB
11862003-04-14 Rob Browning <rlb@defaultvalue.org>
1187
1188 * tags.h: scm_t_intptr should have been intptr_t.
1189
3071ea27
RB
11902003-04-13 Rob Browning <rlb@defaultvalue.org>
1191
1192 * __scm.h (SCM_FLUSH_REGISTER_WINDOWS): don't just rely on "sparc"
1193 test. Instead use
1194 #if defined (sparc) || defined (__sparc__) || defined (__sparc)
1195 as gc_os_dep.c suggests is appropriate.
1196
1197 * goops.c (prep_hashsets): make static to match prototype.
1198 (scm_sym_args): SCM_SYMBOL -> SCM_GLOBAL_SYMBOL. Thanks to Albert
1199 Chin.
1200
1201 * c-tokenize.lex: remove trailing comma from enum. Thanks to
1202 Albert Chin.
1203
1204 * gc_os_dep.c: add NetBSD powerpc config info. Thanks to Thomas
1205 Klausner.
1206
21ab2aeb
MD
12072003-04-13 Mikael Djurfeldt <djurfeldt@nada.kth.se>
1208
1209 * goops.c (scm_sys_prep_layout_x): Instance allocation is now
1210 indicated through extra fields in getters-n-setters.
1211 (scm_add_slot): Adapted to new format of getters_n_setters slot.
1212 (Thanks to Andy Wingo.)
1213
dff96e95
HWN
12142003-02-25 Han-Wen Nienhuys <hanwen@cs.uu.nl>
1215
1216 * gc-segment.c: add comment
1217
07921c76
RB
12182003-04-07 Rob Browning <rlb@defaultvalue.org>
1219
b5331f10
RB
1220 * debug.h: change "id" arg name to "info_id" to avoid objective-c
1221 clash.
1222
07921c76
RB
1223 * num2integral.i.c (NUM2INTEGRAL): fix bug pointed out by Mikael
1224 and add regression test to standalone/.
1225
12262003-04-06 Rob Browning <rlb@defaultvalue.org>
1227
1228 * strings.c (scm_mem2string): use memcpy rather than by-hand loop.
1229 Thanks to Dale P. Smith.
1230
1231 * random.c: #include gmp.h.
1232 (scm_c_random_bignum): normalize result on return.
1233
1234 * init.c: #include gmp.h.
1235
1236 * numbers.h: remove the gmp.h #include (not needed now).
1237
1238 * posix.h: change occurences of "id" to something else so we don't
1239 cause trouble when included via objective-c (can't hurt, might
1240 help). Still have usage in debug.h, though.
1241
938f6b7c
MD
12422003-04-06 Mikael Djurfeldt <djurfeldt@nada.kth.se>
1243
372691d8
MD
1244 * random.c (scm_c_random_bignum): Don't generate a random number
1245 equal to m (the second argument of scm_c_random_bignum); only
1246 generate numbers in the range 0 <= r < m.
c5f268f8
MD
1247 (scm_c_default_rstate): Use SCM_VARIABLE_REF to access
1248 scm_var_random_state.
372691d8 1249
938f6b7c
MD
1250 * num2integral.i.c (INTEGRAL2BIG): Put negation of n inside then
1251 clause.
1252
6cdb8c3f
RB
12532003-04-05 Rob Browning <rlb@defaultvalue.org>
1254
938f6b7c 1255 * modules.c (scm_module_import_interface): move declaration of
6cdb8c3f
RB
1256 uses before any code.
1257
15635be5
MD
12582003-04-05 Mikael Djurfeldt <djurfeldt@nada.kth.se>
1259
1ecfd013
MD
1260 * Makefile.am (scmconfig.h): Look for config.h in top_builddir,
1261 not top_srcdir.
1262
15635be5
MD
1263 * hashtab.c (rehash_after_gc): Clear to_rehash list before
1264 processing it in order to avoid an infinite loop.
1265
1266 * print.c (scm_prin1): Remember old state of pstate->writingp.
1267
73be1d9e
MV
12682003-04-05 Marius Vollmer <mvo@zagadka.de>
1269
1270 * Changed license terms to the plain LGPL thru-out.
1271
ad815c06
RB
12722003-04-04 Rob Browning <rlb@defaultvalue.org>
1273
1274 * socket.c (FLIPCPY_NET_HOST_128): new macro.
1275 (ipv6_net_to_num, ipv6_num_to_net, bignum_in_ipv6_range_p):
1276 rewrite to handle GMP bignums.
1277
1278
1279 * random.c (scm_c_random_bignum): rewrite to handle GMP bignums.
1280
1281 * ports.c (scm_getc): minor tweak.
1282
1283 * numbers.h: remove SCM_BIGDIG conditionals, reorganize, and
1284 rewrite to handle GMP bignums.
1285
1286 * numbers.c: rewrite *many* functions to handle GMP bignums.
1287
1288 * num2integral.i.c (NUM2INTEGRAL, INTEGRAL2NUM, INTEGRAL2BIG):
1289 handle GMP bignums.
1290
1291 * num2float.i.c (NUM2FLOAT): handle GMP bignums.
1292
1293 * init.c (check_config): remove SCM_BIGDIG conditionals.
1294 (scm_init_guile_1): test to make sure mpz_t fits in a double_cell.
1295
1296 * gc-card.c ("sweep_card"): handle new mpz_t bignums.
1297
1298 * eval.c: remove SCM_BIGDIG conditionals.
1299
1300 * eq.c (s_scm_eqv_p): scm_i_bigcomp -> scm_i_bigcmp.
1301
6cdb8c3f
RB
13022003-03-31 Rob Browning <rlb@defaultvalue.org>
1303
1304 * Makefile.am (scmconfig.h): change srcdir to builddir. (Thanks
1305 to Kevin Ryde.)
1306
13072003-03-27 Rob Browning <rlb@defaultvalue.org>
1308
1309 * threads.h: fix various preprocessor usages of new public
1310 symbols to expect 0 or 1 values rather than 1 or undefined.
1311 i.e. change #ifdef to #if, etc.
1312
1313 * threads.c: fix various preprocessor usages of new public
1314 symbols to expect 0 or 1 values rather than 1 or undefined.
1315 i.e. change #ifdef to #if, etc.
1316
1317 * tags.h: fix various preprocessor usages of new public
1318 symbols to expect 0 or 1 values rather than 1 or undefined.
1319 i.e. change #ifdef to #if, etc.
1320
1321 * stacks.c: fix various preprocessor usages of new public
1322 symbols to expect 0 or 1 values rather than 1 or undefined.
1323 i.e. change #ifdef to #if, etc.
1324
1325 * stackchk.h: fix various preprocessor usages of new public
1326 symbols to expect 0 or 1 values rather than 1 or undefined.
1327 i.e. change #ifdef to #if, etc.
1328
1329 * stackchk.c: fix various preprocessor usages of new public
1330 symbols to expect 0 or 1 values rather than 1 or undefined.
1331 i.e. change #ifdef to #if, etc.
1332
1333 * sort.c: fix various preprocessor usages of new public
1334 symbols to expect 0 or 1 values rather than 1 or undefined.
1335 i.e. change #ifdef to #if, etc.
1336
1337 * read.c: fix various preprocessor usages of new public
1338 symbols to expect 0 or 1 values rather than 1 or undefined.
1339 i.e. change #ifdef to #if, etc.
1340
1341 * random.c: fix various preprocessor usages of new public
1342 symbols to expect 0 or 1 values rather than 1 or undefined.
1343 i.e. change #ifdef to #if, etc.
1344
1345 * print.c: fix various preprocessor usages of new public
1346 symbols to expect 0 or 1 values rather than 1 or undefined.
1347 i.e. change #ifdef to #if, etc.
1348
1349 * objects.c: fix various preprocessor usages of new public
1350 symbols to expect 0 or 1 values rather than 1 or undefined.
1351 i.e. change #ifdef to #if, etc.
1352
1353 * numbers.h: fix various preprocessor usages of new public
1354 symbols to expect 0 or 1 values rather than 1 or undefined.
1355 i.e. change #ifdef to #if, etc.
1356
1357 * null-threads.c: fix various preprocessor usages of new public
1358 symbols to expect 0 or 1 values rather than 1 or undefined.
1359 i.e. change #ifdef to #if, etc.
1360
1361 * lang.c: fix various preprocessor usages of new public
1362 symbols to expect 0 or 1 values rather than 1 or undefined.
1363 i.e. change #ifdef to #if, etc.
1364
1365 * lang.h: fix various preprocessor usages of new public
1366 symbols to expect 0 or 1 values rather than 1 or undefined.
1367 i.e. change #ifdef to #if, etc.
1368
1369 * iselect.h: fix various preprocessor usages of new public
1370 symbols to expect 0 or 1 values rather than 1 or undefined.
1371 i.e. change #ifdef to #if, etc.
1372
1373 * init.c: fix various preprocessor usages of new public
1374 symbols to expect 0 or 1 values rather than 1 or undefined.
1375 i.e. change #ifdef to #if, etc.
1376
1377 * gh_data.c: fix various preprocessor usages of new public
1378 symbols to expect 0 or 1 values rather than 1 or undefined.
1379 i.e. change #ifdef to #if, etc.
1380
1381 * gh.h: fix various preprocessor usages of new public
1382 symbols to expect 0 or 1 values rather than 1 or undefined.
1383 i.e. change #ifdef to #if, etc.
1384
1385 * gen-scmconfig.c: change most new public symbols to be defined to
1386 0 or 1 rather than being either 1 or undefined.
1387
1388 * gc_os_dep.c: fix various preprocessor usages of new public
1389 symbols to expect 0 or 1 values rather than 1 or undefined.
1390 i.e. change #ifdef to #if, etc.
1391 (STACK_GROWS_DOWN): define to 0 or 1 rather than 1 or undef.
1392
1393 * gc.h: fix various preprocessor usages of new public
1394 symbols to expect 0 or 1 values rather than 1 or undefined.
1395 i.e. change #ifdef to #if, etc.
1396
1397 * gc-card.c: fix various preprocessor usages of new public
1398 symbols to expect 0 or 1 values rather than 1 or undefined.
1399 i.e. change #ifdef to #if, etc.
1400
1401 * gc-mark.c: fix various preprocessor usages of new public
1402 symbols to expect 0 or 1 values rather than 1 or undefined.
1403 i.e. change #ifdef to #if, etc.
1404
1405 * feature.c: fix various preprocessor usages of new public
1406 symbols to expect 0 or 1 values rather than 1 or undefined.
1407 i.e. change #ifdef to #if, etc.
1408
1409 * evalext.c: fix various preprocessor usages of new public
1410 symbols to expect 0 or 1 values rather than 1 or undefined.
1411 i.e. change #ifdef to #if, etc.
1412
1413 * eval.h: fix various preprocessor usages of new public
1414 symbols to expect 0 or 1 values rather than 1 or undefined.
1415 i.e. change #ifdef to #if, etc.
1416
1417 * eval.c: fix various preprocessor usages of new public
1418 symbols to expect 0 or 1 values rather than 1 or undefined.
1419 i.e. change #ifdef to #if, etc.
1420
1421 * eq.c: fix various preprocessor usages of new public
1422 symbols to expect 0 or 1 values rather than 1 or undefined.
1423 i.e. change #ifdef to #if, etc.
1424
1425 * coop.c: fix various preprocessor usages of new public
1426 symbols to expect 0 or 1 values rather than 1 or undefined.
1427 i.e. change #ifdef to #if, etc.
1428
1429 * coop-threads.c: fix various preprocessor usages of new public
1430 symbols to expect 0 or 1 values rather than 1 or undefined.
1431 i.e. change #ifdef to #if, etc.
1432
1433 * coop-pthreads.c: fix various preprocessor usages of new public
1434 symbols to expect 0 or 1 values rather than 1 or undefined.
1435 i.e. change #ifdef to #if, etc.
1436
1437 * coop-defs.h: fix various preprocessor usages of new public
1438 symbols to expect 0 or 1 values rather than 1 or undefined.
1439 i.e. change #ifdef to #if, etc.
1440
1441 * convert.i.c: fix various preprocessor usages of new public
1442 symbols to expect 0 or 1 values rather than 1 or undefined.
1443 i.e. change #ifdef to #if, etc.
1444
1445 * continuations.c: fix various preprocessor usages of new public
1446 symbols to expect 0 or 1 values rather than 1 or undefined.
1447 i.e. change #ifdef to #if, etc.
1448
1449 * _scm.h: fix various preprocessor usages of new public symbols to
1450 expect 0 or 1 values rather than 1 or undefined. i.e. change
1451 #ifdef to #if, etc.
1452
d11d697a
MV
14532003-03-26 Marius Vollmer <marius.vollmer@uni-dortmund.de>
1454
9686f86d
MV
1455 * init.c (scm_init_guile_1): Call scm_i_init_deprecated.
1456
1457 * deprecated.c, deprecated.h: New files, to collect deprecated
1458 things in one place.
1459 * Makefile.am: Added them in all the right places.
1460
d11d697a
MV
1461 * Makefile.am (EXTRA_DIST): Added "scmconfig.h.top".
1462 (scmconfig.h): Get "scmconfig.h.top" from $(srcdir) so that VPATH
1463 builds work.
9686f86d
MV
1464 (DOT_X_FILES): Removed "iselect.x".
1465 (DOT_DOC_FILES): Removed "iselect.doc".
d11d697a 1466
e3c0c3b9
RB
14672003-03-25 Rob Browning <rlb@defaultvalue.org>
1468
1469 * win32-socket.h: #include "libguile/__scm.h". Replace usage of
1470 HAVE_WINSOCK2_H with SCM_HAVE_WINSOCK2_H.
1471
1472 * win32-socket.c: #include <config.h> if HAVE_CONFIG_H.
1473
1474 * vports.c: #include <config.h> if HAVE_CONFIG_H.
1475
1476 * unif.c: #include <config.h> if HAVE_CONFIG_H. Replace usage of
1477 HAVE_LONG_LONGS with "SCM_SIZEOF_LONG_LONG != 0".
1478
1479 * threads.h: replace usage of struct timespect with
1480 scm_t_timespec. Replace usage of USE_PTHREAD_THREADS with
1481 SCM_USE_PTHREAD_THREADS. Remove typedef for struct timespec in
1482 favor of scm_t_timespec from scmconfig.h.
1483
1484 * threads.c: move libguile/_scm.h include to the top so we pick up
1485 any critical defines like _GNU_SOURCE early. Replace usage of
1486 struct timespect with scm_t_timespec. Replace usage of
1487 STACK_GROWS_UP with SCM_STACK_GROWS_UP. Replace usage of
1488 USE_PTHREAD_THREADS with SCM_USE_PTHREAD_THREADS.
1489
1490 * threads-plugin.h: replace usage of struct timespect with
1491 scm_t_timespec.
1492
1493 * threads-plugin.c: #include <config.h> if HAVE_CONFIG_H. Replace
1494 usage of struct timespect with scm_t_timespec.
1495
1496 * tags.h: move HAVE_STDINT_H handling to scmconfig.h. Move
1497 HAVE_INTTYPES_H handling to scmconfig.h. #include
1498 "libguile/__scm.h". Rework handling for scm_t_bits,
1499 scm_t_signed_bits, SCM_T_BITS_MAX, SCM_T_SIGNED_BITS_MAX,
1500 SCM_T_SIGNED_BITS_MIN, and SIZEOF_SCM_T_BITS to use scm_t_intptr,
1501 scm_t_uintptr, SCM_SIZEOF_INTPTR_T, and SCM_SIZEOF_UINTPTR_T, and
1502 SCM_SIZEOF_UNSIGNED_LONG. Rename usage of HAVE_ARRAYS to
1503 SCM_HAVE_ARRAYS.
1504
1505 * symbols.c: #include <config.h> if HAVE_CONFIG_H.
1506
1507 * struct.c: #include <config.h> if HAVE_CONFIG_H.
1508
1509 * strports.c: #include <config.h> if HAVE_CONFIG_H.
1510
1511 * strop.c: #include <config.h> if HAVE_CONFIG_H.
1512
1513 * stime.h: move handling of time related headers to scmconfig.h.
1514
1515 * stime.c: #include <config.h> if HAVE_CONFIG_H.
1516
1517 * stacks.c: replace usage of STACK_GROWS_UP with
1518 SCM_STACK_GROWS_UP.
1519
1520 * sort.c: #include <config.h> if HAVE_CONFIG_H. Rename usage of
1521 HAVE_ARRAYS to SCM_HAVE_ARRAYS.
1522
1523 * socket.c: #include <config.h> if HAVE_CONFIG_H. Replace usage
1524 of uint32 and HAVE_UINT_32 with scm_t_int32.
1525
1526 * smob.c: #include <config.h> if HAVE_CONFIG_H.
1527
1528 * simpos.c: #include <config.h> if HAVE_CONFIG_H.
1529
1530 * script.c: #include <config.h> if HAVE_CONFIG_H.
1531
1532 * scmsigs.c: #include <config.h> if HAVE_CONFIG_H.
1533
1534 * scmconfig.h.top: new file -- preamble for scmconfig.h.
1535
1536 * rw.c: #include <config.h> if HAVE_CONFIG_H.
1537
1538 * regex-posix.c: #include <config.h> if HAVE_CONFIG_H.
1539
1540 * read.c: rename usage of HAVE_ARRAYS to SCM_HAVE_ARRAYS.
1541
1542 * rdelim.c: #include <config.h> if HAVE_CONFIG_H.
1543
1544 * random.c: #include <config.h> if HAVE_CONFIG_H. Replace usage
1545 of LONG32, LONG64, SIZEOF_LONG, and HAVE_LONG_LONGS with
1546 scm_t_int32, scm_t_int64, and SCM_HAVE_T_INT64. Rename usage of
1547 HAVE_ARRAYS to SCM_HAVE_ARRAYS.
1548
1549 * ramap.c: replace usage of HAVE_LONG_LONGS with
1550 "SCM_SIZEOF_LONG_LONG != 0".
1551
1552 * putenv.c: #include <config.h> if HAVE_CONFIG_H. #include
1553 "libguile/scmconfig.h".
1554
1555 * pthread-threads.c: #include <config.h> if HAVE_CONFIG_H.
1556
1557 * print.c: rename usage of HAVE_ARRAYS to SCM_HAVE_ARRAYS.
1558 Replace usage of HAVE_LONG_LONGS with "SCM_SIZEOF_LONG_LONG != 0".
1559
1560 * posix.c: #include <config.h> if HAVE_CONFIG_H.
1561
1562 * ports.c: #include <config.h> if HAVE_CONFIG_H.
1563
1564 * objects.c: rename usage of HAVE_ARRAYS to SCM_HAVE_ARRAYS.
1565
1566 * numbers.h: replace usage of HAVE_FLOATINGPOINT_H with
1567 SCM_HAVE_FLOATINGPOINT_H. Replace usage of HAVE_IEEEFP_H with
1568 SCM_HAVE_IEEEFP_H. Replace usage of HAVE_NAN_H with
1569 SCM_HAVE_NAN_H. Replace usage of STDC_HEADERS with
1570 SCM_HAVE_STDC_HEADERS. Replace usage of ptrdiff_t with
1571 scm_t_ptrdiff. Replace usage of HAVE_LONG_LONGS with
1572 "SCM_SIZEOF_LONG_LONG != 0".
1573
1574 * numbers.c: #include <config.h> if HAVE_CONFIG_H. Replace usage
1575 of HAVE_LONG_LONGS with "SCM_SIZEOF_LONG_LONG != 0". Replace
1576 usage of ptrdiff_t with scm_t_ptrdiff. Replace usage of
1577 SIZEOF_PTRDIFF_T with SCM_SIZEOF_SCM_T_PTRDIFF.
1578
1579 * num2integral.i.c: #include <config.h> if HAVE_CONFIG_H.
1580
1581 * null-threads.h: replace usage of struct timespect with
1582 scm_t_timespec.
1583
1584 * net_db.c: #include <config.h> if HAVE_CONFIG_H.
1585
1586 * mkstemp.c: #include <config.h> if HAVE_CONFIG_H. #include
1587 "libguile/__scm.h". Remove definition of gcc_uint64_t in favor of
1588 scm_t_uint64 and rename usages.
1589
1590 * mallocs.c: #include <config.h> if HAVE_CONFIG_H.
1591
1592 * load.c: #include <config.h> if HAVE_CONFIG_H.
1593
1594 * iselect.h: move handling of time related headers to scmconfig.h.
1595 Rename usage of HAVE_SYS_SELECT_H to SCM_HAVE_SYS_SELECT_H.
1596 Rename usage of HAVE_WINSOCK2_H to SCM_HAVE_WINSOCK2_H. Rename
1597 usage of USE_COOP_THREADS to SCM_USE_COOP_THREADS.
1598
1599 * iselect.c: #include <config.h> if HAVE_CONFIG_H. Rename usage
1600 of USE_COOP_THREADS to SCM_USE_COOP_THREADS. Rename usage of
1601 USE_NULL_THREADS to SCM_USE_NULL_THREADS.
1602
1603 * ioext.c: #include <config.h> if HAVE_CONFIG_H.
1604
1605 * inline.h: #include "libguile/__scm.h" at the top. Change code
1606 to use SCM_C_INLINE and SCM_INLINE_C_INCLUDINT_INLINE_H to decide
1607 what to do instead of creating a new public #define. Rename usage
1608 of USE_COOP_THREADS to SCM_USE_COOP_THREADS. Rename usage of
1609 USE_NULL_THREADS to SCM_USE_NULL_THREADS. Rename usage of
1610 USE_COPT_THREADS to SCM_USE_COPT_THREADS.
1611
1612 * inline.c: rearrange handling -- now we just #define
1613 SCM_INLINE_C_INCLUDING_INLINE_H to 1 and #include
1614 "libguile/inline.h". scmconfig.h will define SCM_C_INLINE as
1615 appropriate, and we use that in inline.h along with the above
1616 define to determine how to respond.
1617
1618 * init.c: #include <config.h> if HAVE_CONFIG_H. Rename usage of
1619 HAVE_ARRAYS to SCM_HAVE_ARRAYS.
1620
1621 * guile.c: #include <config.h> if HAVE_CONFIG_H.
1622
1623 * gh_data.c: #include <config.h> if HAVE_CONFIG_H. Rename usage
1624 of HAVE_ARRAYS to SCM_HAVE_ARRAYS.
1625
1626 * gh.h: rename usage of HAVE_ARRAYS to SCM_HAVE_ARRAYS.
1627
1628 * gen-scmconfig.h.in: new file -- see gen-scmconfig.c for details.
1629
1630 * gen-scmconfig.c: new file -- see comments in file for details.
1631
1632 * gdbinit.c: #include <config.h> if HAVE_CONFIG_H.
1633
1634 * gc_os_dep.c: #include <config.h> if HAVE_CONFIG_H. Replace
1635 usage of STACK_GROWS_UP with SCM_STACK_GROWS_UP.
1636
1637 * gc.h: replace usage of SIZEOF_LONG with
1638 SCM_SIZEOF_UNSIGNED_LONG. Replace usage of USE_PTHREAD_THREADS
1639 with SCM_USE_PTHREAD_THREADS. Remove SCM_SIZEOF_LONG definition
1640 since we handle that in scmconfig.h now.
1641
1642 * gc.c: #include <config.h> if HAVE_CONFIG_H.
1643
1644 * gc-mark.c: #include <config.h> if HAVE_CONFIG_H. Rename usage
1645 of HAVE_ARRAYS to SCM_HAVE_ARRAYS. Replace usage of
1646 HAVE_LONG_LONGS with "SCM_SIZEOF_LONG_LONG != 0".
1647
1648 * gc-malloc.c: #include <config.h> if HAVE_CONFIG_H.
1649
1650 * gc-card.c: rename usage of HAVE_ARRAYS to SCM_HAVE_ARRAYS.
1651 Replace usage of HAVE_LONG_LONGS with "SCM_SIZEOF_LONG_LONG != 0".
1652
1653 * fports.c: #include <config.h> if HAVE_CONFIG_H.
1654
1655 * filesys.c: #include <config.h> if HAVE_CONFIG_H.
1656
1657 * feature.c: #include <config.h> if HAVE_CONFIG_H. Rename usage
1658 of USE_NULL_THREADS to SCM_USE_NULL_THREADS.
1659
1660 * extensions.c: #include <config.h> if HAVE_CONFIG_H.
1661
1662 * evalext.c: rename usage of HAVE_ARRAYS to SCM_HAVE_ARRAYS.
1663 Replace usage of HAVE_LONG_LONGS with "SCM_SIZEOF_LONG_LONG != 0".
1664
1665 * eval.c: #include <config.h> if HAVE_CONFIG_H. #include
1666 "libguile/__scm.h" rather than scmconfig.h. Rename usage of
1667 HAVE_ARRAYS to SCM_HAVE_ARRAYS. Replace usage of HAVE_LONG_LONGS
1668 with "SCM_SIZEOF_LONG_LONG != 0".
1669
1670 * error.c: #include <config.h> if HAVE_CONFIG_H.
1671
1672 * eq.c: #include <config.h> if HAVE_CONFIG_H. Rename usage of
1673 HAVE_ARRAYS to SCM_HAVE_ARRAYS. Replace usage of HAVE_LONG_LONGS
1674 with "SCM_SIZEOF_LONG_LONG != 0".
1675
1676 * deprecation.c: #include <config.h> if HAVE_CONFIG_H.
1677
1678 * coop.c: replace usage of struct timespect with scm_t_timespec.
1679 #include <config.h> if HAVE_CONFIG_H.
1680
1681 * coop-threads.c: #include "libguile/_scm.h" early. Replace
1682 usage of struct timespect with scm_t_timespec. Replace usage of
1683 STACK_GROWS_UP with SCM_STACK_GROWS_UP.
1684
1685 * coop-pthreads.c: #include "libguile/_scm.h" early. Replace
1686 usage of struct timespect with scm_t_timespec. Replace usage of
1687 STACK_GROWS_UP with SCM_STACK_GROWS_UP.
1688
1689 * coop-defs.h: move handling of time related headers to
1690 scmconfig.h. Add #include "libguile/__scm.h". Rename usage of
1691 HAVE_WINSOCK2_H to SCM_HAVE_WINSOCK2_H. Replace usage of struct
1692 timespect with scm_t_timespec.
1693
1694 * convert.i.c: rename usage of HAVE_ARRAYS to SCM_HAVE_ARRAYS.
1695
1696 * convert.h: rename usage of HAVE_ARRAYS to SCM_HAVE_ARRAYS.
1697
1698 * convert.c: #include <config.h> if HAVE_CONFIG_H. Rename usage
1699 of HAVE_ARRAYS to SCM_HAVE_ARRAYS.
1700
1701 * continuations.c: move libguile/_scm.h include to the top so we
1702 pick up any critical defines like _GNU_SOURCE early.
1703
1704 * backtrace.c: #include <config.h> if HAVE_CONFIG_H.
1705
1706 * async.c: #include <config.h> if HAVE_CONFIG_H.
1707
1708 * alloca.c: #include <config.h> if HAVE_CONFIG_H.
1709
1710 * _scm.h: #include <config.h> if HAVE_CONFIG_H.
1711 Rename usage of USE_PTHREAD_THREADS to SCM_USE_PTHREAD_THREADS.
1712
1713 * __scm.h: move libguile/scmconfig.h include up to the top, so
1714 we're sure to pick up any critical defines like _GNU_SOURCE early.
1715 #include <limits.h> removed in favor of scmconfig.h inclusion when
1716 appropriate. STDC_HEADERS based inclusion of stdlib.h,
1717 sys/types.h, stddef.h, and sys/stdtypes.h removed in favor of
1718 scmconfig.h inclusion when appropriate. Various Win32 related
1719 definitions removed in favor of scmconfig.h inclusion when
1720 appropriate.
1721 (HAVE_UINTPTR_T): definition removed (see NEWS).
1722 (SIZEOF_PTRDIFF_T): definition removed (see NEWS).
1723 (HAVE_LONG_LONGS): definition removed (see NEWS).
1724 (HAVE_LONG_LONG): definition removed (see NEWS).
1725 (HAVE_PTRDIFF_T): definition removed (see NEWS).
1726
1727 * Makefile.am: scmconfig.h is now generated by building and
1728 running gen-scmconfig.h and capturing its output. gen-scmconfig
1729 uses config.h and the configure.in generated gen-scmconfig.h to
1730 decide what to output. See gen-scmconfig.c for details.
1731 (noinst_PROGRAMS): add gen-scmconfig.
1732 (gen_scmconfig_SOURCES): new variable.
1733 (gen-scmconfig.$(OBJEXT)): new target - be careful to handle
1734 cross-compiling right.
1735 (scmconfig.h): build scmconfig.h from gen-scmconfig's output.
1736 (BUILT_SOURCES): add scmconfig.h.
1737
25e0bf97
MV
17382003-03-19 Marius Vollmer <mvo@zagadka.de>
1739
1740 * gc_os_dep.c: Added defines for sparc-unknown-netbsdelf1.5 from
1741 Adrian Bunk. Thanks!
1742
74b6d6e4
MD
17432003-03-19 Mikael Djurfeldt <djurfeldt@nada.kth.se>
1744
1745 * goops.c (make_class_from_template): New fourth arg:
1746 applicablep.
1747 (scm_class_extended_generic_with_setter, scm_class_self): Fixed
1748 cpls.
1749
1750 * smob.c (scm_set_smob_apply): Call scm_i_inherit_applicable.
1751
1752 * goops.c, objects.c, objects.h (scm_make_extended_class): New
1753 second arg: applicablep.
1754 (scm_i_inherit_applicable): New function.
1755
1756 * goops.c, goops.h (scm_class_applicable,
1757 scm_class_extended_accessor): New classes.
1758
5c9e7dad
DH
17592003-03-18 Dirk Herrmann <D.Herrmann@tu-bs.de>
1760
1761 * procs.c (scm_procedure_documentation): Removed redundant
1762 SCM_NIMP test and replaced other calls to SCM_IMP by more explicit
1763 predicates.
1764
f8af5c6d
MD
17652003-03-11 Mikael Djurfeldt <djurfeldt@nada.kth.se>
1766
c614a00b
MD
1767 * list.c, list.h (scm_filter, scm_filter_x): New functions.
1768
109c2c9f
MD
1769 * modules.c (scm_module_import_interface): New function.
1770
f8af5c6d
MD
1771 * goops.c, goops.h (scm_class_accessor_method): Renamed from
1772 scm_class_accessor.
1773 (scm_class_accessor): New class.
1774
a48d60b1
MD
17752003-03-06 Mikael Djurfeldt <djurfeldt@nada.kth.se>
1776
1777 * goops.c (scm_primitive_generic_generic): Enable primitive
1778 generic if not enabled.
1779 (scm_sys_goops_loaded): Setup unextended primitive generics.
1780
1781 * goops.c, goops.h (scm_c_extend_primitive_generic): New function.
1782
1783 * snarf.h (SCM_PRIMITIVE_GENERIC, SCM_PRIMITIVE_GENERIC_1): New
1784 snarf macros.
1785
1786 * numbers.c (scm_abs): Use SCM_PRIMITIVE_GENERIC. (This is only a
1787 testing example. All uses of SCM_GPROC should be converted.)
1788
1789 * procprop.c (scm_stand_in_scm_proc): Use scm_assq instead of
1790 scm_assoc.
1791
1792 * eq.c (scm_equal_p): Turned into a primitive generic.
1793
84edc049
RB
17942003-02-27 Rob Browning <rlb@defaultvalue.org>
1795
1796 * Makefile.am (scmconfig.h): new target -- generate file from
1797 ../config.h.
1798 (modinclude_HEADERS): remove version.h.
1799 (nodist_modinclude_HEADERS): add version.h.
1800
ea5c9285
MD
18012003-02-24 Mikael Djurfeldt <djurfeldt@nada.kth.se>
1802
b4a1358c
MD
1803 This fixes a serious GC bug, introduced during the latest
1804 reorganization of the GC, which disabled freeing of structs and
1805 GOOPS objects:
1806
1807 * struct.c (scm_struct_prehistory): Init scm_i_structs_to_free to
1808 SCM_EOL.
53af8255
MD
1809 (scm_struct_prehistory): Move scm_free_structs to
1810 scm_before_mark_c_hook.
ea5c9285 1811
b4a1358c
MD
1812 * gc-card.c (sweep_card): Check that we haven't swept structs on
1813 this card before. That can happen if scm_i_sweep_all_segments has
1814 been called from some other place than scm_igc.
1815
c35738c1
MD
18162003-02-19 Mikael Djurfeldt <djurfeldt@nada.kth.se>
1817
231a4ea8
MD
1818 * environments.c (DEFAULT_OBARRAY_SIZE): Changed from 137 to 31
1819 (since hash tables now adapt their size).
1820
1821 * modules.c (scm_modules_prehistory): Changed from 2001 to 1533
1822 (current number of prehistory bindings; hashtable code will select
1823 a prime which is greater than this value).
1824
1825 * symbols.c (scm_symbols_prehistory): Changed from 1009 to 2139
1826 (current number of initial symbols).
1827
1828 * properties.c (scm_init_properties): Don't specify size of
1829 scm_properties_whash.
1830
1831 * objprop.c (scm_init_objprop): Don't specify size of
1832 scm_object_whash.
1833
1834 * keywords.c (scm_init_keywords): Don't specify a hash table size.
1835
c35738c1
MD
1836 * hooks.c (scm_c_hook_add): Fixed bug in append mode.
1837
1838 The following changes introduce the use of resizable hash tables
1839 throughout Guile. It also renames the old *-hash-table* functions
1840 to *-alist-vector* and places them, together with the rest of the
1841 weak vector support, in the module (ice-9 weak-vector). We should
1842 probably introduce a new, better, API for weak references, for
1843 example "weak pairs" a la MIT-Scheme. (In Chez scheme, they even
1844 look like and are used like ordinary pairs.)
1845
1846 * environments.c (obarray_enter, obarray_retrieve, obarray_remove,
1847 leaf_environment_fold, obarray_remove_all): Use hashtable
1848 accessors.
1849
1850 * gc.c (scm_init_storage): Moved hook initialization to
1851 scm_storage_prehistory.
1852 (scm_storage_prehistory): New function.
1853 (scm_igc): Added commentary about placement of
1854 scm_after_sweep_c_hook.
1855
1856 * gc-mark.c (scm_mark_all): Use hashtable accessors.
1857 (scm_gc_mark_dependencies): Use SCM_WVECT_WEAK_KEY_P and
1858 SCM_WVECT_WEAK_VALUE_P.
1859
1860 * hashtab.c, hashtab.h (scm_hash_for_each, scm_hash_map): New
1861 functions.
1862 (scm_vector_to_hash_table, scm_c_make_resizing_hash_table):
1863 Removed.
1864 (scm_make_weak_key_hash_table, scm_make_weak_value_hash_table,
1865 scm_make_doubly_weak_hash_table): Moved here from weaks.c.
1866
1867 * init.c (scm_init_guile_1): Removed call to scm_init_weaks; Added
1868 calls to scm_storage_prehistory and scm_hashtab_prehistory.
1869
1870 * modules.c (module-reverse-lookup): Use hashtable accessors.
1871
1872 * symbols.c, symbols.h (scm_i_hash_symbol): New function.
1873
1874 * weaks.c, weaks.h (scm_make_weak_key_alist_vector,
1875 scm_make_weak_value_alist_vector,
1876 scm_make_doubly_weak_alist_vector): New functions.
1877
1878 * weaks.c (scm_init_weaks_builtins): New function.
1879
1880 * weaks.h (SCM_WVECTF_WEAK_KEY, SCM_WVECTF_WEAK_VALUE,
1881 SCM_WVECTF_NOSCAN, SCM_WVECT_WEAK_KEY_P, SCM_WVECT_WEAK_VALUE_P,
1882 SCM_WVECT_NOSCAN_P): New macros.
1883
1884 * weaks.c (scm_scan_weak_vectors): Use SCM_WVECT_WEAK_KEY_P
1885 and SCM_WVECT_WEAK_VALUE_P.
1886
1887 * weaks.c, weaks.h (scm_i_allocate_weak_vector): Renamed from
1888 allocate_weak_vector and exported.
1889
0a4c1355
MD
18902003-02-13 Mikael Djurfeldt <djurfeldt@nada.kth.se>
1891
1892 * hashtab.c: Undid thread safety. (We decided that it's better to
1893 let the user explicitly protect the tables (or not) according what
1894 is suitable for the application.)
1895
87ca11ff
MD
18962003-02-12 Mikael Djurfeldt <djurfeldt@nada.kth.se>
1897
1898 * hashtab.c (scm_hash_fn_remove_x, scm_internal_hash_fold): Made
1899 thread safe and handle resizing tables.
1900 (scm_ihashx, scm_sloppy_assx, scm_delx_x): Removed
1901 SCM_DEFER/ALLOW_INTS.
1902
f59a096e
MD
19032003-02-11 Mikael Djurfeldt <djurfeldt@nada.kth.se>
1904
1905 * hashtab.c (scm_vector_to_hash_table,
1906 scm_c_make_resizing_hash_table, scm_make_hash_table): New
1907 functions.
1908 (scm_hash_fn_get_handle, scm_hash_fn_create_handle_x): Made thread
1909 safe and handle resizing tables.
1910
1911 * weaks.c (scm_make_weak_key_hash_table,
1912 scm_make_weak_value_hash_table, scm_make_doubly_weak_hash_table):
1913 Size argument made optional. Return resizable table if not
1914 specified.
1915
4b612c5b
MD
19162003-02-10 Mikael Djurfeldt <djurfeldt@nada.kth.se>
1917
1918 * eval.c (scm_trampoline_0, scm_trampoline_1, scm_trampoline_2):
1919 Fixed formals tests for closures. (Thanks to Kevin Ryde.)
1920
b3d7f6df
MD
19212003-02-05 Mikael Djurfeldt <djurfeldt@nada.kth.se>
1922
1923 * debug.c (scm_procedure_source): Handle all objects for which
1924 procedure? is #t. (Thanks to Bill Schottstaedt.)
1925
756414cf
MD
19262003-01-23 Mikael Djurfeldt <djurfeldt@nada.kth.se>
1927
361d631f
MD
1928 * futures.c (mark_futures): Don't need to mark data of recycled
1929 futures.
1930 (scan_futures, cleanup_undead): Be smarter about marking
1931 futures---avoid unnecessary passes through future lists.
1932
756414cf
MD
1933 * futures.h, futures.c: New files; Introduced recycling of
1934 futures. For fine-grained threading this lifts performance to
1935 another level. We can now use parallelization in inner loops of
1936 Guile programs without impossible overhead.
1937
1938 * threads.h, threads.c: Moved futures to their own file.
1939
1940 * Makefile.am (libguile_la_SOURCES): Added futures.c.
1941 (DOT_X_FILES): Added futures.x.
1942 (DOT_DOC_FILES): Added futures.doc.
1943 (modinclude_HEADERS): Added futures.h.
1944
1945 * threads.c, threads.h (scm_i_create_thread): Renamed from
1946 create_thread and made global.
1947
1948 * futures.c (scm_make_future): New procedure.
1949
1950 * eval.c: #include "libguile/futures.h".
1951
1952 * init.c: #include "futures.h"
1953 (scm_init_guile_1): Call scm_init_futures.
1954
1955 * stime.c (SCM_TIME_UNITS_PER_SECOND): Renamed from CLKTCK.
1956
1957 * stime.h (SCM_TIME_UNITS_PER_SECOND): Definition moved here.
1958
1959 * eval.c, eval.h (scm_trampoline_0, scm_i_call_closure_0): New
1960 functions.
1961
1962 * eval.c (scm_trampoline_1): Fixed arguments test for closures.
1963
b4debead
MD
19642003-01-22 Mikael Djurfeldt <djurfeldt@nada.kth.se>
1965
1966 * threads.c (create_thread): Don't unwind dynwind chain of parent
1967 thread before creation. Just start the new thread with an empty
1968 dynwind chain.
1969
93f26b7b
MD
19702003-01-20 Mikael Djurfeldt <djurfeldt@nada.kth.se>
1971
1972 * evalext.c, evalext.h (scm_self_evaluating_p): New function.
1973
38d8927c
MD
19742003-01-10 Mikael Djurfeldt <djurfeldt@nada.kth.se>
1975
41c96c32
MD
1976 * threads.c (scm_timed_wait_condition_variable): Support timed
1977 waiting also for simple condition variables.
1978
38d8927c
MD
1979 * goops.c (TEST_CHANGE_CLASS): Use scm_change_object_class instead
1980 of calling the procedure change-object-class.
1981
9cf5d9b7
MD
19822003-01-09 Mikael Djurfeldt <djurfeldt@nada.kth.se>
1983
1984 * ramap.c (scm_ramapc): Typo in error message.
1985
bbf8d523
MD
19862003-01-08 Mikael Djurfeldt <djurfeldt@nada.kth.se>
1987
b46fae00
MD
1988 * goops.c (scm_sys_prep_layout_x): Bugfix: Only create layout for
1989 slots with instance allocation.
1990
bbf8d523
MD
1991 * goops.c, goops.h (scm_class_extended_generic_with_setter): New
1992 class.
1993 (scm_compute_applicable_methods): Use scm_generic_function_methods.
1994
1995 * goops.c (scm_generic_function_methods): Support extended
1996 generic functions.
1997
ebf9b47c
MD
19982002-12-29 Mikael Djurfeldt <djurfeldt@nada.kth.se>
1999
2000 * eval.c (unmemocopy): Bugfix: scm_sym_delay --> scm_sym_future.
2e37d6a2 2001 Thanks to Neil for pointing this out!
ebf9b47c 2002
14a9ba3f
NJ
20032002-12-29 Neil Jerram <neil@ossau.uklinux.net>
2004
2005 * lang.h: Remove declarations matching definitions removed from
2006 lang.c (just below).
2007
c6a040a8
NJ
20082002-12-28 Neil Jerram <neil@ossau.uklinux.net>
2009
6054d805
NJ
2010 * lang.c (scm_nil_cons, scm_nil_car, scm_nil_cdr, scm_null,
2011 scm_m_while, scm_nil_eq): Remove definitions that were superfluous
2012 and already commented out.
2013
c6a040a8
NJ
2014 * read.h (scm_lreadparen), read.c (scm_lreadr, scm_read_token,
2015 scm_lreadparen): Support reading vectors with Elisp syntax if
2016 SCM_ELISP_READ_EXTENSIONS is defined. (SCM_ELISP_READ_EXTENSIONS
2017 is not currently defined, and there isn't even a configure switch
2018 to enable it yet.)
2019
3742c12f
MV
20202002-12-26 Marius Vollmer <mvo@zagadka.ping.de>
2021
2022 * Makefile.am (c-tokenize.o): Refer to source via $< so that vpath
2023 builds work.
2024 (EXTRA_DIST): Added version.h.in.
2025
fb50ef08
MD
20262002-12-21 Mikael Djurfeldt <djurfeldt@nada.kth.se>
2027
2028 This change makes it possible for one thread to do lazy sweeping
2029 while other threads are running. Now only the mark phase need to
2030 have all threads asleep. We should look further into this issue.
2031 Presently, I've put the locking of scm_i_sweep_mutex at
2032 "conservative" places due to my current lack of knowledge about
2033 the garbage collector. Please feel free to restrict these regions
2034 further to allow for maximal parallelism!
2035
2036 * gc.c, gc.h (scm_i_sweep_mutex): New mutex.
2037
2038 * gc.c (scm_gc_for_newcell), gc-malloc.c (scm_realloc,
2039 scm_gc_register_collectable_memory): Substitute locking of
2040 scm_i_sweep_mutex for calls to scm_i_thread_put_to_sleep.
2041 (scm_igc): Lock sweep mutex here instead of in callers; Calls to
2042 scm_i_thread_put_to_sleep/scm_i_thread_wake_up used to demarkate
2043 the single-thread section (which now only contains the mark
2044 phase).
2045 (scm_gc): Don't lock sweeo mutex here since scm_igc locks it;
2046 Removed SCM_DEFER/ALLOW_INTS. Simply call scm_igc directly.
2047
2048 * threads.c (gc_section_mutex): Removed.
2049
9ed24633
MD
20502002-12-19 Mikael Djurfeldt <mdj@kvast.blakulla.net>
2051
0d48aca5
MD
2052 * threads.c (create_thread): Clear parent field in root state in
2053 order not to unnecessarily remember dead threads.
2054
9ed24633
MD
2055 * eval.c (call_subr2o_1, call_lsubr2_2): New functions.
2056 (scm_trampoline_1, scm_trampoline_2): Use them.
2057
29717c89
MD
20582002-12-18 Mikael Djurfeldt <mdj@kvast.blakulla.net>
2059
2060 Partial introduction of real plugin interface.
2061
2062 * Makefile.am (modinclude_HEADERS): Added threads-plugin.h.
2063 (EXTRA_DIST): Added threads-plugin.c.
2064
2065 * threads-plugin.h, threads-plugin.c: New files.
2066
2067 * threads.h: #include "libguile/threads-plugin.h".
2068
2069 * threads.c: #include "libguile/threads-plugin.c".
2070
2071 * pthread-threads.c: Temporarily remove debugging functions.
2072
2073 * threads.c, threads.h (scm_yield): Added back.
2074
e29e0b09
MD
20752002-12-18 Mikael Djurfeldt <mdj@kvast.blakulla.net>
2076
2077 * threads.c (really_launch): Detach before unlocking
2078 thread_admin_mutex in order not to risk being joined.
2079 (scm_i_thread_put_to_sleep, scm_i_thread_wake_up): Keep
2080 thread_admin_mutex locked during GC.
2081
2082 * pthread-threads.c, pthread-threads.h: Improvements to debugging
2083 functions.
2084
0b6843b1 20852002-12-16 Mikael Djurfeldt <mdj@kvast.blakulla.net>
93cd4dcd 2086
6da2dfc4
MD
2087 * pthread-threads.c, pthread-threads.h (SCM_DEBUG_THREADS): Added
2088 support for debugging mutex operations.
2089
1b92fb6b
MD
2090 * threads.c (scm_thread): Removed filed joining_threads.
2091 (thread_print): Print thread number as well as address of thread
2092 structure.
0b6843b1
MD
2093 (scm_join_thread): Bugfix.
2094 (scm_lock_mutex, scm_try_mutex, scm_unlock_mutex,
2095 scm_timed_wait_condition_variable, scm_signal_condition_variable,
2096 scm_broadcast_condition_variable): Use the low-level API.
2097 (scm_all_threads): Return copy of thread list (to prevent
2098 unintended destruction).
2099 (scm_threads_prehistory): Initialize heap_mutex of fake thread.
1b92fb6b 2100
93cd4dcd
MD
2101 * pthread-threads.c, pthread-threads.h, threads.c: Fixes to
2102 pthread "native" recursive mutex support.
2103
2ff4f181
MD
21042002-12-15 Mikael Djurfeldt <djurfeldt@nada.kth.se>
2105
28d52ebb
MD
2106 * __scm.h (SCM_DEFER_INTS, SCM_ALLOW_INTS): New definitions.
2107 Simply lock a thread C API recursive mutex.
2108 (SCM_NONREC_CRITICAL_SECTION_START,
2109 SCM_NONREC_CRITICAL_SECTION_END, SCM_REC_CRITICAL_SECTION_START,
2110 SCM_REC_CRITICAL_SECTION_END): Removed.
2111
2112 * eval.c: Replaced SOURCE_SECTION_START / SOURCE_SECTION_END with
2113 direct calls to scm_rec_mutex_lock / unlock around the three calls
2114 to scm_m_expand_body.
2115
2116 * eval.c, eval.h (promise_free): New function.
2117 (scm_force): Rewritten; Now thread-safe; Removed
2118 SCM_DEFER/ALLOW_INTS.
2119
2120 * pthread-threads.h: Added partially implemented plugin interface
2121 for recursive mutexes. These are, for now, only intended to be
2122 used internally within the Guile implementation.
2123
2124 * pthread-threads.c: New file.
2125
2126 * threads.c: Conditionally #include "pthread-threads.c".
2127
2128 * eval.c, eval.h (scm_makprom, scm_force): Rewritten to be
2129 thread-safe;
2130
2131 * snarf.h (SCM_MUTEX, SCM_GLOBAL_MUTEX, SCM_REC_MUTEX,
2132 SCM_GLOBAL_REC_MUTEX): New macros.
2133
2134 * eval.c, threads.c, threads.h, snarf.h: Rewrote critical section
2135 macros---use mutexes instead.
2136
2137 * tags.h (SCM_IM_FUTURE): New tag.
2138
2139 * eval.c (scm_m_future): New primitive macro.
2140 (SCM_CEVAL): Support futures.
2141 (unmemocopy): Support unmemoization of futures.
2142
2143 * print.c (scm_isymnames): Name of future isym.
2144
2ff4f181
MD
2145 * version.c: Unmade some changes to my private copy that got
2146 committed by mistake.
2147
392d2833
MD
21482002-12-11 Mikael Djurfeldt <mdj@kvast.blakulla.net>
2149
e200ddee
MD
2150 * gc-malloc.c, gc.h, init.c: Reverted gc-malloc change of
2151 2002-12-10.
2152
392d2833
MD
2153 * gc.c (scm_igc): Don't call scm_i_thread_invalidate_freelists.
2154
2155 * gc.c (scm_gc_sweep): Call it here instead, which is a more
2156 logical place.
2157
2158 * threads.c (create_thread): Remember root object until the handle
2159 of the new thread is on all_threads list.
2160
2161 * root.c (scm_make_root): Moved copying of fluids until after
2162 creation of root handle so that the fluids are GC protected. Also
2163 removed the critical section.
2164
c4c52ebe
MD
21652002-12-10 Mikael Djurfeldt <mdj@kvast.blakulla.net>
2166
960c408c
MD
2167 * gc-malloc.c, gc.h (scm_gc_malloc_prehistory): New function.
2168
3cdde9d6 2169 * gc-malloc.c (malloc_mutex): New mutex.
960c408c 2170 (scm_gc_malloc_prehistory): Initialize it.
3cdde9d6
MD
2171 (scm_realloc): Serialize call to realloc
2172 (scm_calloc): Same for calloc.
2173 Thanks to Wolfgang Jaehrling!
2174 (Now we have to make sure all calls to malloc/realloc are made
2175 through scm_malloc.)
2176
960c408c
MD
2177 * init.c (scm_init_guile_1): Call scm_gc_malloc_prehistory.
2178
c4c52ebe
MD
2179 * threads.c (really_launch): Release heap (to prevent deadlock).
2180 (create_thread): Release heap before locking thread admin mutex.
2181
b0dc3d71
MD
21822002-12-10 Mikael Djurfeldt <mdj@kvast.blakulla.net>
2183
2184 * threads.c (scm_i_thread_invalidate_freelists): New
2185 function.
2186
2187 * gc.c (scm_igc): Call scm_i_thread_invalidate_freelists.
2188
2189 * modules.c (scm_export): Inserted a return statement.
2190
06e80f59
HWN
21912002-12-10 Han-Wen Nienhuys <hanwen@cs.uu.nl>
2192
2193 * modules.c (scm_export): new function
2194
2195 * gc-card.c: add a note about malloc()/free() overhead.
2196
a12611c3
MD
21972002-12-10 Mikael Djurfeldt <mdj@kvast.blakulla.net>
2198
2199 * Makefile.am (c-tokenize.$(OBJEXT)): Don't look for c-tokenize.c
2200 in srcdir.
2201
c7fabadf
MD
22022002-12-10 Mikael Djurfeldt <djurfeldt@nada.kth.se>
2203
2204 These changes remove scm_ints_disabled (which hasn't has any
2205 effect in Guile for quite some time).
2206
2207 * async.c, error.h (scm_ints_disabled): Removed.
2208
2209 * gc.c (scm_gc_for_newcell), init.c (scm_init_guile_1),
2210 root.c (scm_internal_cwdr), gdbint.c (SCM_BEGIN_FOREIGN_BLOCK,
2211 SCM_END_FOREIGN_BLOCK): Don't touch scm_ints_disabled.
2212 (old_ints): Removed.
2213
2214 * __scm.h (SCM_DEFER_INTS, SCM_ALLOW_INTS): Define as a recursive
2215 critical section.
2216 (SCM_REDEFER_INTS, SCM_ALLOW_INTS): Define as SCM_DEFER_INTS and
2217 SCM_ALLOW_INTS.
2218
9bc4701c
MD
22192002-12-09 Mikael Djurfeldt <djurfeldt@nada.kth.se>
2220
52340b65
MD
2221 * threads.c (scm_mutex_lock, scm_cond_wait, scm_cond_timedwait):
2222 Removed accidental #if 0 around these functions.
2223
9bc4701c
MD
2224 These changes are the start of support for preemptive
2225 multithreading. Marius and I have agreed that I commit this code
2226 into the repository although it isn't thoroughly tested and surely
2227 introduces many bugs. The bugs should only be exposed when using
2228 threads, though. Signalling and error handling for threads is
2229 very likely broken. Work on making the implementation cleaner and
2230 more efficient is needed.
2231
2232 * __scm.h (SCM_ALLOW_INTS_ONLY): Removed.
2233 (SCM_NONREC_CRITICAL_SECTION_START,
2234 SCM_NONREC_CRITICAL_SECTION_END, SCM_REC_CRITICAL_SECTION_START,
2235 SCM_REC_CRITICAL_SECTION_END): New macros.
2236 (SCM_CRITICAL_SECTION_START/END): Defined here.
2237
2238 * eval.c: Insert SOURCE_SECTION_START / SOURCE_SECTION_END around
2239 the three calls to scm_m_expand_body.
2240
2241 * gc.h: #include "libguile/pthread-threads.h";
2242 (SCM_FREELIST_CREATE, SCM_FREELIST_LOC): New macros.
2243
2244 * gc.c (scm_i_freelist, scm_i_freelist2): Defined to be of type
2245 scm_t_key;
2246
2247 * gc.c, gc-freelist.c, inline.h: Use SCM_FREELIST_LOC for freelist
2248 access.
2249
2250 * gc-freelist.c (scm_gc_init_freelist): Create freelist keys.
2251
2252 * gc-freelist.c, threads.c (really_launch): Use
2253 SCM_FREELIST_CREATE.
2254
2255 * gc-malloc.c (scm_realloc, scm_gc_register_collectable_memory):
2256
2257 * gc.c (scm_i_expensive_validation_check, scm_gc,
2258 scm_gc_for_newcell): Put threads to sleep before doing GC-related
2259 heap administration so that those pieces of code are executed
2260 single-threaded. We might consider rewriting these code sections
2261 in terms of a "call_gc_code_singly_threaded" construct instead of
2262 calling the pair of scm_i_thread_put_to_sleep () and
2263 scm_i_thread_wake_up (). Also, we would want to have as many of
2264 these sections eleminated.
2265
2266 * init.c (scm_init_guile_1): Call scm_threads_prehistory.
2267
2268 * inline.h: #include "libguile/threads.h"
2269
2270 * pthread-threads.h: Macros now conform more closely to the
2271 pthreads interface. Some of them now take a second argument.
2272
2273 * threads.c, threads.h: Many changes.
2274
22752002-12-09 Mikael Djurfeldt <djurfeldt@nada.kth.se>
2276
2277 * Makefile.am (version.h): Changed $^ --> $< in rule for
2278 version.h.
2279
b2cbe8d8
RB
22802002-12-08 Rob Browning <rlb@defaultvalue.org>
2281
2282 * version.h.in (SCM_MICRO_VERSION): use @--@ substitution now.
2283 (SCM_MINOR_VERSION): use @--@ substitution now.
2284 (SCM_MICRO_VERSION): use @--@ substitution now.
2285 (scm_effective_version): new function prototype.
2286
2287 * version.c (scm_effective_version): new function, also add
2288 effective-version.
2289
2290 * Makefile.am (schemelibdir): VERSION -> GUILE_EFFECTIVE_VERSION.
2291 (libpath.h): use GUILE_EFFECTIVE_VERSION to compute
2292 SCM_LIBRARY_DIR.
2293 (version.h): generate this here rather than configure.in. This
2294 approach tracks source edits better (i.e. more immediately).
2295 Might be worth considering for other .in files too.
2296
5441c65c
MV
22972002-12-02 Marius Vollmer <mvo@zagadka.ping.de>
2298
2299 Reorganized thread package selection. A thread package now only
2300 implements a small set of pthread like functions and Guile
2301 implements the rest on top of that. Guile's implementation is
2302 what the "coop-pthreads" package has been previously. Support for
2303 "coop" threads has been removed until I get time to add it again.
2304
2305 * Makefile.am (libguile_la_SOURCES): Removed iselect.c.
2306 (noinst_HEADERS): Removed coop-threads.c, coop-threads.h, coop.c,
2307 null-threads.c, coop-pthreads.c.
2308 (modinclude_HEADERS): Removed coop-defs.h, coop-pthreads.h. Added
2309 pthread-threads.h.
2310
2311 * validate.h (SCM_VALIDATE_THREAD): Moved to threads.h.
2312
2313 * threads.h: Do not include "libguile/coop-defs.h". Include
2314 "libguile/pthread-threads.h" for USE_COPT_THREADS. Removed
2315 (previously deprecated) C level thread API prototypes. They are
2316 now in the thread package specific headers, "null-threads.h" and
2317 "pthread-threads.h".
2318 (SCM_VALIDATE_THREAD, SCM_VALIDATE_MUTEX, SCM_VALIDATE_CONDVAR):
2319 New.
2320 (scm_threads_init): Removed.
2321 (SCM_CRITICAL_SECTION_START, SCM_CRITICAL_SECTION_END,
2322 SCM_THREAD_SWITCHING_CODE, scm_i_switch_counter,
2323 SCM_I_THREAD_SWITCH_COUNT): Define here.
2324 (scm_single_thread_p): Removed.
2325 (scm_call_with_new_thread): Take two args directly instead of list
2326 of two args.
2327 (scm_i_thread_data, scm_i_set_thread_data, SCM_THREAD_LOCAL_DATA,
2328 SCM_SET_THREAD_LOCAL_DATA): Define here.
2329
2330 * threads.c: Merged with "coop-pthreads.c".
2331
2332 * null-threads.h: Implement pthread-like API as a set of macros.
2333
2334 * pthread-threads.h: New, implement pthread-like API by deferring
2335 to pthread itself.
2336
2337 * init.c (scm_init_guile_1): Do not call scm_init_iselect, which
2338 has been lost in the reorganization.
2339
504d99c5
MD
23402002-12-01 Mikael Djurfeldt <mdj@linnaeus>
2341
2342 The following change makes it possible to move procedure
2343 application dispatch outside inner loops. The motivation was
2344 clean implementation of efficient replacements of R5RS primitives
2345 in SRFI-1.
2346
2347 The semantics is clear: scm_trampoline_N returns an optimized
2348 version of scm_call_N (or NULL if the procedure isn't applicable
2349 on N args).
2350
2351 Applying the optimization to map and for-each increases efficiency
2352 noticeably. For example, (map abs ls) is 8 times faster than
2353 before.
2354
2355 * eval.h (scm_t_trampoline_1, scm_t_trampoline_2): New types.
2356
2357 * eval.c, eval.h (scm_trampoline_1, scm_trampoline_2): New functions.
2358
2359 * eval.c (call_subr2_2, call_lsubr_2, call_closure_2): New functions;
2360 (map, for-each): Handle also application on two args as a special
2361 case; Use trampolines.
2362
2363 Other changes:
2364
2365 * sort.c (scm_cmp_function): Choose subr2less for scm_tc7_subr_2o;
2366 (subr2oless): Removed.
2367 (scm_restricted_vector_sort_x): Use scm_return_first to keep the
2368 vector GC protected.
2369
2370 * eval.c (check_map_args): Use scm_out_of_range_pos instead of
2371 scm_out_of_range.
2372
63dd3413
DH
23732002-11-24 Dirk Herrmann <D.Herrmann@tu-bs.de>
2374
2375 * evalext.[ch] (scm_m_undefine, undefine): Deprecated.
2376
4ba5f279
MD
23772002-11-17 Mikael Djurfeldt <mdj@linnaeus>
2378
2379 * debug.c (scm_make_iloc): Added missing "return".
2380
56ae231f
MV
23812002-11-17 Marius Vollmer <mvo@zagadka.ping.de>
2382
2383 * strports.c (scm_eval_string_in_module): Validate second arg to
2384 be a module. Thanks to Arno Peters!
2385
80b28865
DH
23862002-11-16 Dirk Herrmann <D.Herrmann@tu-bs.de>
2387
2388 * .cvsignore: remove goops.c
2389
c88b1456
DH
23902002-11-16 Dirk Herrmann <D.Herrmann@tu-bs.de>
2391
2392 * modules.c (scm_env_top_level, scm_lookup_closure_module,
2393 module_variable, scm_module_lookup_closure,
2394 scm_module_transformer, scm_sym2var, scm_module_reverse_lookup,
2395 scm_system_module_env_p): Don't compare SCM values with C
2396 operators == or !=. Avoid SCM_IMP predicates. Prefer !SCM_FALSEP
2397 over SCM_NFALSEP.
2398
a8a19efc
DH
23992002-11-16 Dirk Herrmann <D.Herrmann@tu-bs.de>
2400
2401 * eval.h (SCM_MAKE_ILOC): New macro.
2402
2403 * debug.c (scm_make_iloc): Use SCM_MAKE_ILOC instead of computing
2404 the iloc bitpattern here.
2405
76734914
MD
24062002-11-14 Mikael Djurfeldt <mdj@linnaeus>
2407
2408 * coop-pthreads.c, coop-pthreads.h: scm_internal_select should be
2409 part of the API, otherwise it's difficult to write Guile
2410 extensions using non-blocking I/O => moved #include
2411 "libguile/iselect.h" from coop-pthreads.c --> coop-pthreads.h.
2412
2413 * coop-pthreads.c (scm_unlock_mutex): Changed s_lock_mutex -->
2414 s_unlock_mutex.
2415
8b5b4a75
MV
24162002-11-10 Marius Vollmer <mvo@zagadka.ping.de>
2417
2418 * __scm.h (USE_THREADS, GUILE_ISELECT): Do not define here. They
2419 are defined in configure.in.
2420
2421 * threads.c: Removed SCM_API from function definitions. SCM_API
2422 is only for declarations.
2423
e5a83084
MD
24242002-11-07 Mikael Djurfeldt <mdj@linnaeus>
2425
9be8bb45
MD
2426 * coop-pthreads.h: Added support for thread specific data to the
2427 generic C API for the coop-pthreads case.
2428
e5a83084
MD
2429 * threads.c, threads.h (scm_cond_init): Undo unintentional API
2430 change.
6c214b62 2431 (scm_cond_broadcast): Added missing function.
e5a83084 2432
7edf178e
MV
24332002-11-04 Marius Vollmer <marius.vollmer@uni-dortmund.de>
2434
2435 * coop.c (coop_next_runnable_thread): Removed, wich should have
2436 happened when GUILE_ISELECT was hard-wired.
2437
7f5b1b77
MV
24382002-11-03 Marius Vollmer <mvo@zagadka.ping.de>
2439
7caa1b07
MV
2440 * Makefile.am (libguile_la_SOURCES): Added threads.c
2441 (DOT_DOC_FILES): Added threads.doc.
2442 (DOT_X_FILES): Added threads.x.
2443 (EXTRA_libguile_la_SOURCES): Removed threads.c.
2444 (noinst_HEADERS): Added coop-pthreads.c.
2445 (modinclude_HEADERS): Added coop-pthreads.h.
2446
2447 * __scm.h (USE_THREADS, GUILE_ISELECT): Define when
2448 SCM_DEBUG_DEPRECATED. Removed their use thru-out Guile.
2449
bb11cbf4
MV
2450 * iselect.c: Include "_scm.h" before testing HAVE_UNISTD_H.
2451 Thanks to Bill Schottstaedt!
2452
1d4cbbed
MV
2453 * numbers.c (scm_integer_expt): Make 0^z == 0 for z != 0.
2454
7f5b1b77
MV
2455 * _scm.h (HAVE_RESTARTABLE_SYSCALLS): Do define even when
2456 SCM_COPT_THREADS is defined.
2457 (SCM_SYSCALL): Use EINTR-expection version when SCM_COPT_THREADS
2458 is defined.
2459
2460 * coop-pthreads.c: Some harmless renamings of internal stuff.
2461 (create_thread): New, generalized version of
2462 scm_call_with_new_thread.
2463 (scm_call_with_new_thread): Use it.
2464 (scm_spawn_thread): New, use create_thread.
2465
d52f53b1
MV
24662002-11-02 Marius Vollmer <mvo@zagadka.ping.de>
2467
2468 * coop-pthreads.c, coop-pthreads.h: Redone completely, you might
2469 start testing it now.
2470
2471 * _scm.h: Include <errno.h< so that SCM_SYSCALL is correctly
2472 defined when HAVE_RESTARTABLE_SYSCALLS is not defined.
2473 (HAVE_RESTARTABLE_SYSCALLS): Do not define when USE_COPT_THREADS
2474 is defined.
2475
30f920c3
MV
24762002-10-27 Marius Vollmer <mvo@zagadka.ping.de>
2477
2478 * scmsigs.c (signal_cell_handlers, install_handler_data,
2479 scm_delq_spine_x, really_install_handler, install_handler): New
2480 scheme for triggering signal handlers, to simplify take_signal.
2481 (take_signal): Simplified, to avoid race conditions.
2482 (scm_sigaction_for_thread): Use new Scheme. Validate that thread
2483 hasn't exited yet.
2484
2485 * async.c (scm_async_click): Reset pending_asyncs, handle
2486 signal_asyncs. Don't set cdr of a non-signal async to #f.
2487 (scm_i_queue_async_cell): Do not check cdr of cell for #f, queue
2488 always. Set pending_asyncs.
2489 (scm_system_async_mark_for_thread): Check that thread has not
2490 exited.
2491 (scm_unmask_signals, decrease_block): Call scm_async_click after
2492 block_asyncs becomes zero.
2493
2494 * __scm.h (SCM_ASYNC_CLICK): Check pending_asyncs instead of
2495 active_asyncs.
2496
2497 * root.h (scm_root_state): Added pending_asyncs and signal_asyncs
2498 fields.
2499 * root.c (root_mark): Mark them.
2500 (make_root): Initialize them.
2501
2502 * iselect.c, iselect.h: Replaced GUILE_ISELECT with
2503 USE_COOP_THREADS.
2504 (scm_internal_select): Define one version for USE_COOP_THREADS and
2505 one for USE_NULL_THREADS.
2506 (scm_init_iselect): Likewise.
2507
2508 * inline.h (scm_cell, scm_double_cell): Also allow
2509 USE_COPT_THREADS to not protect the slot initializers.
2510
2511 * init.c (scm_init_guile_1): Call scm_init_thread_procs. This is
2512 because threads need to be initialized before the stack, but
2513 gsubrs such as scm_timed_condition_variable_wait can only be
2514 created later.
2515
2516 * threads.h: Include "coop-pthreads.h" when requested.
2517 (scm_threads_make_mutex, scm_threads_lock_mutex,
2518 scm_threads_unlock_mutex, scm_threads_monitor): Removed, they were
2519 not implemented anyway.
2520 (scm_init_thread_procs, scm_try_mutex,
2521 scm_timed_condition_variable_wait,
2522 scm_broadcast_condition_variable, scm_c_thread_exited_p,
2523 scm_thread_exited_p): New prototypes.
2524 (struct timespec): Define if not already defined.
2525 (scm_t_mutex, scm_mutex_init, scm_mutex_lock, scm_mutex_trylock,
2526 scm_mutex_unlock, scm_mutex_destroy, scm_t_cond, scm_cond_init,
2527 scm_cond_wait, scm_cond_timedwait, scm_cond_signal,
2528 scm_cond_broadcast, scm_cond_destroy): Declarations moved here and
2529 deprecated.
2530
2531 * threads.c: Include <errno.h>. Include "coop-pthreads.c" when
2532 requested.
2533 (scm_thread_exited_p): New.
2534 (scm_try_mutex, scm_broadcast_condition_variable): Newly
2535 registered procedures.
2536 (scm_wait_condition_variable, scm_timed_wait_condition_variable):
2537 Use the latter as the procedure for "wait-condition-variable",
2538 thus offering a optional timeout parameter to Scheme.
2539 (scm_wait_condition_variable): Implement in terms of
2540 scm_timed_wait_condition_variable.
2541 (scm_mutex_init, scm_mutex_lock, scm_mutex_trylock,
2542 scm_mutex_unlock, scm_mutex_destroy, scm_cond_init,
2543 scm_cond_wait, scm_cond_timedwait, scm_cond_signal,
2544 scm_cond_broadcast, scm_cond_destroy): Implement in terms of
2545 scm_make_mutex, etc, and deprecate.
2546 (scm_init_threads): Do not create smobs, leave this to
2547 scm_threads_init. Do not include "threads.x" file.
2548 (scm_init_thread_procs): New, include "threads.x" here.
2549
2550 * null-threads.h (scm_null_mutex, scm_null_mutex_init,
2551 scm_null_mutex_lock, scm_null_mutex_unlock,
2552 scm_null_mutex_destroy, scm_null_condvar, scm_null_condvar_init,
2553 scm_null_condvar_wait, scm_null_condvar_signal,
2554 scm_null_condvar_destroy): Removed.
2555 (scm_mutex_init, scm_mutex_lock, scm_mutex_unlock, scm_cond_init,
2556 scm_cond_wait, scm_cond_signal, scm_cond_broadcast,
2557 scm_cond_destory): Do not define, they are now deprecated and
2558 handled by threads.{h,c}.
2559
2560 * null-threads.c (scm_null_mutex, scm_null_cond): Define here.
2561 (scm_threads_init): Create smobs here, using the appropriate
2562 sizes.
2563 (block): Removed, now unused.
2564 (scm_c_thread_exited_p): New.
2565 (scm_null_mutex_init, scm_null_mutex_lock, scm_null_mutex_unlock,
2566 scm_null_mutex_destroy, scm_null_condvar_init,
2567 scm_null_condvar_wait, scm_null_condvar_signal,
2568 scm_null_condvar_destroy): Removed and updated users to do their
2569 task directly.
2570 (scm_try_mutex, timeval_subtract,
2571 scm_timed_wait_condition_variable,
2572 scm_broadcast_condition_variable): New.
2573 (scm_wait_condition_variable): Removed.
2574
2575 * coop-defs.h (coop_m): Added 'level' field.
2576 (scm_t_mutex, scm_mutex_init, scm_mutex_lock, scm_mutex_trylock,
2577 scm_mutex_unlock, scm_mutex_destroy, scm_t_cond, scm_cond_init,
2578 scm_cond_wait, scm_cond_timedwait, scm_cond_signal,
2579 scm_cond_broadcast, scm_cond_destroy, struct timespec): Do not
2580 define.
2581 (coop_condition_variable_broadcast): New.
2582
2583 * coop-threads.c (scm_threads_init): Create smobs here, using the
2584 appropriate sizes.
2585 (scm_c_thread_exited_p, scm_try_mutex,
2586 scm_timed_wait_condition_variable,
2587 scm_broadcast_condition_variable): New.
2588 (scm_wait_condition_variable): Removed.
2589
2590 * coop.c (coop_new_mutex_init): Initialize level.
2591 (coop_mutex_trylock, coop_mutex_lock, coop_mutex_unlock): maintain
2592 level.
2593 (coop_condition_variable_signal): Renamed to
2594 coop_condition_variable_broadcast and reimplemented in terms of
2595 that. Thus...
2596 (coop_condition_variable_broadcast): New.
2597
2598 * goops.c (hell_mutex): Reimplemented using scm_make_mutex, etc.
2599
2600 * coop-pthreads.h, coop-pthreads.c: New, but unfinished.
2601
087ed40d
MV
26022002-10-21 Marius Vollmer <mvo@zagadka.ping.de>
2603
65a23095
MV
2604 * null-threads.c: Include <time.h>. Also, use <...> for inclusion
2605 of system headers.
2606
087ed40d
MV
2607 * async.c, goops.h, modules.h, validate.h (SCM_MAKE_VALIDATE_MSG):
2608 New. Use it instead of SCM_MAKE_VALIDATE in lots of places to
30f920c3 2609 give better error messages. Thanks to Bill Schottstaedt!
087ed40d 2610
5ec1d2c8
DH
26112002-10-19 Dirk Herrmann <D.Herrmann@tu-bs.de>
2612
2613 * evalext.h, evalext.c (scm_definedp, scm_defined_p): Renamed
2614 scm_definedp to scm_defined_p and deprecated scm_definedp.
2615
100ae50d
DH
26162002-10-19 Dirk Herrmann <D.Herrmann@tu-bs.de>
2617
2618 * async.h, async.c (scm_system_async): Fixed deprecation to work
2619 correctly when deprecated features are excluded.
2620
2794cb50
MV
26212002-10-16 Marius Vollmer <marius.vollmer@uni-dortmund.de>
2622
2623 * async.c (scm_system_async_mark_for_thread): Validate thread
2624 argument.
2625
2626 * coop-threads.c (scm_i_thread_root): Do not validate argument.
2627
2628 * feature.c (scm_init_feature): Don't add 'threads' for
2629 USE_NULL_THREADS.
2630
2631 * inline.h (scm_cell, scm_double_cell): Also allow
2632 USE_NULL_THREADS to not protect the slot initializers.
2633
2634 * scmsigs.c (scm_sigaction_for_thread): It's "USE_THREADS" not
2635 "USE_THREAD".
2636
2637 * Makefile.am (noinst_HEADERS): Added null-threads.c.
2638 (modinclude_HEADERS): Added null-threads.h.
2639
2640 * threads.h: Include null-threads.h when !USE_COOP_THREADS.
2641 * threads.c: Include null-threads.c when !USE_COOP_THREADS.
2642 (scm_init_threads): Use generic type names scm_t_mutex and
2643 scm_t_cond instead of coop_m and coop_c.
2644
2645 * null-threads.c, null-threads.h: New files.
2646
ff810d7a
MV
26472002-10-15 Marius Vollmer <mvo@zagadka.ping.de>
2648
2649 * Makefile.am: Replaced "$<" in non-pattern rules with its value.
2650 This is to support makes that know about "$<" only in pattern
2651 rules, like Sun's make.
2652
a90bdb73
MV
26532002-10-13 Marius Vollmer <mvo@zagadka.ping.de>
2654
2655 * Makefile.am (libpath.h): Fixed typo in top_srcdir_absolute
2656 substitution. Thanks to David Allouche!
2657
e71a8bf2
DH
26582002-10-13 Dirk Herrmann <D.Herrmann@tu-bs.de>
2659
2660 * evalext.h: Replaced SCM_DEBUG_DEPRECATED with
2661 !SCM_ENABLE_DEPRECATED.
2662
41f77ff5
MV
26632002-10-11 Marius Vollmer <marius.vollmer@uni-dortmund.de>
2664
504d99c5 2665 * async.c (scm_system_async_mark_for_thread): Only call
41f77ff5
MV
2666 scm_i_thread_root when USE_THREADS is defined. Use scm_root
2667 otherwise.
2668
2669 * scmsigs.c (take_signal): Only call scm_i_thread_root when
2670 USE_THREADS is defined. Use scm_root otherwise.
2671 (scm_sigaction_for_thread): Ignore THREAD argument when
2672 USE_THREADS is not defined. Also, move THREAD argument defaulting
2673 out of HAVE_SIGACTION section, which was a bug.
2674
6d16b125
MV
26752002-10-10 Marius Vollmer <marius.vollmer@uni-dortmund.de>
2676
2677 * scmsigs.c (scm_sigaction_for_thread): Store original handler in
2678 signal_handlers, not the closure that is used as the async.
2679 The closure is stored in signal_handler_cells, as previously.
2680
acfa1f52
MV
26812002-10-10 Marius Vollmer <mvo@zagadka.ping.de>
2682
2683 * root.h (scm_root_state): Added 'block_async' slot.
2684 (scm_active_asyncs): Removed abbrev.
2685 * root.c (scm_make_root): Initialize 'block_asyncs' slot.
2686
2687 * __scm.h (SCM_ASYNC_TICK): Do without the scm_active_asyncs
2688 abbrev.
2689
2690 * async.h (scm_call_with_blocked_asyncs,
2691 scm_call_with_unblocked_asyncs, scm_c_call_with_blocked_asyncs,
2692 scm_c_call_with_unblocked_asyncs): New prototypes.
2693 (scm_mask_signals, scm_unmask_signals): Deprecated.
2694 (scm_mask_ints): Turned into a macro.
2695 * async.c (scm_mask_ints): Removed.
2696 (scm_run_asyncs): Do not set scm_mask_ints while running an async.
2697 this should not be necessary.
2698 (scm_async_click): Test block_asyncs instead of scm_mask_ints.
2699 (scm_mask_signals, scm_unmask_signals): Deprecated. Emit
2700 deprecation warning and check for errornous use. Set block_asyncs
2701 instead of scm_mask_ints.
2702 (increase_block, decrease_block, scm_call_with_blocked_asyncs,
2703 scm_call_with_unblocked_asyncs, scm_c_call_with_blocked_asyncs,
2704 scm_c_call_with_unblocked_asyncs): New.
2705
2706 * script.c (scm_compile_shell_switches): Do not set scm_mask_ints.
2707 Asyncs are enabled by default.
2708
34010f56
NJ
27092002-10-09 Neil Jerram <neil@ossau.uklinux.net>
2710
2711 * vports.c (scm_make_soft_port): Allow vector argument to carry a
2712 6th element: an input waiting thunk.
2713 (sf_input_waiting): New.
2714
9310d6f2
MV
27152002-10-05 Marius Vollmer <mvo@zagadka.ping.de>
2716
2717 * root.c (root_mark): Mark active_asyncs slot.
2718
2719 * async.c (scm_async_click): Set the cdr of a executed handler
2720 cell to SCM_BOOL_F, not SCM_EOL.
2721 (scm_i_queue_async_cell): Queue the cell at the end of the list,
2722 and only if the handler procedure is not already present.
2723 (scm_system_async_mark_for_thread): Initialize cdr of handler cell
2724 with SCM_BOOL_F.
2725 * scmsigs.c (scm_sigaction_for_thread): Likewise.
2726
ac48c719
RB
27272002-10-04 Rob Browning <rlb@defaultvalue.org>
2728
1360a142
RB
2729 * guile.c (main): switch to scm_lt_dlset_preloaded_symbols;
2730
2731 * dynl.c (sysdep_dynl_link): switch to scm_lt_dlhandle,
2732 scm_lt_dlopenext, and scm_lt_dlerror.
2733 (sysdep_dynl_unlink): switch to scm_lt_dlhandle, scm_lt_dlclose,
2734 and scm_lt_dlerror.
2735 (sysdep_dynl_func): switch to scm_lt_dlhandle, scm_lt_dlsym,
2736 and scm_lt_dlerror.
2737 (sysdep_dynl_init): switch to scm_lt_dlinit();
2738
2739 * Makefile.am (libguile_la_LIBADD): switch to use
2740 libguile-ltdl.la.
2741
504d99c5 2742 * numbers.c (scm_integer_expt): (expt 0 1) should be 1.
ac48c719 2743
497092c9
MV
27442002-10-04 Marius Vollmer <mvo@zagadka.ping.de>
2745
2746 * scmsigs.h (scm_sigaction_for_thread): New prototype.
2747 * scmsigs.c (got_signal): Removed.
2748 (signal_handler_cells, signal_handler_threads): New.
2749 (take_signal): Queue the cell of the signal for the specified
2750 thread. Reset the signal handler on systems that don't have
2751 sigaction.
2752 (sys_deliver_signals): Removed.
2753 (close_1): New.
2754 (scm_sigaction_for_thread): Renamed from scm_sigaction and
2755 extended to also set the thread of a signal and allocate a cell
2756 for it. Keep the Scheme name "sigaction". Check that signum is
2757 within range. Also, use SCM_VECTOR_REF instead of SCM_VELTS.
2758 (scm_sigaction): Implement in terms of scm_sigaction_for_thread.
2759 (scm_init_scmsigs): Allocate signal_handler_cells and
2760 signal_handler_threads vectors.
2761
2762 * async.c: Removed GUILE_OLD_ASYNC_CLICK code. Reorganized so
2763 that system asnycs and user asyncs are separated. Reimplemented
2764 system asyncs to work per-thread.
2765
2766 * gc.c (scm_init_gc): Do not use scm_system_async.
2767
2768 * async.h (scm_asyncs_pending, scm_set_tick_rate,
2769 scm_set_switch_rate, scm_system_async_mark_from_signal_handler):
2770 Removed prototypes.
2771 (scm_i_queue_async_cell): New.
2772
2773 * __scm.h (scm_asyncs_pending_p): Removed.
2774 (SCM_ASYNC_CLICK): Check scm_active_asyncs instead of
2775 scm_asyncs_pending_p.
2776
2777 * async.h (scm_system_async_mark_for_thread): New prototype.
2778
2779 * __scm.h: Removed GUILE_OLD_ASYNC_CLICK code.
2780
2781 * root.h (scm_root_state): Added new "active_asyncs" slot.
2782 * root.c (scm_make_root): Initialize it to SCM_EOL.
2783
2784 * coop-defs.h (coop_t): Added new "handle" slot.
2785 * coop-threads.c (all_threads, scm_current_thread,
2786 scm_all_threads, scm_i_thread_root): New.
2787 (scm_threads_init): Add main thread to all_threads.
2788 (scheme_launch_thread): Remove thread from all_threads when it
2789 terminates.
2790 (scm_call_with_new_thread): Initialize handle slot of coop_t
2791 structure and add new thread to all_threads.
2792 (scm_spawn_thread): Likewise.
2793
2794 * threads.h (scm_current_thread, scm_all_threads): New prototypes.
2795 * threads.c (scm_current_thread, scm_all_threads): Register as
2796 primitives.
2797
2798 * dynl.c: Use scm_lt_ prefix for libltdl functions.
2799
480fa28d
NJ
28002002-09-29 Neil Jerram <neil@ossau.uklinux.net>
2801
2802 * script.c (scm_compile_shell_switches): Fix bad spelling of
2803 `explicitly' in comment.
2804
28052002-09-28 Neil Jerram <neil@ossau.uklinux.net>
2806
2807 * posix.c (scm_geteuid, scm_getegid, scm_seteuid, scm_setegid):
2808 Refer to provided? in doc string rather than deprecated feature?.
2809
3553e1d1
GH
28102002-09-24 Gary Houston <ghouston@arglist.com>
2811
2812 * inline.h (scm_double_cell): prevent reordering of statements
2813 with any following code (for GCC 3 strict-aliasing).
2814 * numbers.c (scm_make_real), num2float.i.c (FLOAT2NUM): removed
2815 the earlier version of the reordering prevention.
2816
4ad0814a
HWN
28172002-09-19 Han-Wen Nienhuys <hanwen@cs.uu.nl>
2818
2819 * inline.h (scm_double_cell): move SET_GCMARK set out of if body.
2820
e88e4f2e
HWN
28212002-09-09 Han-Wen Nienhuys <hanwen@cs.uu.nl>
2822
2823 * gc-malloc.c (scm_gc_register_collectable_memory): more overflow
2824 protection.
2825
1e71eafb
HWN
28262002-09-08 Han-Wen Nienhuys <hanwen@cs.uu.nl>
2827
2828 * inline.h: include stdio.h
2829
2830 * smob.c (free_print): abort if scm_debug_cell_accesses_p is set
2831
61ef9c1f
HWN
28322002-09-05 Han-Wen Nienhuys <hanwen@cs.uu.nl>
2833
dac04e9f
HWN
2834 * gc-segment.c (scm_i_make_initial_segment): check user settings
2835 for sanity.
2836
2837 * gc-malloc.c (scm_gc_init_malloc): check user settings for
2838 sanity.
dac04e9f
HWN
2839
2840 * gc-freelist.c (scm_init_freelist): check user settings for sanity.
2841
ffd72400
HWN
2842 * struct.h: change scm_structs_to_free to scm_i_structs_to_free
2843
2844 * gc-malloc.c (scm_gc_register_collectable_memory): use floats;
1e71eafb
HWN
2845 these won't ever wrap around with high memory usage. Thanks to
2846 Sven Hartrumpf for finding this.
ffd72400 2847
5bd4a949
HWN
2848 * gc-freelist.c: include <stdio.h>
2849
61ef9c1f
HWN
2850 * gc-malloc.c: add DEBUGINFO for mtrigger GCs.
2851
ffd0ef3b
MV
28522002-09-01 Marius Vollmer <mvo@zagadka.ping.de>
2853
a27e3d14
MV
2854 * vectors.h (SCM_VECTOR_REF): New.
2855
ffd0ef3b
MV
2856 * snarf.h (SCM_DEFINE_PUBLIC): New.
2857
f8a1712b
MV
28582002-08-30 Marius Vollmer <mvo@zagadka.ping.de>
2859
2860 * socket.c (scm_addr_vector): Added size of address to arguments.
2861 Use it to avoid accessing a non-existent path in a sockaddr_un.
2862 Changed all callers.
2863
7200a36b
HWN
28642002-08-29 Han-Wen Nienhuys <hanwen@cs.uu.nl>
2865
1383773b
HWN
2866 * gc.h: remove DOUBLECELL card flags.
2867
2868 * gc-malloc.c (scm_calloc): try to use calloc() before calling
2869 scm_realloc().
2870
2871 * gc-segment.c (scm_i_initialize_heap_segment_data): remove card
2872 init loop; handle this from scm_init_card_freelist()
2873
2874 * gc-card.c (scm_init_card_freelist): init bit vector here.
2875
7200a36b 2876 * numbers.c (scm_make_real): prevent reordering of statements
8fa5786d 2877 num2float.i.c (FLOAT2NUM): idem
7200a36b 2878
9981de3a
HWN
28792002-08-27 Han-Wen Nienhuys <hanwen@cs.uu.nl>
2880
2881 * eval.h: prepend libguile/ to include path
2882
19647556
MV
28832002-08-26 Marius Vollmer <mvo@zagadka.ping.de>
2884
2885 * script.c (scm_compile_shell_switches): Added "2002" to Copyright
2886