*** empty log message ***
[bpt/guile.git] / libguile / ChangeLog
CommitLineData
ef5b6b61
MV
12004-01-22 Marius Vollmer <mvo@zagadka.de>
2
3 * eval.c (m_expand_body): Rewrite the expression in place (by
4 overwriting FORMS) also when a letrec is constructed, not only
5 when no definitions are found. Do not return rewritten expression
6 to emphasize the in-place rewriting. Changed all users.
7
7eec4c37
HWN
82004-01-19 Han-Wen Nienhuys <hanwen@xs4all.nl>
9
10 * gc.c: add protected_object_count, a number that is dumped from
11 gc_stats()
12
25ffbdac
MV
132004-01-11 Marius Vollmer <mvo@zagadka.de>
14
15 * dynwind.h, dynwind.c (scm_frame_unwind,
16 scm_frame_unwind_handler): Renamed and changed all uses.
17 (scm_frame_rewind, scm_frame_rewind_handler): Likewise.
18
08568c95
KR
192004-01-11 Kevin Ryde <user42@zip.com.au>
20
21 * unif.c (scm_bit_count, scm_bit_position, s_scm_bit_set_star_x,
22 s_scm_bit_count_star, s_scm_bit_invert_x): Clarify docstrings, as per
23 changes made to scheme-compound.texi.
24
5565749c
MV
252004-01-10 Marius Vollmer <mvo@zagadka.de>
26
25ffbdac
MV
27 * print.c (scm_print_symbol_name): Handle #{`foo}#, #{,foo}#,
28 #{.}#, and all numeric strings specially. Thanks to Paul Jarc!
29
30 * guile-snarf.in: Use mkdir to create a unique temporary directory
31 that we can safely use. Thanks to Stefan Nordhausen!
5565749c 32
fc6bb283
MV
332004-01-07 Marius Vollmer <marius.vollmer@uni-dortmund.de>
34
7ebccde8
MV
35 * dynwind.h, dynwind.c (scm_i_dowinds): Removed 'explicit'
36 argument since it is always zero now. Changed all callers.
37 Removed code for handling fluids.
96e3b2f8
MV
38
39 * fluids.c (scm_c_with_fluids): Use frames instead of adding to
40 the wind chain explicitely. Use scm_c_with_fluid for the common
41 case of only one fluid.
42 (scm_with_fluid): New.
43 (scm_c_with_fluid): Use frames instead of scm_c_with_fluids.
44
fc6bb283 45 * fluids.h, fluids.c (scm_frame_fluid): New.
96e3b2f8
MV
46 (scm_with_fluid): New.
47 (scm_i_swap_fluids, scm_i_swap_fluids_reverse): Removed.
fc6bb283
MV
48
49 * dynwind.c (scm_frame_end): Do not use scm_i_dowinds. Instead,
50 do the unwinding directly. It is simple enough.
51
52 * dynwind.h, dynwind.c: Did the following renamings:
53 scm_begin_frame -> scm_frame_begin,
54 scm_end_frame -> scm_frame_end,
55 scm_on_unwind -> scm_frame_unwind,
56 scm_on_rewind -> scm_frame_rewind,
57 scm_on_unwind_with_scm -> scm_frame_unwind_with_scm,
58 scm_on_rewind_with_scm -> scm_frame_rewind_with_scm.
59 Changed all uses.
60
61 * aync.h, async.c: Did the follwing renamings:
62 scm_with_blocked_asyncs -> scm_frame_block_asyncs,
63 scm_with_unblocked_asyncs -> scm_frame_unblock_asyncs.
64 Changed all uses.
65
66 * ports.h, ports.c: Did the follwing renamings:
67 scm_with_current_input_port -> scm_frame_current_input_port,
68 scm_with_current_output_port -> scm_frame_current_output_port,
69 scm_with_current_error_port -> scm_frame_current_error_port.
70 Changed all uses.
71
298ab996
KR
722004-01-07 Kevin Ryde <user42@zip.com.au>
73
74 * numbers.c (s_bignum): Remove, not used since gmp bignums.
75 Reported by Richard Todd.
76
ba40113e
KR
77 * threads-plugin.h (SCM_MUTEX_MAXSIZE): Increase to 12*sizeof(long),
78 for the benefit of powerpc-apple-darwin5.5. Reported by Richard Todd.
79
298ab996
KR
80 * unif.c (scm_aind): Test SCM_CONSP rather than !SCM_NULLP while
81 traversing the args list, fixes segv if an improper list is given.
82 Reported by Rouben Rostamian.
83
aacff585
MV
842004-01-06 Marius Vollmer <marius.vollmer@uni-dortmund.de>
85
86 * ports.c (swap_ports, scm_with_current_foo_port): Do not allocate
87 swap_data on stack, use a 'malloc obj'.
88
89 * fluids.h, fluids.c (scm_make_initial_fluids, scm_copy_fluids,
90 scm_swap_fluids, scm_swap_fluids_reverse): Renamed to
91 scm_i_... since they are internal. Changed all uses.
92
93 * dynwind.c (frame_print): Removed, use the default printer.
94 (WINDER_F_MARK, WINDER_MARK_P, winder_mark): New.
95 (scm_on_unwind_with_scm, scm_on_rewind_with_scm): New. Use above
96 to protect SCM values.
97
98 * dynwind.h (SCM_F_WIND_EXPLICITELY,
99 SCM_F_WIND_EXPLICITLY): It's "explicitly" not "explicitely", damn.
100 Changed all uses.
101 (scm_on_unwind_with_scm, scm_on_rewind_with_scm): New.
102
49c00ecc
MV
1032004-01-05 Marius Vollmer <mvo@zagadka.de>
104
105 * ports.h, ports.c (scm_with_current_input_port,
106 scm_with_current_output_port, scm_with_current_error_port): New.
107
108 * async.h, async.c (scm_with_blocked_asyncs,
109 scm_with_unblocked_asyncs): New.
110
dab514a8
MV
1112004-01-03 Marius Vollmer <mvo@zagadka.de>
112
113 * dynwind.h, scm_dynwind.c (scm_t_frame_flags, scm_t_wind_flags,
114 scm_begin_frame, scm_end_frame, scm_on_unwind, scm_on_rewind):
115 New.
116 (scm_dowinds, scm_i_dowinds): scm_dowinds has been renamed to
117 scm_i_dowinds and extended to handle frames and to invoke a 'turn'
118 function when the outermost wind point has been reached. The
119 latter is used to copy a continuation stack at the right time.
120 scm_dowinds remains available.
121 (SCM_GUARDSP, SCM_BEFORE_GUARD, SCM_AFTER_GUARD, SCM_GUARD_DATA,
122 tc16_guard, guards_print): Removed.
123 (scm_internal_dynamic_wind): Reimplemented using frames.
124
125 * continuations.c (copy_stack): New, do only the stack copying
126 part of copy_stack_and_call.
127 (copy_stack_and_call): Copy the stack after unwinding and before
128 rewinding.
129 (scm_dynthrow): Do not call scm_dowinds, this is now done by
130 copy_stack_and_call.
131
441a25d9
KR
1322004-01-04 Kevin Ryde <user42@zip.com.au>
133
134 * numbers.c (scm_less_p): Don't convert frac to float for compares,
dab514a8 135 can give bad results due to rounding.
441a25d9 136
e0499207
KR
137 * stime.c (scm_current_time, scm_gettimeofday): Add a comment about
138 setzone/restorezone protection for DOS.
139
89fcf1b4
MV
1402003-12-26 Marius Vollmer <mvo@zagadka.de>
141
142 * gen-scmconfig.h.in, gen-scmconfig.c: Arrange for scm_t_intmax
143 and scm_t_uintmax to be defined in scmconfig.h
144
caff34d4
KR
1452003-12-03 Kevin Ryde <user42@zip.com.au>
146
147 * numbers.c (scm_less_p): Remove spurious xisnan from frac+big case.
148
149 * numbers.c (scm_make_ratio): Check for numerator equal to
150 SCM_MOST_NEGATIVE_FIXNUM and bignum denominator the negative of that,
151 giving integer -1.
152
153 * numbers.c (scm_real_part): Return fraction unchanged rather than
154 converting to flonum.
155
2d0b85ac
DH
1562003-11-30 Dirk Herrmann <D.Herrmann@tu-bs.de>
157
158 * modules.c (module_variable): Fixed (and thus simplified) the
159 definition of SCM_BOUND_THING_P to reflect the fact that since
160 after the 1.4 series of guile, obarrays only hold variable
161 objects.
162
2297981d
MV
1632003-11-30 Marius Vollmer <mvo@zagadka.de>
164
165 * numbers.c (scm_logand): It's "#b...", not "#\b...".
166
167 From Paul Jarc:
168
169 * read.c (scm_lreadr): Signal an error for invalid escape
170 sequences in strings. Code cleanups too.
171
172 * print.c (scm_iprin1): use \xNN hexadecimal sequences when
173 writing control characters in strings.
174
1752003-11-21 Marius Vollmer <mvo@zagadka.de>
176
177 * ports.c (scm_drain_input): Bug fix: only access the port after
178 checking that it indeed is one.
179
5c264007
DH
1802003-11-22 Dirk Herrmann <D.Herrmann@tu-bs.de>
181
182 * eval.c (s_bad_define): New static identifier.
183
184 (m_body): Fixed comment.
185
186 (scm_m_define): Don't generate memoized code for definitions that
187 are not on the top level. As a consequence, no memoized code at
188 all is generated for definitions any more: Top level definitions
189 are executed immediately during memoization and internal
190 definitions are handled separately in m_expand_body.
191
192 (scm_unmemocopy, unmemocopy): Removed code for unmemoizing
193 definitions. Consequently, there is no unmemoizing code any more
194 that might modify the environment. Thus, the old scm_unmemocopy
195 is removed and the old unmemocopy is renamed to scm_unmemocopy.
196
197 (SCM_CEVAL): The SCM_IM_DEFINE keyword can no longer occur in
198 memoized code. Call EVALCAR for continuations. Prefer !SCM_NULLP
199 over SCM_NIMP in places, where the argument is known to be part of
200 a proper list.
201
018d4730
KR
2022003-11-21 Kevin Ryde <user42@zip.com.au>
203
204 * numbers.c (scm_abs): Allocate a new real only for negatives, as done
205 for bignums.
206
207 * numbers.c (scm_bit_extract): Use mpz functions, rearrange inum case
208 to share some shifting.
209
210 * numbers.c (scm_integer_expt): Don't mpz_init after scm_i_clonebig or
211 scm_i_mkbig, since they do so already. Don't mpz_clear a bignum SCM,
212 since gc does this.
213
4bca30d8
MV
2142003-11-19 Marius Vollmer <mvo@zagadka.de>
215
fb16d26e
MV
216 * numbers.c (scm_make_ratio): Rewritten to have a simpler
217 structure. Previously, not all cases with a negative denominator
218 were covered.
219
4bca30d8
MV
220 * numbers.c (mem2decimal_from_point): use scm_divide instead of
221 scm_divide2real when forming the fractional part. This allows
222 "#e1.2" to yield 6/5.
223
224 * numbers.c (scm_i_fraction_equalp): Do not treat the return value
225 of scm_equal_p as a C boolean, use SCM_FALSEP. Previously, all
226 fractions were equal to each other regardless of value. Ooops.
227
228 * numbers.c (scm_rationalize): Return an inexact result when given
229 inexact arguments.
230
231 * numbers.c (scm_exact_p, scm_inexact_p): Throw error for
232 non-numbers.
233
bdf26b60
MV
2342003-11-18 Marius Vollmer <marius.vollmer@uni-dortmund.de>
235
236 Support for exact fractions from Bill Schottstaedt! Thanks!
237
238 * print.c (scm_iprin1): Handle fractions.
239
240 * objects.h (scm_class_fraction): New.
241 * objects.c (scm_class_fraction): New.
242 (scm_class_of): Handle fractions.
243
244 * hash.c (scm_hasher): Handle fractions.
245
246 * numbers.c: New code for handling fraction all over the place.
247 (scm_odd_p, scm_even_p): Handle inexact integers.
248 (scm_rational_p): New function, same as scm_real_p.
249 (scm_round_number, scm_truncate_number, scm_ceiling, scm_floor):
250 New exact functions that replace the inexact 'dsubr'
251 implementations.
252 (scm_numerator, scm_denominator): New.
253
254 * numbers.h (SCM_NUMP): Recognize fractions.
255 (SCM_FRACTIONP, SCM_SLOPPY_FRACTIONP, SCM_FRACTION_NUMERATOR,
256 SCM_FRACTION_DENOMINATOR, SCM_FRACTION_SET_NUMERATOR,
257 SCM_FRACTION_SET_DENOMINATOR, SCM_FRACTION_REDUCED_BIT,
258 SCM_FRACTION_REDUCED_SET, SCM_FRACTION_REDUCED_CLEAR,
259 SCM_FRACTION_REDUCED): New.
260 (scm_floor, scm_ceiling, scm_truncate_number, scm_round_number):
261 New prototypes.
262 (scm_make_ratio, scm_rationalize, scm_numerator, scm_denominator,
263 scm_rational_p): New prototypes.
264 (scm_i_dbl2num, scm_i_fraction2double, scm_i_fraction_equalp,
265 scm_i_print_fraction): New prototypes.
266
267 * goops.c (create_standard_classes): Create "<fraction>" class.
268
269 * gc-mark.c (scm_gc_mark_dependencies): Handle fractions.
270
271 * gc-card.c (scm_i_sweep_card): Include scm_tc16_fraction as a
272 case in the switch, but do nothing for now.
273
274 * eval.c (SCM_CEVAL, SCM_APPLY, call_dsubr_1): Convert fractions
275 to doubles when calling 'dsubr' functions.
276
277 * eq.c (scm_eqv_p, scm_equal_p): Handle fractions.
278
28fda544
RB
2792003-11-18 Rob Browning <rlb@defaultvalue.org>
280
281 * gen-scmconfig.c (main): remove public definition of
282 SCM_SIZEOF___INT64 and SCM_SIZEOF_UNSIGNED___INT64 and add
283 direct typedef of long_long and ulong_long inside deprecated block
284 when appropriate.
285
286 * deprecated.h: move long_long and ulong_long definitions to
287 gen-scmconfig.c so that we don't need to add SCM_SIZEOF___INT64
288 and SCM_SIZEOF_UNSIGNED___INT64 to the public namespace.
289
b58e7420
MV
2902003-11-17 Marius Vollmer <mvo@zagadka.de>
291
9a1d7d7c
MV
292 * hash.c (scm_string_hash): New hashing algorithm that takes the
293 complete string into account.
294
b58e7420
MV
295 * eval.c (scm_m_generalized_set_x): Macroexpand the target when it
296 is a list. This allows (@ ...) to work with set!.
9a1d7d7c
MV
297 (scm_m_generalized_set_x): Use ASSERT_SYNTAX_2 instead of
298 SCM_ASSYNT.
b58e7420
MV
299
300 * script.c (scm_compile_shell_switches): Use scm_c_read_string for
301 the "-e" option instead of scm_str2symbol. This allows things
302 like (@ ...) to be specified for the entry point.
303
461bffb1
DH
3042003-11-16 Dirk Herrmann <D.Herrmann@tu-bs.de>
305
306 * eval.c (scm_m_letstar): Create memoized code in place to
307 minimize consing.
308
6f81708a
DH
3092003-11-16 Dirk Herrmann <D.Herrmann@tu-bs.de>
310
311 * eval.c (s_splicing): Commented and reformulated.
312
313 (lookup_global_symbol, lookup_symbol): New static functions.
314
315 (s_test, s_bindings, s_duplicate_bindings, s_variable): Removed.
316
317 (try_macro_lookup, literal_p): Use lookup_symbol instead of
318 creating a temporary pair for scm_lookupcar.
319
320 (scm_unmemocar, unmemocar): Renamed scm_unmemocar to unmemocar,
321 created deprecated wrapper function scm_unmemocar.
322
323 (SCM_VALIDATE_NON_EMPTY_COMBINATION, scm_sym_else,
324 scm_sym_unquote, scm_sym_uq_splicing, scm_sym_enter_frame,
325 scm_sym_apply_frame, scm_sym_exit_frame, scm_sym_trace, f_apply,
326 undefineds, sym_three_question_marks): Moved around without
327 modifications.
328
329 * eval.c, eval.h (scm_macroexp, scm_unmemocar): Deprecated.
330
910b5125
DH
3312003-11-15 Dirk Herrmann <D.Herrmann@tu-bs.de>
332
333 * eval.c (try_macro_lookup, expand_user_macros, is_system_macro_p,
334 m_expand_body, scm_m_expand_body): Grouped together with m_body.
335 No further modifications.
336
c86c440b
DH
3372003-11-15 Dirk Herrmann <D.Herrmann@tu-bs.de>
338
339 * eval.c (s_mixed_body_forms): New static identifier.
340
341 (canonicalize_define, scm_m_define): The check for a bad
342 expression is performed in canonicalize_define now.
343
344 (try_macro_lookup, expand_user_macros, is_system_macro_p): New
345 static helper functions for m_expand_body.
346
347 (m_expand_body): Use ASSERT_SYNTAX to signal syntax errors. Only
348 expand user defined macros. Fixed handling of the definition/
349 expression boundary. Fixed handling of definitions grouped with
350 'begin. Use canonicalize_define to expand definitions.
351
3890131a
MV
3522003-11-13 Marius Vollmer <mvo@zagadka.de>
353
b58e7420
MV
354 * read.c (scm_lreadr): detect EOF after backslash, and interpret
355 \xNN hexadecimal sequences. From Paul Jarc, thanks!
356
5df36eac
MV
357 * snarf.h (SCM_SMOB, SCM_GLOBAL_SMOB, SCM_SMOB_MARK,
358 SCM_GLOBAL_SMOB_MARK, SCM_SMOB_FREE, SCM_GLOBAL_SMOB_FREE,
359 SCM_SMOB_PRINT, SCM_GLOBAL_SMOB_PRINT, SCM_SMOB_EQUALP,
360 SCM_GLOBAL_SMOB_EQUALP, SCM_SMOB_APPLY, SCM_GLOBAL_SMOB_APPLY):
361 New macros from Paul Jarc. Thanks!
362
3890131a
MV
363 * gc_os_dep.c (scm_get_stack_base): Provide a definition that
364 return NULL when the machine type is unknown. Previously,
365 gc_os_dep.c would refuse to compile.
366
430b8401
DH
3672003-11-09 Dirk Herrmann <D.Herrmann@tu-bs.de>
368
369 * eval.c (scm_m_body, m_body, scm_m_lambda, memoize_named_let,
370 scm_m_let, scm_m_letrec, m_expand_body): Renamed static function
371 scm_m_body to m_body.
372
328dc9a3
DH
3732003-11-09 Dirk Herrmann <D.Herrmann@tu-bs.de>
374
375 * eval.c, eval.h (scm_m_expand_body, m_expand_body): Deprecated
376 public use of scm_m_expand_body in eval.h. In eval.c, renamed
377 scm_m_expand_body to m_expand_body and made it static. Added
378 deprecated wrapper scm_m_expand_body.
379
380 (scm_eval_body, SCM_CEVAL, SCM_APPLY): Use m_expand_body instead
381 of scm_m_expand_body.
382
c2337a61
KR
3832003-11-09 Kevin Ryde <user42@zip.com.au>
384
385 * dynl.c (scm_dynamic_unlink): Need scm_list_1 on error message
386 argument. Reported by Mike Gran.
387
ced8edb0
DH
3882003-11-08 Dirk Herrmann <D.Herrmann@tu-bs.de>
389
390 * eval.c (s_missing_body_expression): New static identifier.
391
392 (s_body): Removed.
393
394 (scm_m_expand_body): Fixed core dump when passing a body with
395 defines, but without expressions (see additions to syntax.test).
396 Use ASSERT_SYNTAX to signal syntax errors.
397
0f572ba7
DH
3982003-11-02 Dirk Herrmann <D.Herrmann@tu-bs.de>
399
400 * eval.c (canonicalize_define): New static helper function.
401
402 (memoize_define, canonicalize_define): Extract handling of
403 function currying to canonicalize_define.
404
2510c810
DH
4052003-11-02 Dirk Herrmann <D.Herrmann@tu-bs.de>
406
407 * eval.c (scm_trampoline_0, scm_trampoline_1, scm_trampoline_2):
408 Make sure that error checking in debug mode is not worse than in
409 standard mode.
410
34adf7ea
DH
4112003-11-01 Dirk Herrmann <D.Herrmann@tu-bs.de>
412
413 * eval.c (scm_m_body, scm_m_lambda): Documentation strings are not
414 handled in scm_m_body any more, but rather in scm_m_lambda.
415
416 (scm_m_body, memoize_named_let, scm_m_let, scm_m_letstar,
417 scm_m_letrec, scm_m_expand_body): Check for validity is done by
418 calling functions of scm_m_body.
419
420 (scm_m_lambda): Avoid unnecessary consing when creating the
421 memoized code.
422
89bff2fc
DH
4232003-11-01 Dirk Herrmann <D.Herrmann@tu-bs.de>
424
425 * eval.c (s_expression): Added comment.
426
427 (s_empty_combination, error_unbound_variable): New static
428 identifiers.
429
430 (SCM_VALIDATE_NON_EMPTY_COMBINATION, SCM_EVALIM2, scm_lookupcar1):
431 Use ASSERT_SYNTAX, syntax_error or error_unbound_variable to
432 signal syntax errors.
433
434 (SCM_CEVAL): Separated handling of evaluator bytecodes and other
435 scheme objects.
436
60a49842
DH
4372003-10-25 Dirk Herrmann <D.Herrmann@tu-bs.de>
438
439 * eval.c (unmemocar, sym_three_question_marks, scm_unmemocar):
440 Grouped together with unmemocopy, without modifications.
441
442 (build_binding_list, unmemocopy): Renamed names of list arguments
443 and variables to reflect the actual order of the list elements.
444
70c1c108
DH
4452003-10-22 Dirk Herrmann <D.Herrmann@tu-bs.de>
446
447 * eval.c (s_defun): New static identifier.
448
449 (scm_m_nil_cond, scm_m_atfop, scm_m_undefine): Add comments. Use
450 ASSERT_SYNTAX to signal syntax errors. Avoid unnecessary consing
451 when creating the memoized code.
452
0ee39677
KR
4532003-10-19 Kevin Ryde <user42@zip.com.au>
454
455 * numbers.c (scm_ash): Revise docstring as per recent update to manual.
456
457 * numbers.c (scm_i_big2dbl): Rewrite, carefully rounding to "closest"
458 in accordance with R5RS, which just mpz_get_d doesn't really give.
459
9a848baf
DH
4602003-10-18 Dirk Herrmann <D.Herrmann@tu-bs.de>
461
462 * eval.c (s_bad_slot_number): New static identifier.
463
464 (scm_m_atslot_ref, scm_m_atslot_set_x): Use ASSERT_SYNTAX to
465 signal syntax errors. Avoid unnecessary consing when creating the
466 memoized code.
467
da48db62
DH
4682003-10-18 Dirk Herrmann <D.Herrmann@tu-bs.de>
469
470 * eval.c (scm_m_cont, scm_m_at_call_with_values,
471 scm_m_generalized_set_x): Use ASSERT_SYNTAX to signal syntax
472 errors. Avoid unnecessary consing when creating the memoized
473 code.
474
475 (scm_m_generalized_set_x): Let scm_m_set_x handle the R5RS
476 standard case. Make sure line and file information are copied to
477 every created expression.
478
82b3e2c6
DH
4792003-10-18 Dirk Herrmann <D.Herrmann@tu-bs.de>
480
481 * eval.c (scm_m_set_x, scm_m_apply, scm_m_atbind): Use
482 ASSERT_SYNTAX to signal syntax errors. Avoid unnecessary consing
483 when creating the memoized code.
484
485 (scm_m_atbind): Reversed the order, in which the init expressions
486 are stored and executed. The order of execution is now equal to
487 the order in which the initializers of the let-forms are executed.
488 Use check_bindings and transform_bindings.
489
490 (SCM_CEVAL): Eliminated SCM_NIMP in favor of more appropriate
491 !SCM_NULLP. Added some comments.
492
21628685
DH
4932003-10-18 Dirk Herrmann <D.Herrmann@tu-bs.de>
494
495 * eval.c: Sorted include files alphabetically.
496
497 (scm_m_begin): Added comment.
498
499 (scm_m_or): Use ASSERT_SYNTAX to signal syntax errors. Avoid
500 unnecessary consing when creating the memoized code.
501
502 (iqq, scm_m_quasiquote, scm_m_quote): Use ASSERT_SYNTAX to signal
503 syntax errors. Be more specific about the kind of error that was
504 detected.
505
506 (scm_m_quote, unmemocopy): As an optimization, vector constants
507 are now inserted unquoted into the memoized code. During
508 unmemoization the quotes are added again to provide syntactically
509 correct code.
510
d6754c23
DH
5112003-10-18 Dirk Herrmann <D.Herrmann@tu-bs.de>
512
513 * eval.c (scm_m_let, scm_m_letstar, scm_m_letrec,
514 scm_m_expand_body, check_bindings): Extracted syntax checking of
515 bindings to new static function check_bindings.
516
517 (scm_m_let, memoize_named_let): Extracted handling of named let to
518 new static function memoize_named_let.
519
520 (transform_bindings, scm_m_let, scm_m_letstar, scm_m_letrec): Use
521 ASSERT_SYNTAX to signal syntax errors. Be more specific about the
522 kind of error that was detected. Avoid use of SCM_CDRLOC. Avoid
523 unnecessary consing when creating the memoized code.
524
03a3e941
DH
5252003-10-12 Dirk Herrmann <D.Herrmann@tu-bs.de>
526
527 * eval.c (s_bad_formals, s_bad_formal, s_duplicate_formal): New
528 static identifiers.
529
530 (s_clauses, s_formals, s_duplicate_formals): Removed.
531
532 (scm_m_lambda): Use ASSERT_SYNTAX to signal syntax errors. Be more
533 specific about the kind of error that was detected. Prepare for
534 easier integration of changes for separated memoization.
535
da48db62 5362003-10-12 Dirk Herrmann <D.Herrmann@tu-bs.de>
4610b011
DH
537
538 * eval.c (s_duplicate_binding): New static identifier.
539
540 (scm_m_case): Call scm_c_memq instead of implementing it inline.
541
542 (scm_m_define): Added comment about how we check for duplicate
543 formals.
544
545 (scm_m_do): Added check for duplicate bindings.
546
547 (scm_m_if): Use ASSERT_SYNTAX to signal syntax errors. Avoid
548 unnecessary consing when creating the memoized code.
549
550 (scm_c_improper_memq, c_improper_memq, scm_m_lambda): Renamed
551 scm_c_improper_memq to c_improper_memq, since it is not exported.
552
553 (transform_bindings): Call scm_c_memq rather than
554 scm_c_improper_memq.
555
556 (SCM_CEVAL): Simplified handling of SCM_IM_IF forms.
557
da48db62 5582003-10-12 Dirk Herrmann <D.Herrmann@tu-bs.de>
a954ce1d
DH
559
560 * eval.c (s_bad_bindings, s_bad_binding, s_bad_exit_clause): New
561 static identifiers.
562
563 (scm_m_do): Use ASSERT_SYNTAX to signal syntax errors. Be more
564 specific about the kind of error that was detected. Avoid use of
565 SCM_CDRLOC. Avoid unnecessary consing when creating the memoized
566 code, this way also making sure that file name, line number
567 information etc. remain available.
568
da48db62 5692003-10-12 Dirk Herrmann <D.Herrmann@tu-bs.de>
8ae95199
DH
570
571 * eval.c (memoize_as_thunk_prototype): New static function.
572
573 (scm_m_delay, scm_m_future): Use memoize_as_thunk_prototype.
574 Avoid unnecessary consing when creating the memoized code.
575
9b9a35b6
KR
5762003-10-12 Kevin Ryde <user42@zip.com.au>
577
578 * list.c (scm_append): Track argument number and use in error.
579
cc56ba80
DH
5802003-10-11 Dirk Herrmann <D.Herrmann@tu-bs.de>
581
582 * eval.c (s_missing_expression, s_bad_variable): New static
583 identifiers.
584
585 (scm_m_define): Use ASSERT_SYNTAX to signal syntax errors. Prefer
586 R5RS terminology for the naming of variables. Be more specific
587 about the kind of error that was detected. Make sure file name,
588 line number etc. are added to all freshly created expressions.
589 Avoid unnecessary consing when creating the memoized code.
590
609a8b86
DH
5912003-10-11 Dirk Herrmann <D.Herrmann@tu-bs.de>
592
593 * eval.c (s_extra_expression, s_misplaced_else_clause,
594 s_bad_cond_clause, s_missing_recipient): New static identifiers.
595
596 (s_extra_case_clause): Removed.
597
598 (scm_m_case, scm_m_cond): If a clause appears after an else
599 clause, report a misplaced else clause.
600
601 (scm_m_cond): Use ASSERT_SYNTAX to signal syntax errors. Be more
602 specific about the kind of error that was detected. Handle bound
603 'else and '=>. Avoid unnecessary consing when creating the
604 memoized code.
605
606 (scm_m_cond, unmemocopy, SCM_CEVAL): Use SCM_IM_ELSE to memoize
607 the syntactic keyword 'else and SCM_IM_ARROW to memoize the
608 syntactic keyword '=>.
609
58a2510b
DH
6102003-10-11 Dirk Herrmann <D.Herrmann@tu-bs.de>
611
612 * eval.c (scm_m_case): Allow empty lists of case labels.
613
2a6f7afe
DH
6142003-10-11 Dirk Herrmann <D.Herrmann@tu-bs.de>
615
616 * tags.h (SCM_IM_ELSE, SCM_IM_ARROW): New memoizer codes.
617
618 * print.c (scm_isymnames): Add names for the new memoizer codes.
619
620 * eval.c (s_missing_clauses, s_bad_case_clause,
621 s_extra_case_clause, s_bad_case_labels, s_duplicate_case_label,
622 literal_p): New static identifiers.
623
624 (scm_m_case): Use ASSERT_SYNTAX to signal syntax errors. Be more
625 specific about the kind of error that was detected. Check for
626 duplicate case labels. Handle bound 'else. Avoid unnecessary
627 consing when creating the memoized code.
628
629 (scm_m_case, unmemocopy, SCM_CEVAL): Use SCM_IM_ELSE to memoize
630 the syntactic keyword 'else.
631
e6729603
DH
6322003-10-10 Dirk Herrmann <D.Herrmann@tu-bs.de>
633
634 * eval.c (s_bad_expression, syntax_error_key, syntax_error,
635 ASSERT_SYNTAX, ASSERT_SYNTAX_2): New static identifiers.
636
637 (scm_m_and): Use ASSERT_SYNTAX to signal syntax errors. Avoid
638 unnecessary consing when creating the memoized code.
639
9ddeb776
KR
6402003-10-09 Kevin Ryde <user42@zip.com.au>
641
642 * numbers.c (scm_inexact_to_exact): Don't depend on what double->long
643 cast gives for values bigger than a long, or for nan or inf.
644
df5af69a
DH
6452003-10-08 Dirk Herrmann <D.Herrmann@tu-bs.de>
646
647 * smob.h (scm_make_smob_type): Made the declaration match the
648 definition.
649
da0e6c2b
MV
6502003-10-07 Marius Vollmer <mvo@zagadka.de>
651
652 * goops.c, objects.h, smob.c, smob.h: Make type names char
653 const * instead of char *. Thanks to Paul Jarc!
654
591924eb
KR
6552003-10-02 Kevin Ryde <user42@zip.com.au>
656
ff6ea7b9 657 * strports.c (scm_call_with_output_string): scm_get_output_string
591924eb
KR
658 rather than scm_strport_to_string, so as to guard against the port
659 having been closed by the called procedure. Reported by Nic Ferrier.
660
f03314f9
DH
6612003-09-18 Dirk Herrmann <D.Herrmann@tu-bs.de>
662
663 * numbers.h (SCM_INEXACTP): Removed uses of SCM_TYP16S.
664
665 * tags.h, deprecated.h (SCM_TYP16S): Deprecated and moved from
666 tags.h to deprecated.h.
667
534c55a9
DH
6682003-09-18 Dirk Herrmann <D.Herrmann@tu-bs.de>
669
670 This set of patches introduces a new tc7 code scm_tc7_number for
671 numbers. Bignums, reals and complex numbers are turned from smobs
672 into subtypes of scm_tc7_number.
673
674 * tags.h (scm_tc7_number): New.
675
676 * eq.c (scm_equal_p), eval.c (SCM_CEVAL), evalext.c
677 (scm_self_evaluating_p), gc-card.c (scm_i_sweep_card), gc-mark.c
678 (scm_gc_mark_dependencies), goops.c (create_smob_classes), hash.c
679 (scm_hasher), numbers.c, numbers.h (SCM_NUMP), objects.c
680 (scm_class_of), print.c (scm_iprin1), smob.c
681 (scm_smob_prehistory): Don't handle bignums, reals and complex
682 numbers as subtypes of scm_tc7_smob any more.
683
684 * numbers.h, tags.h (scm_tc16_big, scm_tc16_real,
685 scm_tc16_complex): Moved definitions from tags.h to numbers.h.
686
29c4382a
DH
6872003-09-18 Dirk Herrmann <D.Herrmann@tu-bs.de>
688
689 * numbers.c (scm_make_complex), gc-card.c (scm_i_sweep_card): Use
690 sizeof (scm_t_complex) to determine the memory size of the
691 malloc'd area for complex numbers.
692
47ae1f0e
DH
6932003-09-17 Dirk Herrmann <D.Herrmann@tu-bs.de>
694
695 * numbers.c (scm_bigequal): Fixed.
696
859b6b2f
MV
6972003-09-16 Marius Vollmer <mvo@zagadka.de>
698
699 * stime.c (scm_current_time): 'time' does not set errno so don't
700 use SCM_SYSERROR for reporting errors.
701
e17d318f
DH
7022003-09-16 Dirk Herrmann <D.Herrmann@tu-bs.de>
703
704 This set of patches eliminates the dependency between the
705 implementation of evaluator specific memoization codes and special
706 constants like #f, '() etc. ('flags'), which are not evaluator
707 specific. The goal is to remove definitions of evaluator
708 memoization codes completely from the public interface. This will
709 make it possible to experiment more freely with optimizations of
710 guile's internal representation of memoized code.
711
712 * objects.c (scm_class_of): Eliminate dependency on SCM_ISYMNUM.
713
714 * print.c (iflagnames): New array, holding the printed names of
715 guile's special constants ('flags').
716
717 (scm_isymnames): Now holds only the printed names of the
718 memoization codes.
719
720 (scm_iprin1): Separate the handling of memoization codes and
721 guile's special constants.
722
723 * tags.h (scm_tc9_flag, SCM_ITAG9, SCM_MAKE_ITAG9, SCM_ITAG9_DATA,
724 SCM_IFLAGNUM): new
725
726 (scm_tc8_char, scm_tc8_iloc, SCM_BOOL_F, SCM_BOOL_T,
727 SCM_UNDEFINED, SCM_EOF_VAL, SCM_EOL, SCM_UNSPECIFIED, SCM_UNBOUND,
728 SCM_ELISP_NIL, SCM_IM_DISPATCH, SCM_IM_SLOT_REF,
729 SCM_IM_SLOT_SET_X, SCM_IM_DELAY, SCM_IM_FUTURE,
730 SCM_IM_CALL_WITH_VALUES, SCM_IM_NIL_COND, SCM_IM_BIND): Changed
731 values.
732
733 (SCM_IFLAGP): SCM_IFLAGP now only tests for flags.
734
735 (SCM_IFLAGP, SCM_MAKIFLAG, SCM_IFLAGNUM): Generalized to use the
736 tc9 macros and scm_tc9_flag.
737
eecac806
MV
7382003-09-15 Marius Vollmer <mvo@zagadka.de>
739
740 * posix.c (scm_setgroups): Check that the gid list is not too
741 long. Thanks to Paul Jarc!
742
22f2cf2d
DH
7432003-09-14 Dirk Herrmann <D.Herrmann@tu-bs.de>
744
745 * tags.h: Reduced the number of short instructions from 14 to 13.
746 The typecode of the former 14th short instruction is now used to
747 represent long instructions. Changed some comments to reflect
748 this fact.
749
750 (SCM_MAKISYM): ISYMs get a new tc7 code, namely the one that was
751 previously used by SCM_IM_DEFINE.
752
753 (SCM_IM_DEFINE): Turned into a long instruction.
754
755 * eval.c (unmemocopy, SCM_CEVAL): Treat SCM_IM_DEFINE as a long
756 instruction.
757
758 * eval.c (SCM_CEVAL): Since characters and iflags have now a tc7
759 code that is separate from all instructions, one level of dispatch
760 for long instructions can be eliminated.
761
762 * print.c (scm_isymnames): Removed some commented code.
763
62f548e1
MV
7642003-09-12 Marius Vollmer <mvo@zagadka.de>
765
97a61c5f
MV
766 * __scm.h (SCM_FENCE): Use __memory_barrier with the Intel
767 compiler on IA64.
768
50e0ba57
MV
769 * hashtab.h (scm_tc16_hashtable): Added "extern" declaration.
770
771 * modules.c (scm_module_reverse_lookup): Check that the obarray
772 really is a hashtable and do nothing if not.
773
62f548e1
MV
774 * inline.h: Use "extern inline" only with GCC. Use "static
775 inline" else.
776
0d5e3480
DH
7772003-09-06 Dirk Herrmann <D.Herrmann@tu-bs.de>
778
779 * numbers.h (SCM_INEXACTP, SCM_REALP, SCM_COMPLEXP): Removed uses
780 of SCM_SLOPPY_INEXACTP, SCM_SLOPPY_REALP and SCM_SLOPPY_COMPLEXP.
781
782 * numbers.h, deprecated.h (SCM_SLOPPY_INEXACTP, SCM_SLOPPY_REALP,
783 SCM_SLOPPY_COMPLEXP): Deprecated and moved from numbers.h to
784 deprecated.h.
785
6b412e91
DH
7862003-09-06 Dirk Herrmann <D.Herrmann@tu-bs.de>
787
788 * eq.c (scm_eqv_p, scm_equal_p): Removed uses of
789 SCM_SLOPPY_INEXACTP, SCM_SLOPPY_REALP and SCM_SLOPPY_COMPLEXP.
790
791 * eq.c (scm_eqv_p, scm_equal_p): Reordered comparisons from
792 0.0==some_expression to some_expression==0.0. The latter is
793 better readable. The former is preferred by some people, since it
794 leads to a compiler error when confusing == with =. However, when
795 using gcc, a warning will be issued if in an if-statement an
796 assigment appears. Since many Guile developers are using gcc,
797 such errors will not remain unnoticed anyway. We can therefore
798 focus on better readability.
799
7e3b25bf
DH
8002003-09-04 Dirk Herrmann <D.Herrmann@tu-bs.de>
801
802 * tags.h: Added description of Guile's type system. Removed some
803 old and misleading comments.
804
3ea39242
DH
8052003-09-04 Dirk Herrmann <D.Herrmann@tu-bs.de>
806
807 * unit.c (scm_cvref): Eliminate unnecessary uses of SCM_NIMP,
808 SCM_SLOPPY_REALP and SCM_SLOPPY_COMPLEXP.
809
5d7d39ff
DH
8102003-09-04 Dirk Herrmann <D.Herrmann@tu-bs.de>
811
812 * numbers.h (SCM_MAKINUM): Define in terms of scm_tc2_int.
813
814 (SCM_INEXACTP, SCM_REALP, SCM_COMPLEXP): Define in terms of the
815 respective SLOPPY macro.
816
baa84a20
DH
8172003-09-04 Dirk Herrmann <D.Herrmann@tu-bs.de>
818
819 * eq.c (scm_equal_p): Use SCM_TYP7 to check if an object is of
820 type string, not SCM_TYP7S.
821
ba15f500
KR
8222003-09-03 Kevin Ryde <user42@zip.com.au>
823
824 * numbers.c (scm_lognot): Correction to docstring, ones-complement not
825 2s-complement.
826
53bb8782
KR
827 * stime.c (scm_strptime): Add comment about glibc strptime %s and
828 current timezone requiring SCM_DEFER_INTS.
829
defdc4b4
NJ
8302003-08-30 Neil Jerram <neil@ossau.uklinux.net>
831
832 * script.c (scm_compile_shell_switches): Make -s switch optional
833 if file to be loaded does not begin with a `-'. (Thanks to Aaron
834 VanDevender for the patch!)
835
0f008a15
KR
8362003-08-30 Kevin Ryde <user42@zip.com.au>
837
838 * numbers.c (scm_lognot): Rewrite using ~ and mpz_com, for directness
839 and to have non-integer types rejected as per other logical funcs.
840
438a3ba1
KR
8412003-08-28 Kevin Ryde <user42@zip.com.au>
842
843 * gc.h (scm_remember_upto_here_1): Revise comments on the asm form.
844
98dceb37
KR
8452003-08-23 Kevin Ryde <user42@zip.com.au>
846
847 * simpos.c (scm_system): Remove SCM_DEFER_INTS, system() should be
848 thread safe, and could take a long time too.
849
1fa79a38
KR
8502003-08-22 Kevin Ryde <user42@zip.com.au>
851
852 * numbers.c (scm_difference): Correction to bignum - negative inum.
853
d97f9b42
KR
8542003-08-14 Kevin Ryde <user42@zip.com.au>
855
856 * gc.h (scm_remember_upto_here_1, scm_remember_upto_here_2)
857 [__GNUC__]: Use volatile asm macros rather than a function call.
858 * gc.c (scm_remember_upto_here_1, scm_remember_upto_here_2): Undefine
859 macros while defining functions.
860
861 * simpos.c (getenv): Use <stdlib.h> for prototype.
862 (scm_system): In docstring, refer to status:exit-val rather than
863 "functions above".
864
b9052fcc
KR
8652003-08-09 Kevin Ryde <user42@zip.com.au>
866
867 * srcprop.c (scm_source_properties): Return plist from hash if it's a
868 list set by source-properties! rather than an SRCPROPS object,
869
8e5b4b9e
KR
8702003-07-29 Kevin Ryde <user42@zip.com.au>
871
872 * properties.c (scm_primitive_property_ref): In docstring, note
873 parameters to not-found-proc, use hyphens rather than underscores for
874 that parameter name.
875 (scm_primitive_property_set_x): In docstring, VAL is the value
876 parameter not CODE.
877
20703ac4
MV
8782003-07-27 Marius Vollmer <mvo@zagadka.de>
879
c6ccee34
MV
880 * print.c (scm_print_symbol_name): handle more weird characters by
881 escaping the symbol name properly. Thanks to Paul Jarc!
882
2f4931bf
MV
883 * posix.h (scm_setgroups): New prototype.
884 * posix.c (scm_setgroups): New. Thanks to Paul Jarc!
885 (scm_getgroups): Handle groups ids that don't fit into a fixnum.
886 Don't use SCM_WRITABLE_VELTS.
887
265c456f
MV
888 * gc.h (SCM_GC_SET_CELL_BVEC): New.
889 * gc-card.c (scm_i_init_card_freelist): Use it. Thanks to
890 Matthias Koeppe!
891
20703ac4
MV
892 * __scm.h (SCM_C_INLINE_KEYWORD): New.
893 * numbers.c: Use it in place of SCM_C_INLINE so that the code
894 compiles when SCM_C_INLINE is undefined.
895
59c4bb82
DH
8962003-07-24 Dirk Herrmann <D.Herrmann@tu-bs.de>
897
898 * __scm.h: Reformulated the architecture and compiler properties
899 in terms of properties of scm_t_bits and SCM variables rather than
900 in terms of c standard types. This is since it is not known which
901 of the standard types scm_t_bits and SCM variables will be defined
902 to.
903
d7850c8d
KR
9042003-07-24 Kevin Ryde <user42@zip.com.au>
905
906 * numbers.c (scm_angle): Use scm_flo0 for non-negative inum, bignum
907 and real.
908
8a0c514f
KR
9092003-07-18 Kevin Ryde <user42@zip.com.au>
910
911 * numbers.c (scm_product): In complex * bignum, correction to
912 REAL/IMAG fetch, x is the complex, not y.
913
0aacf84e
MD
9142003-07-13 Mikael Djurfeldt <djurfeldt@nada.kth.se>
915
916 * numbers.c (scm_odd_p, scm_even_p): Bugfix: Treat result of
917 scm_inf_p test as Scheme values.
918 (scm_sum): Bugfix: Normalize bignum created from a negative bignum
919 and a positive inum.
920 Use GNU indentation style.
921
192de9a4
DH
9222003-07-12 Dirk Herrmann <D.Herrmann@tu-bs.de>
923
924 * values.c (scm_values): Build lists of length 1 by using
925 scm_list_1 instead of using scm_cons.
926
bbb4438a
KR
9272003-07-10 Kevin Ryde <user42@zip.com.au>
928
b58c85ce
KR
929 * deprecation.c (scm_c_issue_deprecation_warning_fmt): Add va_end.
930 * list.c (scm_list_n): Ditto.
931
bbb4438a
KR
932 * gc-malloc.c (scm_gc_realloc): Define "ptr" at start of function.
933
287f8ad1
KR
9342003-07-08 Matthias Koeppe <mkoeppe@merkur.math.uni-magdeburg.de>
935
936 * tags.h (scm_t_bits, scm_t_signed_bits, etc): Avoid solaris empty
937 defines of INTPTR_MAX and UINTPTR_MAX, combine conditionals for
938 scm_t_bits and scm_t_signed_bits to avoid any chance of one and not
939 the other using intptr_t.
940
005d2366
KR
9412003-07-08 Kevin Ryde <user42@zip.com.au>
942
0aacf84e 943 * numbers.c (scm_make_polar): Use sincos, when available.
005d2366
KR
944 (scm_magnitude): Use hypot.
945
946 * ports.c (scm_char_ready_p, scm_peek_char): In docstrings, don't use
947 @footnote since it doesn't go through to guile-procedures.txt.
948
949 * threads.c (scm_call_with_new_thread): In docstring, use "( )"
950 outside @var to quieten makeinfo, and use @code.
951
cbfe8e62
HWN
9522003-07-06 Han-Wen Nienhuys <hanwen@cs.uu.nl>
953
954 * gc-malloc.c (decrease_mtrigger): new function
955 (increase_mtrigger): new function, separate debug registering and
956 mtrigger administration.
957 (scm_gc_realloc): bugfix: do mtrigger administration before the
958 actual realloc, for the realloc might invalidate a GC-d segment of
959 memory. Thanks to Sam Hocevar for pointing this out.
960 (scm_gc_realloc): use scm_malloc_reregister instead of
961 unregistering and registering in sequence.
962
aeb4c2e1
HWN
9632003-07-03 Han-Wen Nienhuys <hanwen@cs.uu.nl>
964
965 * __scm.h (SCM_ASSERT): change "else" expansion to "do { } while (0)"
966
4c27f8d2
HWN
9672003-07-02 Han-Wen Nienhuys <hanwen@cs.uu.nl>
968
969 * __scm.h (SCM_ASRTGO): add "else" to macro expansions with if
970 clauses.
971
983e697d
MV
9722003-06-29 Marius Vollmer <mvo@zagadka.de>
973
974 * deprecated.h (SCM_OPDIRP, scm_fport, scm_option, scm_srcprops,
975 scm_srcprops_chunk, scm_info_frame, scm_stack, scm_array,
976 scm_array_dim, SCM_ARRAY_CONTIGUOUS, SCM_FUNC_NAME, SCM_WTA,
977 RETURN_SCM_WTA, SCM_VALIDATE_NUMBER_COPY,
978 SCM_VALIDATE_NUMBER_DEF_COPY, SCM_VALIDATE_OPDIR): Re-added from
979 the release_1_6 branch.
980
78b6566e
SJ
9812003-06-25 Stefan Jahn <stefan@lkcc.org>
982
983 * continuations.c: Redeclaration of getcontext() via the
984 __asm__ ("getcontext") directive.
985
986 * continuations.h: Include <ucontext.h> instead of
987 <sys/ucontext.h>.
988
1ebb8497
KR
9892003-06-21 Kevin Ryde <user42@zip.com.au>
990
991 * numbers.c (_GNU_SOURCE): #define, to get C99 things.
992 (scm_asinh, scm_acosh, scm_atanh, scm_truncate, $asinh, $acosh,
993 $atanh, truncate): Use C library asinh, acosh, atanh and trunc, when
994 available.
995 (scm_inexact_to_exact): Expand isfinite to its definition !xisinf.
996 (isfinite): Remove, conflicts with C99 isfinite().
997
fbf85ba4
MV
9982003-06-19 Marius Vollmer <mvo@zagadka.de>
999
1000 * deprecated.h, deprecated.c (scm_strhash, scm_sym2ovcell_soft,
1001 scm_sym2ovcell, scm_intern_obarray_soft, scm_intern_obarray,
1002 scm_symbol_value0, scm_string_to_obarray_symbol scm_intern_symbol,
1003 scm_unintern_symbol, scm_symbol_binding, scm_symbol_interned_p,
1004 scm_symbol_bound_p, scm_symbol_set_x, scm_gentemp): Re-added from
1005 the release_1_6 branch.
1006
fcc5d734
SJ
10072003-06-14 Stefan Jahn <stefan@lkcc.org>
1008
1009 * threads.h: Redefined scm_getspecific() and scm_setspecific()
1010 to be functions instead of macros.
1011
1012 * threads.c: Conditionalized inclusion of <sys/time.h> and
1013 <unistd.h>.
1014 (scm_getspecific, scm_setspecific): Made these two function
1015 real part of the API.
1016
1017 * posix.c (s_scm_putenv): Added some code to make a
1018 (putenv "FOO="), i.e. setting an empty string, work also on
1019 Win32 systems. Thanks to Kevin Ryde for the proposal.
1020
c3ae8e07
KR
10212003-06-12 Kevin Ryde <user42@zip.com.au>
1022
75b14838
KR
1023 * posix.c (scm_putenv): Free temporary ptr in mingw unset. Add
1024 freebsd to comment about need to use unsetenv.
c3ae8e07 1025
9d9fa092
MV
10262003-06-02 Marius Vollmer <mvo@zagadka.de>
1027
1028 * ports.c (scm_peek_char): Safe the column of the port around the
1029 getc/ungetc calls. Thanks to Dr. Peter Ivanyi!
1030
f2478375
KR
10312003-06-07 Kevin Ryde <user42@zip.com.au>
1032
1033 * tags.h: Use inttypes.h and stdint.h when available, for INTPTR_MAX
1034 and friends required by scm_t_bits setups.
1035
6375e040
DH
10362003-06-06 Dirk Herrmann <D.Herrmann@tu-bs.de>
1037
1038 * tags.h (scm_tc2_int): Added.
1039
1040 * tags.h (scm_tc3_int_1, scm_tc3_int_2): Expressed in terms of
1041 scm_tc2_int.
1042
1043 * tags.h (scm_tcs_cons_imcar, scm_tcs_cons_nimcar, scm_tcs_struct,
1044 scm_tcs_closures): Hard coded values replaced by symbolic ones.
1045
f5c6ec2f
DH
10462003-06-05 Dirk Herrmann <D.Herrmann@tu-bs.de>
1047
1048 * eval.c: Partially undid my patch from 2003-05-31. This patch
1049 caused the segfault referenced in the previous changelog entry.
1050
47dbd81e
DH
10512003-06-05 Dirk Herrmann <D.Herrmann@tu-bs.de>
1052
1053 * tags.h: Fixed comment about the immediate type code layout.
1054
1055 * eval.c: Fixed handling of non-special instructions. Without
1056 this patch, guile will segfault on (#\0) and similar instructions.
1057
3ec52c51
KR
10582003-06-05 Kevin Ryde <user42@zip.com.au>
1059
1060 * numbers.c (scm_max, scm_min): For inum, bignum and real, if other
1061 operand is NaN, then return NaN. Also avoid passing NaN to mpz_cmp_d.
1062
e418bd7c
KR
1063 * read.c (scm_input_error): Pass arg list parameter to scm_error_scm,
1064 rather than SCM_EOL. Needed by "Unknown # object" case in scm_lreadr.
1065
d0624e39
DH
10662003-06-04 Dirk Herrmann <D.Herrmann@tu-bs.de>
1067
1068 * __scm.h, gc-card.c (SCM_DEBUG_DEBUGGER_SUPPORT,
1069 SCM_DEBUG_DEBUGGING_SUPPORT): Renamed macro
1070 SCM_DEBUG_DEBUGGER_SUPPORT to SCM_DEBUG_DEBUGGING_SUPPORT and
1071 generalized it to apply not only to C level functions but also to
1072 scheme level functions.
1073
1074 * debug.c, debug.h, eval.c (make-iloc, scm_make_iloc, iloc?,
1075 scm_iloc_p, dbg-make-iloc, scm_dbg_make_iloc, dbg-iloc?,
1076 scm_dbg_iloc_p): Moved functions scm_make_iloc, scm_iloc_p to
1077 eval.c, made them available under SCM_DEBUG_DEBUGGING_SUPPORT == 1
1078 only and renamed them to scm_dbg_make_iloc, scm_dbg_iloc_p,
1079 respectively.
1080
1081 * deprecated.h, eval.c, eval.h (SCM_ILOC00, SCM_IDINC,
1082 SCM_IDSTMSK): Deprecated. The macro definitions are moved from
1083 eval.h into eval.c and a copy is placed into deprecated.h.
1084
1085 * eval.c, eval.h (SCM_MAKE_ILOC): Removed from eval.h and placed
1086 into eval.c. This definition was not part of the API in any
1087 officially released version of guile and thus does not need to go
1088 through a phase of deprecation.
1089
e90c3a89
DH
10902003-06-02 Dirk Herrmann <D.Herrmann@tu-bs.de>
1091
d0624e39
DH
1092 * deprecated.c, deprecated.h, eval.c, eval.h (scm_s_expression,
1093 scm_s_test, scm_s_body, scm_s_bindings, scm_s_variable,
1094 scm_s_clauses, scm_s_formals): Deprecated. In eval.c the
e90c3a89
DH
1095 definitions are make static and renamed from scm_s_xxx to s_xxx.
1096 In deprecated.c the original definitions are copied.
1097
d0624e39
DH
1098 * deprecated.h, eval.c, eval (SCM_EVALIM2, SCM_EVALIM, SCM_XEVAL,
1099 SCM_XEVALCAR): Deprecated. The macro definitions are moved from
e90c3a89
DH
1100 eval.h into eval.c and a copy (slightly modified to work in user
1101 code) is placed into deprecated.h.
1102
1103 * eval.c: Use the local static s_xxx definitions instead of the
1104 scm_s_xxx definitions throughout.
1105
14b18ed6
DH
11062003-06-01 Dirk Herrmann <D.Herrmann@tu-bs.de>
1107
1108 This set of patches separates the representation of the cxr family
1109 of functions (car, cdr etc.) from the dsubr family of functions
1110 (i. e. functions that take a double precision floating point
1111 argument). Further, the algorithm for handling the cxr function
1112 is improved.
1113
1114 * eval.c (SCM_CEVAL, SCM_APPLY, scm_trampoline_1), numbers.c
1115 (scm_asinh, scm_acosh, scm_atanh, scm_truncate, scm_round, floor,
1116 ceil, sqrt, fabs, exp, log, sin, cos, tan, asin, acos, atan, sinh,
1117 cosh, tanh), objects.c (scm_class_of), procprop.c
1118 (scm_i_procedure_arity), ramap.c (scm_array_map_x), tags.h
1119 (scm_tc7_dsubr, scm_tcs_subrs): Introduce scm_tc7_dsubr as new
1120 typecode for the dsubr family of functions.
1121
1122 * ramap.c (ramap_cxr, ramap_dsubr): Renamed ramap_cxr to
1123 ramap_dsubr.
1124
1125 * eval.c (SCM_CEVAL, SCM_APPLY, call_cxr_1), pairs.c
1126 (scm_init_pairs): Make use of the (now usable) second cell element
1127 of a scm_tc7_cxr function to implement the cxr family of functions
1128 more efficiently.
1129
2ca0d207
DH
11302003-05-31 Dirk Herrmann <D.Herrmann@tu-bs.de>
1131
1132 * eval.c (SCM_CEVAL, SCM_APPLY, scm_trampoline_0,
1133 scm_trampoline_1, scm_trampoline_2): Postpone error cases to the
1134 end of an if-else-if-sequence of checks.
1135
9a069bdd
DH
11362003-05-30 Dirk Herrmann <D.Herrmann@tu-bs.de>
1137
1138 * eval.c (SCM_CEVAL): Improved readability of call-with-values
1139 execution. Generalize apply_closure to apply_proc and use that
1140 for call-with-values.
1141
e910e9d2
DH
11422003-05-30 Dirk Herrmann <D.Herrmann@tu-bs.de>
1143
1144 * eval.c (SCM_CEVAL): Avoid one level of indirection when applying
1145 a non closure.
1146
1e498fbd
SJ
11472003-05-30 Stefan Jahn <stefan@lkcc.org>
1148
1149 * posix.c (s_scm_putenv): Use the new HAVE_UNSETENV
1150 appropriately for mingw32 hosts.
1151
1152 * numbers.h: Defining copysign(), isnan() and finite() to
1153 be prefixed by a single '_' for mingw32 hosts.
1154
c47e2599
KR
11552003-05-30 Kevin Ryde <user42@zip.com.au>
1156
1157 * numbers.c (z_negative_one): New variable.
1158 (scm_init_numbers): Initialize it.
1159 (scm_logcount): Use it and mpz_hamdist to count zeros for negatives.
1160
2e945bcc
SJ
11612003-05-29 Stefan Jahn <stefan@lkcc.org>
1162
1163 * win32-dirent.c: Use malloc() instead of scm_malloc().
1164
1165 * stime.c (s_scm_strftime): Add a type cast to avoid compiler
1166 warning.
1167
1168 * posix.c (s_scm_putenv): Disable use of unsetenv() for the
1169 mingw32 build.
1170
1171 * modules.c (s_scm_module_import_interface): Renamed local
1172 variable interface to _interface. Seems like 'interface'
1173 is a special compiler directive for the mingw32 compiler.
1174
1175 * mkstemp.c: Provide prototype to avoid compiler warning.
1176
1177 * load.c (s_scm_search_path): Fixed absolute and relative
1178 path detections for native Windows platforms.
1179
1180 * gc.h, threads.h: Export some more symbols using SCM_API (necessary
1181 to build on mingw32).
1182
1183 * gc-freelist.c ("s_scm_map_free_list",
1184 "s_scm_gc_set_debug_check_freelist_x"): Fixed use of FUNC_NAME.
1185
1186 * fports.c (fport_fill_input): Disable use of
1187 fport_wait_for_input() on Win32 platforms.
1188
1189 * filesys.c (s_scm_basename): Fixed __MINGW32__ code.
1190
1191 * Makefile.am: Modified some rules for cross compiling.
1192
ddd8f927
DH
11932003-05-25 Dirk Herrmann <D.Herrmann@tu-bs.de>
1194
1195 * eval.c (SCM_CEVAL): In case of an application, all checks for a
1196 proper function object and the correct number of arguments are now
1197 performed in the application part of SCM_CEVAL.
1198
1199 (scm_badformalsp): Removed.
1200
f8ba2197
DH
12012003-05-25 Dirk Herrmann <D.Herrmann@tu-bs.de>
1202
1203 * deprecated.c (scm_read_and_eval_x): Fixed C99-ism.
1204
79f55b7c
MD
12052003-05-22 Mikael Djurfeldt <djurfeldt@nada.kth.se>
1206
a502595f
MD
1207 * num2integral.i.c (NUM2INTEGRAL): Avoid warning about conditional
1208 always being false by inserting preprocessor conditional. (Thanks
1209 to Bruce Korb.)
1210
79f55b7c
MD
1211 * __scm.h (SCM_STACK_PTR): New macro. (Cast argument through
1212 (void *) in order to avoid an aliasing warning; thanks to Bruce
1213 Korb.)
1214
1215 * stackchk.h (SCM_STACK_OVERFLOW_P): Use SCM_STACK_PTR.
1216
1217 * threads.c (suspend, launch_thread, scm_threads_mark_stacks): Use
1218 SCM_STACK_PTR.
1219
1220 * threads.c (scm_threads_mark_stacks): Bugfix: Changed
1221 thread->base --> t->base.
1222
1223 * eval.c (SCM_CEVAL): Don't cast argument of SCM_STACK_OVERFLOW_P.
1224
47dee228
MV
12252003-05-20 Marius Vollmer <marius.vollmer@uni-dortmund.de>
1226
1227 * deprecated.h, deprecated.c (scm_makstr, scm_makfromstr,
1228 scm_variable_set_name_hint, scm_builtin_variable,
1229 scm_internal_with_fluids, scm_make_gsubr,
1230 scm_make_gsubr_with_generic, scm_create_hook, SCM_LIST0,
1231 SCM_LIST1, SCM_LIST2, SCM_LIST3, SCM_LIST4, SCM_LIST5, SCM_LIST6,
1232 SCM_LIST7, SCM_LIST8, SCM_LIST9, scm_listify, scm_sloppy_memq,
85494587
MV
1233 scm_sloppy_memv, scm_sloppy_member, scm_read_and_eval_x,
1234 scm_subr_entry, SCM_SUBR_DOC, scm_make_subr,
1235 scm_make_subr_with_generic, scm_make_subr_opt,
1236 scm_call_catching_errors, scm_make_smob_type_mfpe,
1237 scm_set_smob_mfpe, scm_strprint_obj, scm_read_0str, scm_eval_0str,
1238 SCM_CHARS, SCM_UCHARS, SCM_LENGTH): Re-added from the release_1_6
1239 branch. Some have been slightly rewritten.
1240 (scm_i_object_chars, scm_i_object_length): New, to support
1241 SCM_CHARS, SCM_UCHARS, and SCM_LENTH.
1242
e681d187
DH
12432003-05-19 Dirk Herrmann <D.Herrmann@tu-bs.de>
1244
1245 * eval.c (scm_m_do, unmemocopy, SCM_CEVAL): Reversed order of
1246 names and inits in the memoized code of do.
1247
7e59d9d4
MD
12482003-05-19 Mikael Djurfeldt <djurfeldt@nada.kth.se>
1249
1250 * c-tokenize.lex (yyget_lineno, yyget_in, yyget_out, yyget_leng,
1251 yyget_text, yyset_lineno, yyset_in, yyset_out, yyget_debug,
1252 yyset_debug, yylex_destroy): Added prototypes (otherwise we'll get
1253 a compilation error if error-on-warning is enabled).
1254
9950a42c
MV
12552003-05-17 Marius Vollmer <mvo@zagadka.de>
1256
1257 * c-tokenize.lex: Gobble up complete lines after a '#'. This
1258 removes preprocessor directives from the snarfage that might
1259 otherwise confuse us. These directives appear when compiling with
1260 "-g3", for example.
1261
0068984b
HWN
12622003-05-16 Han-Wen Nienhuys <hanwen@cs.uu.nl>
1263
26e68795
HWN
1264 * ChangeLog: add my surname
1265
0068984b
HWN
1266 * srcprop.c (scm_finish_srcprop): use
1267 scm_gc_register_collectable_memory()
1268 (scm_make_srcprops): idem.
1269
131805f0
HWN
12702003-05-14 Han-Wen Nienhuys <hanwen@cs.uu.nl>
1271
1272 * gc-malloc.c (scm_gc_register_collectable_memory): avoid
1273 wrap-around for scm_mtrigger
1274 (scm_gc_register_collectable_memory): abort on overflowing
1275 scm_mallocated().
1276
d4611024
KR
12772003-05-13 Kevin Ryde <user42@zip.com.au>
1278
1279 * numbers.c (xmpz_cmp_d): New macro, handling infs if gmp doesn't.
1280 (scm_num_eq_p, scm_less_p, scm_max, scm_min): Use it.
1281
7aaf8dc9
MD
12822003-05-12 Mikael Djurfeldt <djurfeldt@nada.kth.se>
1283
dfd03fb9
MD
1284 * backtrace.c (scm_display_error_message): Introduced fancy
1285 printing with max level 7 and length 10. (Purpose: avoid printing
1286 gigantic objects in error messages.)
1287
1288 * print.c, print.h (scm_i_port_with_print_state): New function.
1289
1290 * print.c (scm_iprin1, scm_printer_apply,
1291 scm_port_with_print_state): Use scm_i_port_with_print_state.
1292 (scm_simple_format): Modified not to destroy print states.
1293 (print_state_mutex): New mutex.
1294 (scm_make_print_state, scm_free_print_state, scm_prin1):
1295 Lock/unlock print_state_mutex.
1296
7aaf8dc9
MD
1297 * deprecated.h (SCM_GC8MARKP, SCM_SETGC8MARK, SCM_CLRGC8MARK):
1298 Use current names in definitions.
1299
a4d9ffa1
KR
13002003-05-10 Kevin Ryde <user42@zip.com.au>
1301
1302 * numbers.c (scm_num_eq_p, scm_less_p): Don't pass NaN to mpz_cmp_d.
1303
d25e96a4
KR
1304 * numbers.c (scm_integer_length): On negative bignums, adjust
1305 mpz_sizeinbase to account for it looking at absolute value where we
1306 want ones-complement.
1307
1308 * numbers.c (scm_gcd): In bignum/inum, don't pass yy==0 to mpz_gcd_ui
1309 since we're only using the ulong return value, and x might not fit.
1310
5bf6a6f0
DH
13112003-05-06 Dirk Herrmann <D.Herrmann@tu-bs.de>
1312
1313 * eval.c, eval.h, read.c, read.h (scm_sym_dot): Moved from eval to
1314 read. This will allow to make the definition in read.c static.
1315
f58c472a
DH
13162003-05-06 Dirk Herrmann <D.Herrmann@tu-bs.de>
1317
1318 * eval.c, eval.h, evalext.c, evalext.h (scm_m_undefine): Moved
1319 from evalext to eval. This will allow to make some of the
1320 definitions in eval.c static.
1321
90382aeb
KR
13222003-05-06 Kevin Ryde <user42@zip.com.au>
1323
1324 * numbers.c (scm_difference): In inum - bignum, handle negative inum.
1325 (scm_logcount): Use mpz_com, not mpz_neg.
1326
3b88ed2a
DH
13272003-05-04 Dirk Herrmann <D.Herrmann@tu-bs.de>
1328
1329 The purpose of this patch is to make guile's internal memoizers
1330 distinguishable from memoizing macros created on the scheme level
1331 or from user provided primitive memoizing macros. The reason is,
1332 that the internal memoizers are the only ones that are allowed to
1333 transform their scheme input into memoizer byte code, while all
1334 other memoizing macros may only transform scheme code into new
1335 scheme code.
1336
1337 To achieve this, a new macro type 'builtin-macro!' is introduced.
1338 Currently, 'builtin-macro!'s are handled as memoizing macros, but
1339 this will change when the memoizer and executor are separated.
1340
1341 * macros.[ch] (scm_i_makbimacro): New.
1342
1343 * macros.h (SCM_BUILTIN_MACRO_P): New.
1344
1345 * macros.c (macro_print, scm_macro_type): Support builtin-macro!s.
1346
1347 * eval.c, goops.c: All of guile's primitive memoizing macros are
1348 primitive builtin-macros now.
1349
1350 * eval.c (scm_macroexp, SCM_CEVAL): Make sure the primitive
1351 builtin-macros are handled equally to memoizing macros.
1352
b0780eb1
MV
13532003-05-04 Marius Vollmer <mvo@zagadka.de>
1354
1355 * throw.c (scm_ithrow): Remove "asm volatile" hack. It used to
1356 work around a bug in GCC 2.95.2 but is now a bug in itself.
1357
1cbf4fe9
MV
13582003-05-02 Marius Vollmer <mvo@zagadka.de>
1359
1360 * deprecated.h (scm_rstate, scm_rng, SCM_SLOPPY_CONSP,
1361 SCM_SLOPPY_NCONSP, scm_tc7_ssymbol, scm_tc7_msymbol,
1362 scm_tcs_symbols): New.
1363
1a61d41b
MV
13642003-04-30 Marius Vollmer <marius.vollmer@uni-dortmund.de>
1365
096ecbaf
MV
1366 * deprecated.h, deprecated.c (scm_protect_object,
1367 scm_unprotect_object, SCM_SETAND_CAR, SCM_SETOR_CAR,
1368 SCM_SET_AND_CDR, SCM_SET_OR_CDR, SCM_FREEP, SCM_NFREEP,
1369 SCM_GC8MARKP, SCM_SETGC8MARK, SCM_CLRGC8MARK, SCM_GCTYP16,
1370 SCM_GCCDR, scm_remember, scm_the_root_module, scm_make_module,
1371 scm_ensure_user_module, scm_load_scheme_module, scm_port,
1372 scm_ptob_descriptor, scm_port_rw_active,
1373 scm_close_all_ports_except): New.
1374
1a61d41b
MV
1375 * ports.c (scm_c_port_for_each): New function, mostly copied from
1376 scm_port_for_each.
1377 (scm_port_for_each): Reimplemented using scm_c_port_for_each.
1378 * ports.h (scm_c_port_for_each): New prototype.
1379
c8e1d354
MD
13802003-04-28 Mikael Djurfeldt <djurfeldt@nada.kth.se>
1381
1382 * eval.c (scm_m_atdispatch): Removed until actually needed. (This
1383 macro was introduced in anticipation of GOOPS method compilation
1384 code.)
1385
1386 * goops.c: Removed binding of @dispatch.
1387
a4aa2134
DH
13882003-04-28 Dirk Herrmann <D.Herrmann@tu-bs.de>
1389
1390 * eval.c, goops.c (@dispatch, @slot-ref, @slot-set!): Move the
1391 instructions that bind the macros on the scheme level back to
1392 goops.c in order to make sure again that the bindings go into the
1393 (oop goops) module and are not visible from the outside.
1394
9fbee57e
DH
13952003-04-27 Dirk Herrmann <D.Herrmann@tu-bs.de>
1396
1397 * eval.c: Non functional change: Separated R5RS and non-R5RS
1398 macros into different sections of the file and ordered the
1399 memoizers alphabetically.
1400
12841895
DH
14012003-04-27 Dirk Herrmann <D.Herrmann@tu-bs.de>
1402
1403 * eval.c (scm_ilookup): Rewritten to improve readability.
1404
6a3f13f0
DH
14052003-04-27 Dirk Herrmann <D.Herrmann@tu-bs.de>
1406
1407 * eval.c (scm_i_call_closure_0, call_closure_1, call_closure_2):
1408 Partially reverted patch from 2003-04-23 in oder to find a better
1409 compromise between readability and debuggability.
1410
b0c5d67b
DH
14112003-04-25 Dirk Herrmann <D.Herrmann@tu-bs.de>
1412
1413 * eval.c, eval.h, goops.c, goops.h (scm_m_atslot_ref,
1414 scm_m_atslot_set_x, scm_m_atdispatch): Move the declarations and
1415 definitions of the special goops memoizers from goops.[ch] to
1416 eval.[ch]. Hmm... it seems that scm_m_atdispatch is not used
1417 throughout guile.
1418
b9ad392e
MD
14192003-04-24 Mikael Djurfeldt <mdj@kvast.blakulla.net>
1420
1421 * ports.c, ports.h (scm_i_port_table_mutex): New mutex.
1422
1423 * fports.c (scm_evict_ports): Lock/unlock scm_i_port_table_mutex.
1424
1425 * ports.c (scm_close_port, scm_flush_all_ports): Ditto.
1426
1427 * ioext.c (scm_fdes_to_ports): Ditto.
1428
1429 * vports.c (scm_make_soft_port): Changed SCM_DEFER/ALLOW_INTS into
1430 lock/unlock scm_i_port_table_mutex.
1431
1432 * strports.c (scm_mkstrport): Ditto.
1433
1434 * ports.c (scm_void_port, scm_port_for_each): Ditto.
1435
1436 * fports.c (scm_fdes_to_port): Ditto.
1437
d0b07b5d
DH
14382003-04-23 Dirk Herrmann <D.Herrmann@tu-bs.de>
1439
1440 This set of patches contains no functional changes, only debatable
1441 minor stylistic ones. Still, in order to prepare a patch between
1442 my local copy and the CVS version, I decided to submit the changes
1443 below. Then, the patch will hopefully only contain relevant
1444 modifications :-)
1445
1446 * eval.c (iqq): Added const specifier.
1447
1448 * eval.c (scm_trampoline_0, scm_trampoline_1, scm_trampoline_2):
1449 Use NULL instead of 0 to indicate that a pointer is returned.
1450 Removed some misleading 'fall through' comments.
1451
1452 * eval.c (scm_i_call_closure_0, call_closure_1, call_closure_2):
1453 Split up long expressions into smaller ones to be more debugging
1454 friendly.
1455
a98e8e98
DH
14562003-04-23 Dirk Herrmann <D.Herrmann@tu-bs.de>
1457
1458 * eval.h (SCM_ENTER_FRAME_HDLR, SCM_APPLY_FRAME_HDLR,
1459 SCM_EXIT_FRAME_HDLR): Use SCM_PACK to convert data to a SCM value
1460 rather than casting to SCM.
1461
c178c3a6
DH
14622003-04-23 Dirk Herrmann <D.Herrmann@tu-bs.de>
1463
1464 * sort.c, pairs.h: Removed unnecessary includes.
1465
d339981a
DH
14662003-04-23 Dirk Herrmann <D.Herrmann@tu-bs.de>
1467
1468 * sort.c: Replaced hand-made trampline code by the new official
1469 mechanism from eval.c. This fixes a segfault in the new test file
1470 sort.test.
1471
1472 (quicksort, compare_function, scm_restricted_vector_sort_x,
1473 scm_sorted_p, scm_merge, scm_merge_list_x, scm_merge_x,
1474 scm_merge_list_step, scm_sort_x, scm_sort, scm_merge_vector_x,
1475 scm_merge_vector_step, scm_stable_sort_x, scm_stable_sort,
1476 scm_sort_list_x, scm_sort_list): Use trampoline mechanism from
1477 eval.c.
1478
1479 (subr2less, lsubrless, closureless, applyless, scm_cmp_function,
1480 cmp_fun_t): Removed.
1481
1482 (compare_function): Added.
1483
1484 * sort.c (quicksort, SWAP, stack_node): Replaced pointer
1485 arithmetics with index arithmetics. Changed quicksort to work on
1486 an array of SCM values instead of an array of characters. Avoid
1487 bytewise copying of SCM elements. Avoid allocating memory on the
1488 stack with alloca. Fixed some comments.
1489
821f18a4
DH
14902003-04-21 Dirk Herrmann <D.Herrmann@tu-bs.de>
1491
1492 * eval.c (EXTEND_ENV): Eliminated.
1493
1494 (unmemocopy, SCM_CEVAL, SCM_APPLY): Use SCM_EXTEND_ENV instead of
1495 EXTEND_ENV.
1496
94fb5a6e
DH
14972003-04-21 Dirk Herrmann <D.Herrmann@tu-bs.de>
1498
1499 * __scm.h (SCM_DEBUG_DEBUGGER_SUPPORT): New compile-time option.
1500
1501 * gc.card.c (scm_gc_marked_p): Fixed compiler warning when
1502 compiling with SCM_DEBUG==1 by moving definition behind prototype.
1503
1504 * gc.card.c (scm_dbg_t_list_cell, scm_dbg_t_double_cell,
1505 scm_dbg_gc_marked_p, scm_dbg_gc_get_card, scm_dbg_gc_get_bvec,
1506 scm_t_list_cell_struct, scm_t_list_cell, scm_t_double_cell,
1507 scm_gc_marked_p, scm_gc_get_card, scm_gc_get_bvec): Fixed
1508 functions such that they check if the object is a non-immediate.
1509 Further, renamed identifiers to use the scm_dbg_ prefix and made
1510 their inclusion into the lib dependent of the
1511 SCM_DEBUG_DEBUGGER_SUPPORT compile time option.
1512
fce0b22d
DH
15132003-04-21 Dirk Herrmann <D.Herrmann@tu-bs.de>
1514
1515 * __scm.h: Fixed comment about the SCM_DEBUG_TYPING_STRICTNESS
1516 debug option.
1517
1685446c
DH
15182003-04-21 Dirk Herrmann <D.Herrmann@tu-bs.de>
1519
821f18a4 1520 * list.c (scm_ilength, scm_last_pair), unif.c (l2ra): Prefer
1685446c
DH
1521 !SCM_CONSP over SCM_NCONSP. Now, guile itself does not include
1522 any calls to SCM_NCONSP any more.
1523
1524 * unif.c (l2ra): Eliminate redundant check.
1525
9ff1720f
DH
15262003-04-21 Dirk Herrmann <D.Herrmann@tu-bs.de>
1527
1528 * list.c (scm_cons_star), ramap.c (scm_ra_sum, scm_ra_product,
1529 scm_array_map_x), unif.c (l2ra): Prefer !SCM_NULLP over
1530 SCM_NNULLP. Now, guile itself does not include any calls to
1531 SCM_NNULLP any more.
1532
05b15362
DH
15332003-04-21 Dirk Herrmann <D.Herrmann@tu-bs.de>
1534
1535 * eval.c (unmemocopy, SCM_APPLY, scm_map, scm_for_each,
1536 scm_copy_tree): Place assignment expressions which are part of
1537 other expressions into an expression of their own.
1538
0c88d7df
DH
15392003-04-21 Dirk Herrmann <D.Herrmann@tu-bs.de>
1540
1541 * goops.c (TEST_CHANGE_CLASS, scm_sys_initialize_object): Don't
1542 compare SCM values with !=.
1543
5cb22e96
DH
15442003-04-20 Dirk Herrmann <D.Herrmann@tu-bs.de>
1545
1546 * eval.c, eval.h, evalext.c, evalext.h (scm_sym_setter,
1547 scm_m_generalized_set_x, scm_init_evalext): Move the declaration
1548 and definition of the memoizer for the generalized set! macro from
1549 evalext.[ch] to eval.[ch]. Use the SCM_SYNTAX snarfer macro to
1550 define the macro object.
1551
1552 * eval.c, eval.h (s_set_x, scm_s_set_x, scm_m_set_x,
1553 scm_m_generalized_set_x): Since now scm_s_set_x is only used in
1554 eval.c, it is made static and renamed to s_set_x.
1555
1556 * evalext.c (scm_defined_p, scm_m_undefine): Prefer !SCM_<foo>
1557 over SCM_N<foo>.
1558
a44a9715
DH
15592003-04-20 Dirk Herrmann <D.Herrmann@tu-bs.de>
1560
1561 * eval.c, root.h (scm_undefineds, SCM_NUM_PROTECTS, undefineds,
1562 scm_init_eval): Made scm_undefineds static in eval.c, renamed it
1563 to undefineds and registered the object as a permanent object.
1564
1565 * eval.c, eval.h (scm_f_apply, scm_init_eval): Made scm_f_apply
1566 static in eval.c, renamed it to f_apply and registered the object
1567 as a permanent object.
1568
1b43d24c
DH
15692003-04-20 Dirk Herrmann <D.Herrmann@tu-bs.de>
1570
5cb22e96 1571 * eval.c (SCM_BIT7, SCM_BIT8, unmemocopy, SCM_CEVAL): Renamed
1b43d24c
DH
1572 file-local macro SCM_BIT8 to SCM_BIT7, which is more appropriate.
1573
aec16f99
DH
15742003-04-20 Dirk Herrmann <D.Herrmann@tu-bs.de>
1575
1576 * numbers.c (scm_logtest): Fixed argument bug in the call to
1577 mpz_and, which showed up when compiling with SCM_DEBUG defined.
1578
f96460ce
DH
15792003-04-20 Dirk Herrmann <D.Herrmann@tu-bs.de>
1580
1581 * gc-card.c (scm_i_sweep_card, scm_i_init_card_freelist): Fixed
1582 type errors that showed up when compiling with SCM_DEBUG defined.
1583
d0f6ceb8
DH
15842003-04-20 Dirk Herrmann <D.Herrmann@tu-bs.de>
1585
1586 * continuations.c, continuations.h, eval.c, eval.h, extensions.c,
1587 gsubr.c, guile.c, init.c, read.c, root.c, root.h, stackchk.h,
1588 throw.c: Removed uses of DEBUG_EXTENSIONS and DYNAMIC_LINKING to
1589 fix compile errors with --disable-deprecated.
1590
19a7a089
RB
15912003-04-17 Rob Browning <rlb@defaultvalue.org>
1592
1593 * numbers.c (scm_integer_expt): fix case where we were declaring
1594 vars in the middle of a statement block. Thanks to Thamer
1595 Al-Harbash.
1596
47cd67db
MD
15972003-04-17 Mikael Djurfeldt <djurfeldt@nada.kth.se>
1598
0fd7dcd3
MD
1599 * goops.c (TEST_CHANGE_CLASS): Update variable class after class
1600 change.
1601
47cd67db
MD
1602 * eq.c (scm_eqv_p): Turned into a primitive generic.
1603
3b8b889c
RB
16042003-04-16 Rob Browning <rlb@defaultvalue.org>
1605
312006bb
RB
1606 * gc_os_dep.c: Added patch for UnixWare and OpenUNIX support.
1607 Thanks to Boyd Gerber.
1608 Added check for __arm__ in addition to arm for LINUX and copied
1609 __s390__ defines from upstream libgc. Thanks to James Treacy for
1610 reporting the problems.
c7ef2ea1 1611
3b8b889c
RB
1612 * numbers.c (PTRDIFF_MIN): use SCM_CHAR_BIT.
1613
1614 * socket.c: use SCM_CHAR_BIT.
1615
1616 * random.c (scm_c_random_bignum): use SCM_CHAR_BIT.
1617
1618 * num2integral.i.c (NUM2INTEGRAL): use SCM_CHAR_BIT.
1619
43261b39
MD
16202003-04-16 Mikael Djurfeldt <mdj@kvast.blakulla.net>
1621
1622 * feature.c (scm_init_feature): Always add threads feature.
1623
58241edc
MD
16242003-04-15 Mikael Djurfeldt <djurfeldt@nada.kth.se>
1625
1626 * goops.c (scm_sys_fast_slot_ref): Use SCM_SLOT instead of
1627 scm_at_assert_bound_ref. (We don't want the unbound check. See
1628 oop/goops/active-slot.scm.)
1629
94e91275
RB
16302003-04-14 Rob Browning <rlb@defaultvalue.org>
1631
1632 * tags.h: scm_t_intptr should have been intptr_t.
1633
3071ea27
RB
16342003-04-13 Rob Browning <rlb@defaultvalue.org>
1635
1636 * __scm.h (SCM_FLUSH_REGISTER_WINDOWS): don't just rely on "sparc"
1637 test. Instead use
1638 #if defined (sparc) || defined (__sparc__) || defined (__sparc)
1639 as gc_os_dep.c suggests is appropriate.
1640
1641 * goops.c (prep_hashsets): make static to match prototype.
1642 (scm_sym_args): SCM_SYMBOL -> SCM_GLOBAL_SYMBOL. Thanks to Albert
1643 Chin.
1644
1645 * c-tokenize.lex: remove trailing comma from enum. Thanks to
1646 Albert Chin.
1647
1648 * gc_os_dep.c: add NetBSD powerpc config info. Thanks to Thomas
1649 Klausner.
1650
21ab2aeb
MD
16512003-04-13 Mikael Djurfeldt <djurfeldt@nada.kth.se>
1652
1653 * goops.c (scm_sys_prep_layout_x): Instance allocation is now
1654 indicated through extra fields in getters-n-setters.
1655 (scm_add_slot): Adapted to new format of getters_n_setters slot.
1656 (Thanks to Andy Wingo.)
1657
dff96e95
HWN
16582003-02-25 Han-Wen Nienhuys <hanwen@cs.uu.nl>
1659
1660 * gc-segment.c: add comment
1661
07921c76
RB
16622003-04-07 Rob Browning <rlb@defaultvalue.org>
1663
b5331f10
RB
1664 * debug.h: change "id" arg name to "info_id" to avoid objective-c
1665 clash.
1666
07921c76
RB
1667 * num2integral.i.c (NUM2INTEGRAL): fix bug pointed out by Mikael
1668 and add regression test to standalone/.
1669
16702003-04-06 Rob Browning <rlb@defaultvalue.org>
1671
1672 * strings.c (scm_mem2string): use memcpy rather than by-hand loop.
1673 Thanks to Dale P. Smith.
1674
1675 * random.c: #include gmp.h.
1676 (scm_c_random_bignum): normalize result on return.
1677
1678 * init.c: #include gmp.h.
1679
1680 * numbers.h: remove the gmp.h #include (not needed now).
1681
1682 * posix.h: change occurences of "id" to something else so we don't
1683 cause trouble when included via objective-c (can't hurt, might
1684 help). Still have usage in debug.h, though.
1685
938f6b7c
MD
16862003-04-06 Mikael Djurfeldt <djurfeldt@nada.kth.se>
1687
372691d8
MD
1688 * random.c (scm_c_random_bignum): Don't generate a random number
1689 equal to m (the second argument of scm_c_random_bignum); only
1690 generate numbers in the range 0 <= r < m.
c5f268f8
MD
1691 (scm_c_default_rstate): Use SCM_VARIABLE_REF to access
1692 scm_var_random_state.
372691d8 1693
938f6b7c
MD
1694 * num2integral.i.c (INTEGRAL2BIG): Put negation of n inside then
1695 clause.
1696
6cdb8c3f
RB
16972003-04-05 Rob Browning <rlb@defaultvalue.org>
1698
938f6b7c 1699 * modules.c (scm_module_import_interface): move declaration of
6cdb8c3f
RB
1700 uses before any code.
1701
15635be5
MD
17022003-04-05 Mikael Djurfeldt <djurfeldt@nada.kth.se>
1703
1ecfd013
MD
1704 * Makefile.am (scmconfig.h): Look for config.h in top_builddir,
1705 not top_srcdir.
1706
15635be5
MD
1707 * hashtab.c (rehash_after_gc): Clear to_rehash list before
1708 processing it in order to avoid an infinite loop.
1709
1710 * print.c (scm_prin1): Remember old state of pstate->writingp.
1711
73be1d9e
MV
17122003-04-05 Marius Vollmer <mvo@zagadka.de>
1713
1714 * Changed license terms to the plain LGPL thru-out.
1715
ad815c06
RB
17162003-04-04 Rob Browning <rlb@defaultvalue.org>
1717
1718 * socket.c (FLIPCPY_NET_HOST_128): new macro.
1719 (ipv6_net_to_num, ipv6_num_to_net, bignum_in_ipv6_range_p):
1720 rewrite to handle GMP bignums.
1721
1722
1723 * random.c (scm_c_random_bignum): rewrite to handle GMP bignums.
1724
1725 * ports.c (scm_getc): minor tweak.
1726
1727 * numbers.h: remove SCM_BIGDIG conditionals, reorganize, and
1728 rewrite to handle GMP bignums.
1729
1730 * numbers.c: rewrite *many* functions to handle GMP bignums.
1731
1732 * num2integral.i.c (NUM2INTEGRAL, INTEGRAL2NUM, INTEGRAL2BIG):
1733 handle GMP bignums.
1734
1735 * num2float.i.c (NUM2FLOAT): handle GMP bignums.
1736
1737 * init.c (check_config): remove SCM_BIGDIG conditionals.
1738 (scm_init_guile_1): test to make sure mpz_t fits in a double_cell.
1739
1740 * gc-card.c ("sweep_card"): handle new mpz_t bignums.
1741
1742 * eval.c: remove SCM_BIGDIG conditionals.
1743
1744 * eq.c (s_scm_eqv_p): scm_i_bigcomp -> scm_i_bigcmp.
1745
6cdb8c3f
RB
17462003-03-31 Rob Browning <rlb@defaultvalue.org>
1747
1748 * Makefile.am (scmconfig.h): change srcdir to builddir. (Thanks
1749 to Kevin Ryde.)
1750
17512003-03-27 Rob Browning <rlb@defaultvalue.org>
1752
1753 * threads.h: fix various preprocessor usages of new public
1754 symbols to expect 0 or 1 values rather than 1 or undefined.
1755 i.e. change #ifdef to #if, etc.
1756
1757 * threads.c: fix various preprocessor usages of new public
1758 symbols to expect 0 or 1 values rather than 1 or undefined.
1759 i.e. change #ifdef to #if, etc.
1760
1761 * tags.h: fix various preprocessor usages of new public
1762 symbols to expect 0 or 1 values rather than 1 or undefined.
1763 i.e. change #ifdef to #if, etc.
1764
1765 * stacks.c: fix various preprocessor usages of new public
1766 symbols to expect 0 or 1 values rather than 1 or undefined.
1767 i.e. change #ifdef to #if, etc.
1768
1769 * stackchk.h: fix various preprocessor usages of new public
1770 symbols to expect 0 or 1 values rather than 1 or undefined.
1771 i.e. change #ifdef to #if, etc.
1772
1773 * stackchk.c: fix various preprocessor usages of new public
1774 symbols to expect 0 or 1 values rather than 1 or undefined.
1775 i.e. change #ifdef to #if, etc.
1776
1777 * sort.c: fix various preprocessor usages of new public
1778 symbols to expect 0 or 1 values rather than 1 or undefined.
1779 i.e. change #ifdef to #if, etc.
1780
1781 * read.c: fix various preprocessor usages of new public
1782 symbols to expect 0 or 1 values rather than 1 or undefined.
1783 i.e. change #ifdef to #if, etc.
1784
1785 * random.c: fix various preprocessor usages of new public
1786 symbols to expect 0 or 1 values rather than 1 or undefined.
1787 i.e. change #ifdef to #if, etc.
1788
1789 * print.c: fix various preprocessor usages of new public
1790 symbols to expect 0 or 1 values rather than 1 or undefined.
1791 i.e. change #ifdef to #if, etc.
1792
1793 * objects.c: fix various preprocessor usages of new public
1794 symbols to expect 0 or 1 values rather than 1 or undefined.
1795 i.e. change #ifdef to #if, etc.
1796
1797 * numbers.h: fix various preprocessor usages of new public
1798 symbols to expect 0 or 1 values rather than 1 or undefined.
1799 i.e. change #ifdef to #if, etc.
1800
1801 * null-threads.c: fix various preprocessor usages of new public
1802 symbols to expect 0 or 1 values rather than 1 or undefined.
1803 i.e. change #ifdef to #if, etc.
1804
1805 * lang.c: fix various preprocessor usages of new public
1806 symbols to expect 0 or 1 values rather than 1 or undefined.
1807 i.e. change #ifdef to #if, etc.
1808
1809 * lang.h: fix various preprocessor usages of new public
1810 symbols to expect 0 or 1 values rather than 1 or undefined.
1811 i.e. change #ifdef to #if, etc.
1812
1813 * iselect.h: fix various preprocessor usages of new public
1814 symbols to expect 0 or 1 values rather than 1 or undefined.
1815 i.e. change #ifdef to #if, etc.
1816
1817 * init.c: fix various preprocessor usages of new public
1818 symbols to expect 0 or 1 values rather than 1 or undefined.
1819 i.e. change #ifdef to #if, etc.
1820
1821 * gh_data.c: fix various preprocessor usages of new public
1822 symbols to expect 0 or 1 values rather than 1 or undefined.
1823 i.e. change #ifdef to #if, etc.
1824
1825 * gh.h: fix various preprocessor usages of new public
1826 symbols to expect 0 or 1 values rather than 1 or undefined.
1827 i.e. change #ifdef to #if, etc.
1828
1829 * gen-scmconfig.c: change most new public symbols to be defined to
1830 0 or 1 rather than being either 1 or undefined.
1831
1832 * gc_os_dep.c: fix various preprocessor usages of new public
1833 symbols to expect 0 or 1 values rather than 1 or undefined.
1834 i.e. change #ifdef to #if, etc.
1835 (STACK_GROWS_DOWN): define to 0 or 1 rather than 1 or undef.
1836
1837 * gc.h: fix various preprocessor usages of new public
1838 symbols to expect 0 or 1 values rather than 1 or undefined.
1839 i.e. change #ifdef to #if, etc.
1840
1841 * gc-card.c: fix various preprocessor usages of new public
1842 symbols to expect 0 or 1 values rather than 1 or undefined.
1843 i.e. change #ifdef to #if, etc.
1844
1845 * gc-mark.c: fix various preprocessor usages of new public
1846 symbols to expect 0 or 1 values rather than 1 or undefined.
1847 i.e. change #ifdef to #if, etc.
1848
1849 * feature.c: fix various preprocessor usages of new public
1850 symbols to expect 0 or 1 values rather than 1 or undefined.
1851 i.e. change #ifdef to #if, etc.
1852
1853 * evalext.c: fix various preprocessor usages of new public
1854 symbols to expect 0 or 1 values rather than 1 or undefined.
1855 i.e. change #ifdef to #if, etc.
1856
1857 * eval.h: fix various preprocessor usages of new public
1858 symbols to expect 0 or 1 values rather than 1 or undefined.
1859 i.e. change #ifdef to #if, etc.
1860
1861 * eval.c: fix various preprocessor usages of new public
1862 symbols to expect 0 or 1 values rather than 1 or undefined.
1863 i.e. change #ifdef to #if, etc.
1864
1865 * eq.c: fix various preprocessor usages of new public
1866 symbols to expect 0 or 1 values rather than 1 or undefined.
1867 i.e. change #ifdef to #if, etc.
1868
1869 * coop.c: fix various preprocessor usages of new public
1870 symbols to expect 0 or 1 values rather than 1 or undefined.
1871 i.e. change #ifdef to #if, etc.
1872
1873 * coop-threads.c: fix various preprocessor usages of new public
1874 symbols to expect 0 or 1 values rather than 1 or undefined.
1875 i.e. change #ifdef to #if, etc.
1876
1877 * coop-pthreads.c: fix various preprocessor usages of new public
1878 symbols to expect 0 or 1 values rather than 1 or undefined.
1879 i.e. change #ifdef to #if, etc.
1880
1881 * coop-defs.h: fix various preprocessor usages of new public
1882 symbols to expect 0 or 1 values rather than 1 or undefined.
1883 i.e. change #ifdef to #if, etc.
1884
1885 * convert.i.c: fix various preprocessor usages of new public
1886 symbols to expect 0 or 1 values rather than 1 or undefined.
1887 i.e. change #ifdef to #if, etc.
1888
1889 * continuations.c: fix various preprocessor usages of new public
1890 symbols to expect 0 or 1 values rather than 1 or undefined.
1891 i.e. change #ifdef to #if, etc.
1892
1893 * _scm.h: fix various preprocessor usages of new public symbols to
1894 expect 0 or 1 values rather than 1 or undefined. i.e. change
1895 #ifdef to #if, etc.
1896
d11d697a
MV
18972003-03-26 Marius Vollmer <marius.vollmer@uni-dortmund.de>
1898
9686f86d
MV
1899 * init.c (scm_init_guile_1): Call scm_i_init_deprecated.
1900
1901 * deprecated.c, deprecated.h: New files, to collect deprecated
1902 things in one place.
1903 * Makefile.am: Added them in all the right places.
1904
d11d697a
MV
1905 * Makefile.am (EXTRA_DIST): Added "scmconfig.h.top".
1906 (scmconfig.h): Get "scmconfig.h.top" from $(srcdir) so that VPATH
1907 builds work.
9686f86d
MV
1908 (DOT_X_FILES): Removed "iselect.x".
1909 (DOT_DOC_FILES): Removed "iselect.doc".
d11d697a 1910
e3c0c3b9
RB
19112003-03-25 Rob Browning <rlb@defaultvalue.org>
1912
1913 * win32-socket.h: #include "libguile/__scm.h". Replace usage of
1914 HAVE_WINSOCK2_H with SCM_HAVE_WINSOCK2_H.
1915
1916 * win32-socket.c: #include <config.h> if HAVE_CONFIG_H.
1917
1918 * vports.c: #include <config.h> if HAVE_CONFIG_H.
1919
1920 * unif.c: #include <config.h> if HAVE_CONFIG_H. Replace usage of
1921 HAVE_LONG_LONGS with "SCM_SIZEOF_LONG_LONG != 0".
1922
1923 * threads.h: replace usage of struct timespect with
1924 scm_t_timespec. Replace usage of USE_PTHREAD_THREADS with
1925 SCM_USE_PTHREAD_THREADS. Remove typedef for struct timespec in
1926 favor of scm_t_timespec from scmconfig.h.
1927
1928 * threads.c: move libguile/_scm.h include to the top so we pick up
1929 any critical defines like _GNU_SOURCE early. Replace usage of
1930 struct timespect with scm_t_timespec. Replace usage of
1931 STACK_GROWS_UP with SCM_STACK_GROWS_UP. Replace usage of
1932 USE_PTHREAD_THREADS with SCM_USE_PTHREAD_THREADS.
1933
1934 * threads-plugin.h: replace usage of struct timespect with
1935 scm_t_timespec.
1936
1937 * threads-plugin.c: #include <config.h> if HAVE_CONFIG_H. Replace
1938 usage of struct timespect with scm_t_timespec.
1939
1940 * tags.h: move HAVE_STDINT_H handling to scmconfig.h. Move
1941 HAVE_INTTYPES_H handling to scmconfig.h. #include
1942 "libguile/__scm.h". Rework handling for scm_t_bits,
1943 scm_t_signed_bits, SCM_T_BITS_MAX, SCM_T_SIGNED_BITS_MAX,
1944 SCM_T_SIGNED_BITS_MIN, and SIZEOF_SCM_T_BITS to use scm_t_intptr,
1945 scm_t_uintptr, SCM_SIZEOF_INTPTR_T, and SCM_SIZEOF_UINTPTR_T, and
1946 SCM_SIZEOF_UNSIGNED_LONG. Rename usage of HAVE_ARRAYS to
1947 SCM_HAVE_ARRAYS.
1948
1949 * symbols.c: #include <config.h> if HAVE_CONFIG_H.
1950
1951 * struct.c: #include <config.h> if HAVE_CONFIG_H.
1952
1953 * strports.c: #include <config.h> if HAVE_CONFIG_H.
1954
1955 * strop.c: #include <config.h> if HAVE_CONFIG_H.
1956
1957 * stime.h: move handling of time related headers to scmconfig.h.
1958
1959 * stime.c: #include <config.h> if HAVE_CONFIG_H.
1960
1961 * stacks.c: replace usage of STACK_GROWS_UP with
1962 SCM_STACK_GROWS_UP.
1963
1964 * sort.c: #include <config.h> if HAVE_CONFIG_H. Rename usage of
1965 HAVE_ARRAYS to SCM_HAVE_ARRAYS.
1966
1967 * socket.c: #include <config.h> if HAVE_CONFIG_H. Replace usage
1968 of uint32 and HAVE_UINT_32 with scm_t_int32.
1969
1970 * smob.c: #include <config.h> if HAVE_CONFIG_H.
1971
1972 * simpos.c: #include <config.h> if HAVE_CONFIG_H.
1973
1974 * script.c: #include <config.h> if HAVE_CONFIG_H.
1975
1976 * scmsigs.c: #include <config.h> if HAVE_CONFIG_H.
1977
1978 * scmconfig.h.top: new file -- preamble for scmconfig.h.
1979
1980 * rw.c: #include <config.h> if HAVE_CONFIG_H.
1981
1982 * regex-posix.c: #include <config.h> if HAVE_CONFIG_H.
1983
1984 * read.c: rename usage of HAVE_ARRAYS to SCM_HAVE_ARRAYS.
1985
1986 * rdelim.c: #include <config.h> if HAVE_CONFIG_H.
1987
1988 * random.c: #include <config.h> if HAVE_CONFIG_H. Replace usage
1989 of LONG32, LONG64, SIZEOF_LONG, and HAVE_LONG_LONGS with
1990 scm_t_int32, scm_t_int64, and SCM_HAVE_T_INT64. Rename usage of
1991 HAVE_ARRAYS to SCM_HAVE_ARRAYS.
1992
1993 * ramap.c: replace usage of HAVE_LONG_LONGS with
1994 "SCM_SIZEOF_LONG_LONG != 0".
1995
1996 * putenv.c: #include <config.h> if HAVE_CONFIG_H. #include
1997 "libguile/scmconfig.h".
1998
1999 * pthread-threads.c: #include <config.h> if HAVE_CONFIG_H.
2000
2001 * print.c: rename usage of HAVE_ARRAYS to SCM_HAVE_ARRAYS.
2002 Replace usage of HAVE_LONG_LONGS with "SCM_SIZEOF_LONG_LONG != 0".
2003
2004 * posix.c: #include <config.h> if HAVE_CONFIG_H.
2005
2006 * ports.c: #include <config.h> if HAVE_CONFIG_H.
2007
2008 * objects.c: rename usage of HAVE_ARRAYS to SCM_HAVE_ARRAYS.
2009
2010 * numbers.h: replace usage of HAVE_FLOATINGPOINT_H with
2011 SCM_HAVE_FLOATINGPOINT_H. Replace usage of HAVE_IEEEFP_H with
2012 SCM_HAVE_IEEEFP_H. Replace usage of HAVE_NAN_H with
2013 SCM_HAVE_NAN_H. Replace usage of STDC_HEADERS with
2014 SCM_HAVE_STDC_HEADERS. Replace usage of ptrdiff_t with
2015 scm_t_ptrdiff. Replace usage of HAVE_LONG_LONGS with
2016 "SCM_SIZEOF_LONG_LONG != 0".
2017
2018 * numbers.c: #include <config.h> if HAVE_CONFIG_H. Replace usage
2019 of HAVE_LONG_LONGS with "SCM_SIZEOF_LONG_LONG != 0". Replace
2020 usage of ptrdiff_t with scm_t_ptrdiff. Replace usage of
2021 SIZEOF_PTRDIFF_T with SCM_SIZEOF_SCM_T_PTRDIFF.
2022
2023 * num2integral.i.c: #include <config.h> if HAVE_CONFIG_H.
2024
2025 * null-threads.h: replace usage of struct timespect with
2026 scm_t_timespec.
2027
2028 * net_db.c: #include <config.h> if HAVE_CONFIG_H.
2029
2030 * mkstemp.c: #include <config.h> if HAVE_CONFIG_H. #include
2031 "libguile/__scm.h". Remove definition of gcc_uint64_t in favor of
2032 scm_t_uint64 and rename usages.
2033
2034 * mallocs.c: #include <config.h> if HAVE_CONFIG_H.
2035
2036 * load.c: #include <config.h> if HAVE_CONFIG_H.
2037
2038 * iselect.h: move handling of time related headers to scmconfig.h.
2039 Rename usage of HAVE_SYS_SELECT_H to SCM_HAVE_SYS_SELECT_H.
2040 Rename usage of HAVE_WINSOCK2_H to SCM_HAVE_WINSOCK2_H. Rename
2041 usage of USE_COOP_THREADS to SCM_USE_COOP_THREADS.
2042
2043 * iselect.c: #include <config.h> if HAVE_CONFIG_H. Rename usage
2044 of USE_COOP_THREADS to SCM_USE_COOP_THREADS. Rename usage of
2045 USE_NULL_THREADS to SCM_USE_NULL_THREADS.
2046
2047 * ioext.c: #include <config.h> if HAVE_CONFIG_H.
2048
2049 * inline.h: #include "libguile/__scm.h" at the top. Change code
2050 to use SCM_C_INLINE and SCM_INLINE_C_INCLUDINT_INLINE_H to decide
2051 what to do instead of creating a new public #define. Rename usage
2052 of USE_COOP_THREADS to SCM_USE_COOP_THREADS. Rename usage of
2053 USE_NULL_THREADS to SCM_USE_NULL_THREADS. Rename usage of
2054 USE_COPT_THREADS to SCM_USE_COPT_THREADS.
2055
2056 * inline.c: rearrange handling -- now we just #define
2057 SCM_INLINE_C_INCLUDING_INLINE_H to 1 and #include
2058 "libguile/inline.h". scmconfig.h will define SCM_C_INLINE as
2059 appropriate, and we use that in inline.h along with the above
2060 define to determine how to respond.
2061
2062 * init.c: #include <config.h> if HAVE_CONFIG_H. Rename usage of
2063 HAVE_ARRAYS to SCM_HAVE_ARRAYS.
2064
2065 * guile.c: #include <config.h> if HAVE_CONFIG_H.
2066
2067 * gh_data.c: #include <config.h> if HAVE_CONFIG_H. Rename usage
2068 of HAVE_ARRAYS to SCM_HAVE_ARRAYS.
2069
2070 * gh.h: rename usage of HAVE_ARRAYS to SCM_HAVE_ARRAYS.
2071
2072 * gen-scmconfig.h.in: new file -- see gen-scmconfig.c for details.
2073
2074 * gen-scmconfig.c: new file -- see comments in file for details.
2075
2076 * gdbinit.c: #include <config.h> if HAVE_CONFIG_H.
2077
2078 * gc_os_dep.c: #include <config.h> if HAVE_CONFIG_H. Replace
2079 usage of STACK_GROWS_UP with SCM_STACK_GROWS_UP.
2080
2081 * gc.h: replace usage of SIZEOF_LONG with
2082 SCM_SIZEOF_UNSIGNED_LONG. Replace usage of USE_PTHREAD_THREADS
2083 with SCM_USE_PTHREAD_THREADS. Remove SCM_SIZEOF_LONG definition
2084 since we handle that in scmconfig.h now.
2085
2086 * gc.c: #include <config.h> if HAVE_CONFIG_H.
2087
2088 * gc-mark.c: #include <config.h> if HAVE_CONFIG_H. Rename usage
2089 of HAVE_ARRAYS to SCM_HAVE_ARRAYS. Replace usage of
2090 HAVE_LONG_LONGS with "SCM_SIZEOF_LONG_LONG != 0".
2091
2092 * gc-malloc.c: #include <config.h> if HAVE_CONFIG_H.
2093
2094 * gc-card.c: rename usage of HAVE_ARRAYS to SCM_HAVE_ARRAYS.
2095 Replace usage of HAVE_LONG_LONGS with "SCM_SIZEOF_LONG_LONG != 0".
2096
2097 * fports.c: #include <config.h> if HAVE_CONFIG_H.
2098
2099 * filesys.c: #include <config.h> if HAVE_CONFIG_H.
2100
2101 * feature.c: #include <config.h> if HAVE_CONFIG_H. Rename usage
2102 of USE_NULL_THREADS to SCM_USE_NULL_THREADS.
2103
2104 * extensions.c: #include <config.h> if HAVE_CONFIG_H.
2105
2106 * evalext.c: rename usage of HAVE_ARRAYS to SCM_HAVE_ARRAYS.
2107 Replace usage of HAVE_LONG_LONGS with "SCM_SIZEOF_LONG_LONG != 0".
2108
2109 * eval.c: #include <config.h> if HAVE_CONFIG_H. #include
2110 "libguile/__scm.h" rather than scmconfig.h. Rename usage of
2111 HAVE_ARRAYS to SCM_HAVE_ARRAYS. Replace usage of HAVE_LONG_LONGS
2112 with "SCM_SIZEOF_LONG_LONG != 0".
2113
2114 * error.c: #include <config.h> if HAVE_CONFIG_H.
2115
2116 * eq.c: #include <config.h> if HAVE_CONFIG_H. Rename usage of
2117 HAVE_ARRAYS to SCM_HAVE_ARRAYS. Replace usage of HAVE_LONG_LONGS
2118 with "SCM_SIZEOF_LONG_LONG != 0".
2119
2120 * deprecation.c: #include <config.h> if HAVE_CONFIG_H.
2121
2122 * coop.c: replace usage of struct timespect with scm_t_timespec.
2123 #include <config.h> if HAVE_CONFIG_H.
2124
2125 * coop-threads.c: #include "libguile/_scm.h" early. Replace
2126 usage of struct timespect with scm_t_timespec. Replace usage of
2127 STACK_GROWS_UP with SCM_STACK_GROWS_UP.
2128
2129 * coop-pthreads.c: #include "libguile/_scm.h" early. Replace
2130 usage of struct timespect with scm_t_timespec. Replace usage of
2131 STACK_GROWS_UP with SCM_STACK_GROWS_UP.
2132
2133 * coop-defs.h: move handling of time related headers to
2134 scmconfig.h. Add #include "libguile/__scm.h". Rename usage of
2135 HAVE_WINSOCK2_H to SCM_HAVE_WINSOCK2_H. Replace usage of struct
2136 timespect with scm_t_timespec.
2137
2138 * convert.i.c: rename usage of HAVE_ARRAYS to SCM_HAVE_ARRAYS.
2139
2140 * convert.h: rename usage of HAVE_ARRAYS to SCM_HAVE_ARRAYS.
2141
2142 * convert.c: #include <config.h> if HAVE_CONFIG_H. Rename usage
2143 of HAVE_ARRAYS to SCM_HAVE_ARRAYS.
2144
2145 * continuations.c: move libguile/_scm.h include to the top so we
2146 pick up any critical defines like _GNU_SOURCE early.
2147
2148 * backtrace.c: #include <config.h> if HAVE_CONFIG_H.
2149
2150 * async.c: #include <config.h> if HAVE_CONFIG_H.
2151
2152 * alloca.c: #include <config.h> if HAVE_CONFIG_H.
2153
2154 * _scm.h: #include <config.h> if HAVE_CONFIG_H.
2155 Rename usage of USE_PTHREAD_THREADS to SCM_USE_PTHREAD_THREADS.
2156
2157 * __scm.h: move libguile/scmconfig.h include up to the top, so
2158 we're sure to pick up any critical defines like _GNU_SOURCE early.
2159 #include <limits.h> removed in favor of scmconfig.h inclusion when
2160 appropriate. STDC_HEADERS based inclusion of stdlib.h,
2161 sys/types.h, stddef.h, and sys/stdtypes.h removed in favor of
2162 scmconfig.h inclusion when appropriate. Various Win32 related
2163 definitions removed in favor of scmconfig.h inclusion when
2164 appropriate.
2165 (HAVE_UINTPTR_T): definition removed (see NEWS).
2166 (SIZEOF_PTRDIFF_T): definition removed (see NEWS).
2167 (HAVE_LONG_LONGS): definition removed (see NEWS).
2168 (HAVE_LONG_LONG): definition removed (see NEWS).
2169 (HAVE_PTRDIFF_T): definition removed (see NEWS).
2170
2171 * Makefile.am: scmconfig.h is now generated by building and
2172 running gen-scmconfig.h and capturing its output. gen-scmconfig
2173 uses config.h and the configure.in generated gen-scmconfig.h to
2174 decide what to output. See gen-scmconfig.c for details.
2175 (noinst_PROGRAMS): add gen-scmconfig.
2176 (gen_scmconfig_SOURCES): new variable.
2177 (gen-scmconfig.$(OBJEXT)): new target - be careful to handle
2178 cross-compiling right.
2179 (scmconfig.h): build scmconfig.h from gen-scmconfig's output.
2180 (BUILT_SOURCES): add scmconfig.h.
2181
25e0bf97
MV
21822003-03-19 Marius Vollmer <mvo@zagadka.de>
2183
2184 * gc_os_dep.c: Added defines for sparc-unknown-netbsdelf1.5 from
2185 Adrian Bunk. Thanks!
2186
74b6d6e4
MD
21872003-03-19 Mikael Djurfeldt <djurfeldt@nada.kth.se>
2188
2189 * goops.c (make_class_from_template): New fourth arg:
2190 applicablep.
2191 (scm_class_extended_generic_with_setter, scm_class_self): Fixed
2192 cpls.
2193
2194 * smob.c (scm_set_smob_apply): Call scm_i_inherit_applicable.
2195
2196 * goops.c, objects.c, objects.h (scm_make_extended_class): New
2197 second arg: applicablep.
2198 (scm_i_inherit_applicable): New function.
2199
2200 * goops.c, goops.h (scm_class_applicable,
2201 scm_class_extended_accessor): New classes.
2202
5c9e7dad
DH
22032003-03-18 Dirk Herrmann <D.Herrmann@tu-bs.de>
2204
2205 * procs.c (scm_procedure_documentation): Removed redundant
2206 SCM_NIMP test and replaced other calls to SCM_IMP by more explicit
2207 predicates.
2208
f8af5c6d
MD
22092003-03-11 Mikael Djurfeldt <djurfeldt@nada.kth.se>
2210
c614a00b
MD
2211 * list.c, list.h (scm_filter, scm_filter_x): New functions.
2212
109c2c9f
MD
2213 * modules.c (scm_module_import_interface): New function.
2214
f8af5c6d
MD
2215 * goops.c, goops.h (scm_class_accessor_method): Renamed from
2216 scm_class_accessor.
2217 (scm_class_accessor): New class.
2218
a48d60b1
MD
22192003-03-06 Mikael Djurfeldt <djurfeldt@nada.kth.se>
2220
2221 * goops.c (scm_primitive_generic_generic): Enable primitive
2222 generic if not enabled.
2223 (scm_sys_goops_loaded): Setup unextended primitive generics.
2224
2225 * goops.c, goops.h (scm_c_extend_primitive_generic): New function.
2226
2227 * snarf.h (SCM_PRIMITIVE_GENERIC, SCM_PRIMITIVE_GENERIC_1): New
2228 snarf macros.
2229
2230 * numbers.c (scm_abs): Use SCM_PRIMITIVE_GENERIC. (This is only a
2231 testing example. All uses of SCM_GPROC should be converted.)
2232
2233 * procprop.c (scm_stand_in_scm_proc): Use scm_assq instead of
2234 scm_assoc.
2235
2236 * eq.c (scm_equal_p): Turned into a primitive generic.
2237
84edc049
RB
22382003-02-27 Rob Browning <rlb@defaultvalue.org>
2239
2240 * Makefile.am (scmconfig.h): new target -- generate file from
2241 ../config.h.
2242 (modinclude_HEADERS): remove version.h.
2243 (nodist_modinclude_HEADERS): add version.h.
2244
ea5c9285
MD
22452003-02-24 Mikael Djurfeldt <djurfeldt@nada.kth.se>
2246
b4a1358c
MD
2247 This fixes a serious GC bug, introduced during the latest
2248 reorganization of the GC, which disabled freeing of structs and
2249 GOOPS objects:
2250
2251 * struct.c (scm_struct_prehistory): Init scm_i_structs_to_free to
2252 SCM_EOL.
53af8255
MD
2253 (scm_struct_prehistory): Move scm_free_structs to
2254 scm_before_mark_c_hook.
ea5c9285 2255
b4a1358c
MD
2256 * gc-card.c (sweep_card): Check that we haven't swept structs on
2257 this card before. That can happen if scm_i_sweep_all_segments has
2258 been called from some other place than scm_igc.
2259
c35738c1
MD
22602003-02-19 Mikael Djurfeldt <djurfeldt@nada.kth.se>
2261
231a4ea8
MD
2262 * environments.c (DEFAULT_OBARRAY_SIZE): Changed from 137 to 31
2263 (since hash tables now adapt their size).
2264
2265 * modules.c (scm_modules_prehistory): Changed from 2001 to 1533
2266 (current number of prehistory bindings; hashtable code will select
2267 a prime which is greater than this value).
2268
2269 * symbols.c (scm_symbols_prehistory): Changed from 1009 to 2139
2270 (current number of initial symbols).
2271
2272 * properties.c (scm_init_properties): Don't specify size of
2273 scm_properties_whash.
2274
2275 * objprop.c (scm_init_objprop): Don't specify size of
2276 scm_object_whash.
2277
2278 * keywords.c (scm_init_keywords): Don't specify a hash table size.
2279
c35738c1
MD
2280 * hooks.c (scm_c_hook_add): Fixed bug in append mode.
2281
2282 The following changes introduce the use of resizable hash tables
2283 throughout Guile. It also renames the old *-hash-table* functions
2284 to *-alist-vector* and places them, together with the rest of the
2285 weak vector support, in the module (ice-9 weak-vector). We should
2286 probably introduce a new, better, API for weak references, for
2287 example "weak pairs" a la MIT-Scheme. (In Chez scheme, they even
2288 look like and are used like ordinary pairs.)
2289
2290 * environments.c (obarray_enter, obarray_retrieve, obarray_remove,
2291 leaf_environment_fold, obarray_remove_all): Use hashtable
2292 accessors.
2293
2294 * gc.c (scm_init_storage): Moved hook initialization to
2295 scm_storage_prehistory.
2296 (scm_storage_prehistory): New function.
2297 (scm_igc): Added commentary about placement of
2298 scm_after_sweep_c_hook.
2299
2300 * gc-mark.c (scm_mark_all): Use hashtable accessors.
2301 (scm_gc_mark_dependencies): Use SCM_WVECT_WEAK_KEY_P and
2302 SCM_WVECT_WEAK_VALUE_P.
2303
2304 * hashtab.c, hashtab.h (scm_hash_for_each, scm_hash_map): New
2305 functions.
2306 (scm_vector_to_hash_table, scm_c_make_resizing_hash_table):
2307 Removed.
2308 (scm_make_weak_key_hash_table, scm_make_weak_value_hash_table,
2309 scm_make_doubly_weak_hash_table): Moved here from weaks.c.
2310
2311 * init.c (scm_init_guile_1): Removed call to scm_init_weaks; Added
2312 calls to scm_storage_prehistory and scm_hashtab_prehistory.
2313
2314 * modules.c (module-reverse-lookup): Use hashtable accessors.
2315
2316 * symbols.c, symbols.h (scm_i_hash_symbol): New function.
2317
2318 * weaks.c, weaks.h (scm_make_weak_key_alist_vector,
2319 scm_make_weak_value_alist_vector,
2320 scm_make_doubly_weak_alist_vector): New functions.
2321
2322 * weaks.c (scm_init_weaks_builtins): New function.
2323
2324 * weaks.h (SCM_WVECTF_WEAK_KEY, SCM_WVECTF_WEAK_VALUE,
2325 SCM_WVECTF_NOSCAN, SCM_WVECT_WEAK_KEY_P, SCM_WVECT_WEAK_VALUE_P,
2326 SCM_WVECT_NOSCAN_P): New macros.
2327
2328 * weaks.c (scm_scan_weak_vectors): Use SCM_WVECT_WEAK_KEY_P
2329 and SCM_WVECT_WEAK_VALUE_P.
2330
2331 * weaks.c, weaks.h (scm_i_allocate_weak_vector): Renamed from
2332 allocate_weak_vector and exported.
2333
0a4c1355
MD
23342003-02-13 Mikael Djurfeldt <djurfeldt@nada.kth.se>
2335
2336 * hashtab.c: Undid thread safety. (We decided that it's better to
2337 let the user explicitly protect the tables (or not) according what
2338 is suitable for the application.)
2339
87ca11ff
MD
23402003-02-12 Mikael Djurfeldt <djurfeldt@nada.kth.se>
2341
2342 * hashtab.c (scm_hash_fn_remove_x, scm_internal_hash_fold): Made
2343 thread safe and handle resizing tables.
2344 (scm_ihashx, scm_sloppy_assx, scm_delx_x): Removed
2345 SCM_DEFER/ALLOW_INTS.
2346
f59a096e
MD
23472003-02-11 Mikael Djurfeldt <djurfeldt@nada.kth.se>
2348
2349 * hashtab.c (scm_vector_to_hash_table,
2350 scm_c_make_resizing_hash_table, scm_make_hash_table): New
2351 functions.
2352 (scm_hash_fn_get_handle, scm_hash_fn_create_handle_x): Made thread
2353 safe and handle resizing tables.
2354
2355 * weaks.c (scm_make_weak_key_hash_table,
2356 scm_make_weak_value_hash_table, scm_make_doubly_weak_hash_table):
2357 Size argument made optional. Return resizable table if not
2358 specified.
2359
4b612c5b
MD
23602003-02-10 Mikael Djurfeldt <djurfeldt@nada.kth.se>
2361
2362 * eval.c (scm_trampoline_0, scm_trampoline_1, scm_trampoline_2):
2363 Fixed formals tests for closures. (Thanks to Kevin Ryde.)
2364
b3d7f6df
MD
23652003-02-05 Mikael Djurfeldt <djurfeldt@nada.kth.se>
2366
2367 * debug.c (scm_procedure_source): Handle all objects for which
2368 procedure? is #t. (Thanks to Bill Schottstaedt.)
2369
756414cf
MD
23702003-01-23 Mikael Djurfeldt <djurfeldt@nada.kth.se>
2371
361d631f
MD
2372 * futures.c (mark_futures): Don't need to mark data of recycled
2373 futures.
2374 (scan_futures, cleanup_undead): Be smarter about marking
2375 futures---avoid unnecessary passes through future lists.
2376
756414cf
MD
2377 * futures.h, futures.c: New files; Introduced recycling of
2378 futures. For fine-grained threading this lifts performance to
2379 another level. We can now use parallelization in inner loops of
2380 Guile programs without impossible overhead.
2381
2382 * threads.h, threads.c: Moved futures to their own file.
2383
2384 * Makefile.am (libguile_la_SOURCES): Added futures.c.
2385 (DOT_X_FILES): Added futures.x.
2386 (DOT_DOC_FILES): Added futures.doc.
2387 (modinclude_HEADERS): Added futures.h.
2388
2389 * threads.c, threads.h (scm_i_create_thread): Renamed from
2390 create_thread and made global.
2391
2392 * futures.c (scm_make_future): New procedure.
2393
2394 * eval.c: #include "libguile/futures.h".
2395
2396 * init.c: #include "futures.h"
2397 (scm_init_guile_1): Call scm_init_futures.
2398
2399 * stime.c (SCM_TIME_UNITS_PER_SECOND): Renamed from CLKTCK.
2400
2401 * stime.h (SCM_TIME_UNITS_PER_SECOND): Definition moved here.
2402
2403 * eval.c, eval.h (scm_trampoline_0, scm_i_call_closure_0): New
2404 functions.
2405
2406 * eval.c (scm_trampoline_1): Fixed arguments test for closures.
2407
b4debead
MD
24082003-01-22 Mikael Djurfeldt <djurfeldt@nada.kth.se>
2409
2410 * threads.c (create_thread): Don't unwind dynwind chain of parent
2411 thread before creation. Just start the new thread with an empty
2412 dynwind chain.
2413
93f26b7b
MD
24142003-01-20 Mikael Djurfeldt <djurfeldt@nada.kth.se>
2415
2416 * evalext.c, evalext.h (scm_self_evaluating_p): New function.
2417
38d8927c
MD
24182003-01-10 Mikael Djurfeldt <djurfeldt@nada.kth.se>
2419
41c96c32
MD
2420 * threads.c (scm_timed_wait_condition_variable): Support timed
2421 waiting also for simple condition variables.
2422
38d8927c
MD
2423 * goops.c (TEST_CHANGE_CLASS): Use scm_change_object_class instead
2424 of calling the procedure change-object-class.
2425
9cf5d9b7
MD
24262003-01-09 Mikael Djurfeldt <djurfeldt@nada.kth.se>
2427
2428 * ramap.c (scm_ramapc): Typo in error message.
2429
bbf8d523
MD
24302003-01-08 Mikael Djurfeldt <djurfeldt@nada.kth.se>
2431
b46fae00
MD
2432 * goops.c (scm_sys_prep_layout_x): Bugfix: Only create layout for
2433 slots with instance allocation.
2434
bbf8d523
MD
2435 * goops.c, goops.h (scm_class_extended_generic_with_setter): New
2436 class.
2437 (scm_compute_applicable_methods): Use scm_generic_function_methods.
2438
2439 * goops.c (scm_generic_function_methods): Support extended
2440 generic functions.
2441
ebf9b47c
MD
24422002-12-29 Mikael Djurfeldt <djurfeldt@nada.kth.se>
2443
2444 * eval.c (unmemocopy): Bugfix: scm_sym_delay --> scm_sym_future.
2e37d6a2 2445 Thanks to Neil for pointing this out!
ebf9b47c 2446
14a9ba3f
NJ
24472002-12-29 Neil Jerram <neil@ossau.uklinux.net>
2448
2449 * lang.h: Remove declarations matching definitions removed from
2450 lang.c (just below).
2451
c6a040a8
NJ
24522002-12-28 Neil Jerram <neil@ossau.uklinux.net>
2453
6054d805
NJ
2454 * lang.c (scm_nil_cons, scm_nil_car, scm_nil_cdr, scm_null,
2455 scm_m_while, scm_nil_eq): Remove definitions that were superfluous
2456 and already commented out.
2457
c6a040a8
NJ
2458 * read.h (scm_lreadparen), read.c (scm_lreadr, scm_read_token,
2459 scm_lreadparen): Support reading vectors with Elisp syntax if
2460 SCM_ELISP_READ_EXTENSIONS is defined. (SCM_ELISP_READ_EXTENSIONS
2461 is not currently defined, and there isn't even a configure switch
2462 to enable it yet.)
2463
3742c12f
MV
24642002-12-26 Marius Vollmer <mvo@zagadka.ping.de>
2465
2466 * Makefile.am (c-tokenize.o): Refer to source via $< so that vpath
2467 builds work.
2468 (EXTRA_DIST): Added version.h.in.
2469
fb50ef08
MD
24702002-12-21 Mikael Djurfeldt <djurfeldt@nada.kth.se>
2471
2472 This change makes it possible for one thread to do lazy sweeping
2473 while other threads are running. Now only the mark phase need to
2474 have all threads asleep. We should look further into this issue.
2475 Presently, I've put the locking of scm_i_sweep_mutex at
2476 "conservative" places due to my current lack of knowledge about
2477 the garbage collector. Please feel free to restrict these regions
2478 further to allow for maximal parallelism!
2479
2480 * gc.c, gc.h (scm_i_sweep_mutex): New mutex.
2481
2482 * gc.c (scm_gc_for_newcell), gc-malloc.c (scm_realloc,
2483 scm_gc_register_collectable_memory): Substitute locking of
2484 scm_i_sweep_mutex for calls to scm_i_thread_put_to_sleep.
2485 (scm_igc): Lock sweep mutex here instead of in callers; Calls to
2486 scm_i_thread_put_to_sleep/scm_i_thread_wake_up used to demarkate
2487 the single-thread section (which now only contains the mark
2488 phase).
2489 (scm_gc): Don't lock sweeo mutex here since scm_igc locks it;
2490 Removed SCM_DEFER/ALLOW_INTS. Simply call scm_igc directly.
2491
2492 * threads.c (gc_section_mutex): Removed.
2493
9ed24633
MD
24942002-12-19 Mikael Djurfeldt <mdj@kvast.blakulla.net>
2495
0d48aca5
MD
2496 * threads.c (create_thread): Clear parent field in root state in
2497 order not to unnecessarily remember dead threads.
2498
9ed24633
MD
2499 * eval.c (call_subr2o_1, call_lsubr2_2): New functions.
2500 (scm_trampoline_1, scm_trampoline_2): Use them.
2501
29717c89
MD
25022002-12-18 Mikael Djurfeldt <mdj@kvast.blakulla.net>
2503
2504 Partial introduction of real plugin interface.
2505
2506 * Makefile.am (modinclude_HEADERS): Added threads-plugin.h.
2507 (EXTRA_DIST): Added threads-plugin.c.
2508
2509 * threads-plugin.h, threads-plugin.c: New files.
2510
2511 * threads.h: #include "libguile/threads-plugin.h".
2512
2513 * threads.c: #include "libguile/threads-plugin.c".
2514
2515 * pthread-threads.c: Temporarily remove debugging functions.
2516
2517 * threads.c, threads.h (scm_yield): Added back.
2518
e29e0b09
MD
25192002-12-18 Mikael Djurfeldt <mdj@kvast.blakulla.net>
2520
2521 * threads.c (really_launch): Detach before unlocking
2522 thread_admin_mutex in order not to risk being joined.
2523 (scm_i_thread_put_to_sleep, scm_i_thread_wake_up): Keep
2524 thread_admin_mutex locked during GC.
2525
2526 * pthread-threads.c, pthread-threads.h: Improvements to debugging
2527 functions.
2528
0b6843b1 25292002-12-16 Mikael Djurfeldt <mdj@kvast.blakulla.net>
93cd4dcd 2530
6da2dfc4
MD
2531 * pthread-threads.c, pthread-threads.h (SCM_DEBUG_THREADS): Added
2532 support for debugging mutex operations.
2533
1b92fb6b
MD
2534 * threads.c (scm_thread): Removed filed joining_threads.
2535 (thread_print): Print thread number as well as address of thread
2536 structure.
0b6843b1
MD
2537 (scm_join_thread): Bugfix.
2538 (scm_lock_mutex, scm_try_mutex, scm_unlock_mutex,
2539 scm_timed_wait_condition_variable, scm_signal_condition_variable,
2540 scm_broadcast_condition_variable): Use the low-level API.
2541 (scm_all_threads): Return copy of thread list (to prevent
2542 unintended destruction).
2543 (scm_threads_prehistory): Initialize heap_mutex of fake thread.
1b92fb6b 2544
93cd4dcd
MD
2545 * pthread-threads.c, pthread-threads.h, threads.c: Fixes to
2546 pthread "native" recursive mutex support.
2547
2ff4f181
MD
25482002-12-15 Mikael Djurfeldt <djurfeldt@nada.kth.se>
2549
28d52ebb
MD
2550 * __scm.h (SCM_DEFER_INTS, SCM_ALLOW_INTS): New definitions.
2551 Simply lock a thread C API recursive mutex.
2552 (SCM_NONREC_CRITICAL_SECTION_START,
2553 SCM_NONREC_CRITICAL_SECTION_END, SCM_REC_CRITICAL_SECTION_START,
2554 SCM_REC_CRITICAL_SECTION_END): Removed.
2555
2556 * eval.c: Replaced SOURCE_SECTION_START / SOURCE_SECTION_END with
2557 direct calls to scm_rec_mutex_lock / unlock around the three calls
2558 to scm_m_expand_body.
2559
2560 * eval.c, eval.h (promise_free): New function.
2561 (scm_force): Rewritten; Now thread-safe; Removed
2562 SCM_DEFER/ALLOW_INTS.
2563
2564 * pthread-threads.h: Added partially implemented plugin interface
2565 for recursive mutexes. These are, for now, only intended to be
2566 used internally within the Guile implementation.
2567
2568 * pthread-threads.c: New file.
2569
2570 * threads.c: Conditionally #include "pthread-threads.c".
2571
2572 * eval.c, eval.h (scm_makprom, scm_force): Rewritten to be
2573 thread-safe;
2574
2575 * snarf.h (SCM_MUTEX, SCM_GLOBAL_MUTEX, SCM_REC_MUTEX,
2576 SCM_GLOBAL_REC_MUTEX): New macros.
2577
2578 * eval.c, threads.c, threads.h, snarf.h: Rewrote critical section
2579 macros---use mutexes instead.
2580
2581 * tags.h (SCM_IM_FUTURE): New tag.
2582
2583 * eval.c (scm_m_future): New primitive macro.
2584 (SCM_CEVAL): Support futures.
2585 (unmemocopy): Support unmemoization of futures.
2586
2587 * print.c (scm_isymnames): Name of future isym.
2588
2ff4f181
MD
2589 * version.c: Unmade some changes to my private copy that got
2590 committed by mistake.
2591
392d2833
MD
25922002-12-11 Mikael Djurfeldt <mdj@kvast.blakulla.net>
2593
e200ddee
MD
2594 * gc-malloc.c, gc.h, init.c: Reverted gc-malloc change of
2595 2002-12-10.
2596
392d2833
MD
2597 * gc.c (scm_igc): Don't call scm_i_thread_invalidate_freelists.
2598
2599 * gc.c (scm_gc_sweep): Call it here instead, which is a more
2600 logical place.
2601
2602 * threads.c (create_thread): Remember root object until the handle
2603 of the new thread is on all_threads list.
2604
2605 * root.c (scm_make_root): Moved copying of fluids until after
2606 creation of root handle so that the fluids are GC protected. Also
2607 removed the critical section.
2608
c4c52ebe
MD
26092002-12-10 Mikael Djurfeldt <mdj@kvast.blakulla.net>
2610
960c408c
MD
2611 * gc-malloc.c, gc.h (scm_gc_malloc_prehistory): New function.
2612
3cdde9d6 2613 * gc-malloc.c (malloc_mutex): New mutex.
960c408c 2614 (scm_gc_malloc_prehistory): Initialize it.
3cdde9d6
MD
2615 (scm_realloc): Serialize call to realloc
2616 (scm_calloc): Same for calloc.
2617 Thanks to Wolfgang Jaehrling!
2618 (Now we have to make sure all calls to malloc/realloc are made
2619 through scm_malloc.)
2620
960c408c
MD
2621 * init.c (scm_init_guile_1): Call scm_gc_malloc_prehistory.
2622
c4c52ebe
MD
2623 * threads.c (really_launch): Release heap (to prevent deadlock).
2624 (create_thread): Release heap before locking thread admin mutex.
2625
b0dc3d71
MD
26262002-12-10 Mikael Djurfeldt <mdj@kvast.blakulla.net>
2627
2628 * threads.c (scm_i_thread_invalidate_freelists): New
2629 function.
2630
2631 * gc.c (scm_igc): Call scm_i_thread_invalidate_freelists.
2632
2633 * modules.c (scm_export): Inserted a return statement.
2634
06e80f59
HWN
26352002-12-10 Han-Wen Nienhuys <hanwen@cs.uu.nl>
2636
2637 * modules.c (scm_export): new function
2638
2639 * gc-card.c: add a note about malloc()/free() overhead.
2640
a12611c3
MD
26412002-12-10 Mikael Djurfeldt <mdj@kvast.blakulla.net>
2642
2643 * Makefile.am (c-tokenize.$(OBJEXT)): Don't look for c-tokenize.c
2644 in srcdir.
2645
c7fabadf
MD
26462002-12-10 Mikael Djurfeldt <djurfeldt@nada.kth.se>
2647
2648 These changes remove scm_ints_disabled (which hasn't has any
2649 effect in Guile for quite some time).
2650
2651 * async.c, error.h (scm_ints_disabled): Removed.
2652
2653 * gc.c (scm_gc_for_newcell), init.c (scm_init_guile_1),
2654 root.c (scm_internal_cwdr), gdbint.c (SCM_BEGIN_FOREIGN_BLOCK,
2655 SCM_END_FOREIGN_BLOCK): Don't touch scm_ints_disabled.
2656 (old_ints): Removed.
2657
2658 * __scm.h (SCM_DEFER_INTS, SCM_ALLOW_INTS): Define as a recursive
2659 critical section.
2660 (SCM_REDEFER_INTS, SCM_ALLOW_INTS): Define as SCM_DEFER_INTS and
2661 SCM_ALLOW_INTS.
2662
9bc4701c
MD
26632002-12-09 Mikael Djurfeldt <djurfeldt@nada.kth.se>
2664
52340b65
MD
2665 * threads.c (scm_mutex_lock, scm_cond_wait, scm_cond_timedwait):
2666 Removed accidental #if 0 around these functions.
2667
9bc4701c
MD
2668 These changes are the start of support for preemptive
2669 multithreading. Marius and I have agreed that I commit this code
2670 into the repository although it isn't thoroughly tested and surely
2671 introduces many bugs. The bugs should only be exposed when using
2672 threads, though. Signalling and error handling for threads is
2673 very likely broken. Work on making the implementation cleaner and
2674 more efficient is needed.
2675
2676 * __scm.h (SCM_ALLOW_INTS_ONLY): Removed.
2677 (SCM_NONREC_CRITICAL_SECTION_START,
2678 SCM_NONREC_CRITICAL_SECTION_END, SCM_REC_CRITICAL_SECTION_START,
2679 SCM_REC_CRITICAL_SECTION_END): New macros.
2680 (SCM_CRITICAL_SECTION_START/END): Defined here.
2681
2682 * eval.c: Insert SOURCE_SECTION_START / SOURCE_SECTION_END around
2683 the three calls to scm_m_expand_body.
2684
2685 * gc.h: #include "libguile/pthread-threads.h";
2686 (SCM_FREELIST_CREATE, SCM_FREELIST_LOC): New macros.
2687
2688 * gc.c (scm_i_freelist, scm_i_freelist2): Defined to be of type
2689 scm_t_key;
2690
2691 * gc.c, gc-freelist.c, inline.h: Use SCM_FREELIST_LOC for freelist
2692 access.
2693
2694 * gc-freelist.c (scm_gc_init_freelist): Create freelist keys.
2695
2696 * gc-freelist.c, threads.c (really_launch): Use
2697 SCM_FREELIST_CREATE.
2698
2699 * gc-malloc.c (scm_realloc, scm_gc_register_collectable_memory):
2700
2701 * gc.c (scm_i_expensive_validation_check, scm_gc,
2702 scm_gc_for_newcell): Put threads to sleep before doing GC-related
2703 heap administration so that those pieces of code are executed
2704 single-threaded. We might consider rewriting these code sections
2705 in terms of a "call_gc_code_singly_threaded" construct instead of
2706 calling the pair of scm_i_thread_put_to_sleep () and
2707 scm_i_thread_wake_up (). Also, we would want to have as many of
2708 these sections eleminated.
2709
2710 * init.c (scm_init_guile_1): Call scm_threads_prehistory.
2711
2712 * inline.h: #include "libguile/threads.h"
2713
2714 * pthread-threads.h: Macros now conform more closely to the
2715 pthreads interface. Some of them now take a second argument.
2716
2717 * threads.c, threads.h: Many changes.
2718
27192002-12-09 Mikael Djurfeldt <djurfeldt@nada.kth.se>
2720
2721 * Makefile.am (version.h): Changed $^ --> $< in rule for
2722 version.h.
2723
b2cbe8d8
RB
27242002-12-08 Rob Browning <rlb@defaultvalue.org>
2725
2726 * version.h.in (SCM_MICRO_VERSION): use @--@ substitution now.
2727 (SCM_MINOR_VERSION): use @--@ substitution now.
2728 (SCM_MICRO_VERSION): use @--@ substitution now.
2729 (scm_effective_version): new function prototype.
2730
2731 * version.c (scm_effective_version): new function, also add
2732 effective-version.
2733
2734 * Makefile.am (schemelibdir): VERSION -> GUILE_EFFECTIVE_VERSION.
2735 (libpath.h): use GUILE_EFFECTIVE_VERSION to compute
2736 SCM_LIBRARY_DIR.
2737 (version.h): generate this here rather than configure.in. This
2738 approach tracks source edits better (i.e. more immediately).
2739 Might be worth considering for other .in files too.
2740
5441c65c
MV
27412002-12-02 Marius Vollmer <mvo@zagadka.ping.de>
2742
2743 Reorganized thread package selection. A thread package now only
2744 implements a small set of pthread like functions and Guile
2745 implements the rest on top of that. Guile's implementation is
2746 what the "coop-pthreads" package has been previously. Support for
2747 "coop" threads has been removed until I get time to add it again.
2748
2749 * Makefile.am (libguile_la_SOURCES): Removed iselect.c.
2750 (noinst_HEADERS): Removed coop-threads.c, coop-threads.h, coop.c,
2751 null-threads.c, coop-pthreads.c.
2752 (modinclude_HEADERS): Removed coop-defs.h, coop-pthreads.h. Added
2753 pthread-threads.h.
2754
2755 * validate.h (SCM_VALIDATE_THREAD): Moved to threads.h.
2756
2757 * threads.h: Do not include "libguile/coop-defs.h". Include
2758 "libguile/pthread-threads.h" for USE_COPT_THREADS. Removed
2759 (previously deprecated) C level thread API prototypes. They are
2760 now in the thread package specific headers, "null-threads.h" and
2761 "pthread-threads.h".
2762 (SCM_VALIDATE_THREAD, SCM_VALIDATE_MUTEX, SCM_VALIDATE_CONDVAR):
2763 New.
2764 (scm_threads_init): Removed.
2765 (SCM_CRITICAL_SECTION_START, SCM_CRITICAL_SECTION_END,
2766 SCM_THREAD_SWITCHING_CODE, scm_i_switch_counter,
2767 SCM_I_THREAD_SWITCH_COUNT): Define here.
2768 (scm_single_thread_p): Removed.
2769 (scm_call_with_new_thread): Take two args directly instead of list
2770 of two args.
2771 (scm_i_thread_data, scm_i_set_thread_data, SCM_THREAD_LOCAL_DATA,
2772 SCM_SET_THREAD_LOCAL_DATA): Define here.
2773
2774 * threads.c: Merged with "coop-pthreads.c".
2775
2776 * null-threads.h: Implement pthread-like API as a set of macros.
2777
2778 * pthread-threads.h: New, implement pthread-like API by deferring
2779 to pthread itself.
2780
2781 * init.c (scm_init_guile_1): Do not call scm_init_iselect, which
2782 has been lost in the reorganization.
2783
504d99c5
MD
27842002-12-01 Mikael Djurfeldt <mdj@linnaeus>
2785
2786 The following change makes it possible to move procedure
2787 application dispatch outside inner loops. The motivation was
2788 clean implementation of efficient replacements of R5RS primitives
2789 in SRFI-1.
2790
2791 The semantics is clear: scm_trampoline_N returns an optimized
2792 version of scm_call_N (or NULL if the procedure isn't applicable
2793 on N args).
2794
2795 Applying the optimization to map and for-each increases efficiency
2796 noticeably. For example, (map abs ls) is 8 times faster than
2797 before.
2798
2799 * eval.h (scm_t_trampoline_1, scm_t_trampoline_2): New types.
2800
2801 * eval.c, eval.h (scm_trampoline_1, scm_trampoline_2): New functions.
2802
2803 * eval.c (call_subr2_2, call_lsubr_2, call_closure_2): New functions;
2804 (map, for-each): Handle also application on two args as a special
2805 case; Use trampolines.
2806
2807 Other changes:
2808
2809 * sort.c (scm_cmp_function): Choose subr2less for scm_tc7_subr_2o;
2810 (subr2oless): Removed.
2811 (scm_restricted_vector_sort_x): Use scm_return_first to keep the
2812 vector GC protected.
2813
2814 * eval.c (check_map_args): Use scm_out_of_range_pos instead of
2815 scm_out_of_range.
2816
63dd3413
DH
28172002-11-24 Dirk Herrmann <D.Herrmann@tu-bs.de>
2818
2819 * evalext.[ch] (scm_m_undefine, undefine): Deprecated.
2820
4ba5f279
MD
28212002-11-17 Mikael Djurfeldt <mdj@linnaeus>
2822
2823 * debug.c (scm_make_iloc): Added missing "return".
2824
56ae231f
MV
28252002-11-17 Marius Vollmer <mvo@zagadka.ping.de>
2826
2827 * strports.c (scm_eval_string_in_module): Validate second arg to
2828 be a module. Thanks to Arno Peters!
2829
80b28865
DH
28302002-11-16 Dirk Herrmann <D.Herrmann@tu-bs.de>
2831
2832 * .cvsignore: remove goops.c
2833
c88b1456
DH
28342002-11-16 Dirk Herrmann <D.Herrmann@tu-bs.de>
2835
2836 * modules.c (scm_env_top_level, scm_lookup_closure_module,
2837 module_variable, scm_module_lookup_closure,
2838 scm_module_transformer, scm_sym2var, scm_module_reverse_lookup,
2839 scm_system_module_env_p): Don't compare SCM values with C
2840 operators == or !=. Avoid SCM_IMP predicates. Prefer !SCM_FALSEP
2841 over SCM_NFALSEP.
2842
a8a19efc
DH
28432002-11-16 Dirk Herrmann <D.Herrmann@tu-bs.de>
2844
2845 * eval.h (SCM_MAKE_ILOC): New macro.
2846
2847 * debug.c (scm_make_iloc): Use SCM_MAKE_ILOC instead of computing
2848 the iloc bitpattern here.
2849
76734914
MD
28502002-11-14 Mikael Djurfeldt <mdj@linnaeus>
2851
2852 * coop-pthreads.c, coop-pthreads.h: scm_internal_select should be
2853 part of the API, otherwise it's difficult to write Guile
2854 extensions using non-blocking I/O => moved #include
2855 "libguile/iselect.h" from coop-pthreads.c --> coop-pthreads.h.
2856
2857 * coop-pthreads.c (scm_unlock_mutex): Changed s_lock_mutex -->
2858 s_unlock_mutex.
2859
8b5b4a75
MV
28602002-11-10 Marius Vollmer <mvo@zagadka.ping.de>
2861
2862 * __scm.h (USE_THREADS, GUILE_ISELECT): Do not define here. They
2863 are defined in configure.in.
2864
2865 * threads.c: Removed SCM_API from function definitions. SCM_API
2866 is only for declarations.
2867
e5a83084
MD
28682002-11-07 Mikael Djurfeldt <mdj@linnaeus>
2869
9be8bb45
MD
2870 * coop-pthreads.h: Added support for thread specific data to the
2871 generic C API for the coop-pthreads case.
2872
e5a83084
MD
2873 * threads.c, threads.h (scm_cond_init): Undo unintentional API
2874 change.
6c214b62 2875 (scm_cond_broadcast): Added missing function.
e5a83084 2876
7edf178e
MV
28772002-11-04 Marius Vollmer <marius.vollmer@uni-dortmund.de>
2878
2879 * coop.c (coop_next_runnable_thread): Removed, wich should have
2880 happened when GUILE_ISELECT was hard-wired.
2881
7f5b1b77
MV
28822002-11-03 Marius Vollmer <mvo@zagadka.ping.de>
2883
7caa1b07
MV
2884 * Makefile.am (libguile_la_SOURCES): Added threads.c
2885 (DOT_DOC_FILES): Added threads.doc.
2886 (DOT_X_FILES): Added threads.x.
2887 (EXTRA_libguile_la_SOURCES): Removed threads.c.
2888 (noinst_HEADERS): Added coop-pthreads.c.
2889 (modinclude_HEADERS): Added coop-pthreads.h.
2890
2891 * __scm.h (USE_THREADS, GUILE_ISELECT): Define when
2892 SCM_DEBUG_DEPRECATED. Removed their use thru-out Guile.
2893
bb11cbf4
MV
2894 * iselect.c: Include "_scm.h" before testing HAVE_UNISTD_H.
2895 Thanks to Bill Schottstaedt!
2896
1d4cbbed
MV
2897 * numbers.c (scm_integer_expt): Make 0^z == 0 for z != 0.
2898
7f5b1b77
MV
2899 * _scm.h (HAVE_RESTARTABLE_SYSCALLS): Do define even when
2900 SCM_COPT_THREADS is defined.
2901 (SCM_SYSCALL): Use EINTR-expection version when SCM_COPT_THREADS
2902 is defined.
2903
2904 * coop-pthreads.c: Some harmless renamings of internal stuff.
2905 (create_thread): New, generalized version of
2906 scm_call_with_new_thread.
2907 (scm_call_with_new_thread): Use it.
2908 (scm_spawn_thread): New, use create_thread.
2909
d52f53b1
MV
29102002-11-02 Marius Vollmer <mvo@zagadka.ping.de>
2911
2912 * coop-pthreads.c, coop-pthreads.h: Redone completely, you might
2913 start testing it now.
2914
2915 * _scm.h: Include <errno.h< so that SCM_SYSCALL is correctly
2916 defined when HAVE_RESTARTABLE_SYSCALLS is not defined.
2917 (HAVE_RESTARTABLE_SYSCALLS): Do not define when USE_COPT_THREADS
2918 is defined.
2919
30f920c3
MV
29202002-10-27 Marius Vollmer <mvo@zagadka.ping.de>
2921
2922 * scmsigs.c (signal_cell_handlers, install_handler_data,
2923 scm_delq_spine_x, really_install_handler, install_handler): New
2924 scheme for triggering signal handlers, to simplify take_signal.
2925 (take_signal): Simplified, to avoid race conditions.
2926 (scm_sigaction_for_thread): Use new Scheme. Validate that thread
2927 hasn't exited yet.
2928
2929 * async.c (scm_async_click): Reset pending_asyncs, handle
2930 signal_asyncs. Don't set cdr of a non-signal async to #f.
2931 (scm_i_queue_async_cell): Do not check cdr of cell for #f, queue
2932 always. Set pending_asyncs.
2933 (scm_system_async_mark_for_thread): Check that thread has not
2934 exited.
2935 (scm_unmask_signals, decrease_block): Call scm_async_click after
2936 block_asyncs becomes zero.
2937
2938 * __scm.h (SCM_ASYNC_CLICK): Check pending_asyncs instead of
2939 active_asyncs.
2940
2941 * root.h (scm_root_state): Added pending_asyncs and signal_asyncs
2942 fields.
2943 * root.c (root_mark): Mark them.
2944 (make_root): Initialize them.
2945
2946 * iselect.c, iselect.h: Replaced GUILE_ISELECT with
2947 USE_COOP_THREADS.
2948 (scm_internal_select): Define one version for USE_COOP_THREADS and
2949 one for USE_NULL_THREADS.
2950 (scm_init_iselect): Likewise.
2951
2952 * inline.h (scm_cell, scm_double_cell): Also allow
2953 USE_COPT_THREADS to not protect the slot initializers.
2954
2955 * init.c (scm_init_guile_1): Call scm_init_thread_procs. This is
2956 because threads need to be initialized before the stack, but
2957 gsubrs such as scm_timed_condition_variable_wait can only be
2958 created later.
2959
2960 * threads.h: Include "coop-pthreads.h" when requested.
2961 (scm_threads_make_mutex, scm_threads_lock_mutex,
2962 scm_threads_unlock_mutex, scm_threads_monitor): Removed, they were
2963 not implemented anyway.
2964 (scm_init_thread_procs, scm_try_mutex,
2965 scm_timed_condition_variable_wait,
2966 scm_broadcast_condition_variable, scm_c_thread_exited_p,
2967 scm_thread_exited_p): New prototypes.
2968 (struct timespec): Define if not already defined.
2969 (scm_t_mutex, scm_mutex_init, scm_mutex_lock, scm_mutex_trylock,
2970 scm_mutex_unlock, scm_mutex_destroy, scm_t_cond, scm_cond_init,
2971 scm_cond_wait, scm_cond_timedwait, scm_cond_signal,
2972 scm_cond_broadcast, scm_cond_destroy): Declarations moved here and
2973 deprecated.
2974
2975 * threads.c: Include <errno.h>. Include "coop-pthreads.c" when
2976 requested.
2977 (scm_thread_exited_p): New.
2978 (scm_try_mutex, scm_broadcast_condition_variable): Newly
2979 registered procedures.
2980 (scm_wait_condition_variable, scm_timed_wait_condition_variable):
2981 Use the latter as the procedure for "wait-condition-variable",
2982 thus offering a optional timeout parameter to Scheme.
2983 (scm_wait_condition_variable): Implement in terms of
2984 scm_timed_wait_condition_variable.
2985 (scm_mutex_init, scm_mutex_lock, scm_mutex_trylock,
2986 scm_mutex_unlock, scm_mutex_destroy, scm_cond_init,
2987 scm_cond_wait, scm_cond_timedwait, scm_cond_signal,
2988 scm_cond_broadcast, scm_cond_destroy): Implement in terms of
2989 scm_make_mutex, etc, and deprecate.
2990 (scm_init_threads): Do not create smobs, leave this to
2991 scm_threads_init. Do not include "threads.x" file.
2992 (scm_init_thread_procs): New, include "threads.x" here.
2993
2994 * null-threads.h (scm_null_mutex, scm_null_mutex_init,
2995 scm_null_mutex_lock, scm_null_mutex_unlock,
2996 scm_null_mutex_destroy, scm_null_condvar, scm_null_condvar_init,
2997 scm_null_condvar_wait, scm_null_condvar_signal,
2998 scm_null_condvar_destroy): Removed.
2999 (scm_mutex_init, scm_mutex_lock, scm_mutex_unlock, scm_cond_init,
3000 scm_cond_wait, scm_cond_signal, scm_cond_broadcast,
3001 scm_cond_destory): Do not define, they are now deprecated and
3002 handled by threads.{h,c}.
3003
3004 * null-threads.c (scm_null_mutex, scm_null_cond): Define here.
3005 (scm_threads_init): Create smobs here, using the appropriate
3006 sizes.
3007 (block): Removed, now unused.
3008 (scm_c_thread_exited_p): New.
3009 (scm_null_mutex_init, scm_null_mutex_lock, scm_null_mutex_unlock,
3010 scm_null_mutex_destroy, scm_null_condvar_init,
3011 scm_null_condvar_wait, scm_null_condvar_signal,
3012 scm_null_condvar_destroy): Removed and updated users to do their
3013 task directly.
3014 (scm_try_mutex, timeval_subtract,
3015 scm_timed_wait_condition_variable,
3016 scm_broadcast_condition_variable): New.
3017 (scm_wait_condition_variable): Removed.
3018
3019 * coop-defs.h (coop_m): Added 'level' field.
3020 (scm_t_mutex, scm_mutex_init, scm_mutex_lock, scm_mutex_trylock,
3021 scm_mutex_unlock, scm_mutex_destroy, scm_t_cond, scm_cond_init,
3022 scm_cond_wait, scm_cond_timedwait, scm_cond_signal,
3023 scm_cond_broadcast, scm_cond_destroy, struct timespec): Do not
3024 define.
3025 (coop_condition_variable_broadcast): New.
3026
3027 * coop-threads.c (scm_threads_init): Create smobs here, using the
3028 appropriate sizes.
3029 (scm_c_thread_exited_p, scm_try_mutex,
3030 scm_timed_wait_condition_variable,
3031 scm_broadcast_condition_variable): New.
3032 (scm_wait_condition_variable): Removed.
3033
3034 * coop.c (coop_new_mutex_init): Initialize level.
3035 (coop_mutex_trylock, coop_mutex_lock, coop_mutex_unlock): maintain
3036 level.
3037 (coop_condition_variable_signal): Renamed to
3038 coop_condition_variable_broadcast and reimplemented in terms of
3039 that. Thus...
3040 (coop_condition_variable_broadcast): New.
3041
3042 * goops.c (hell_mutex): Reimplemented using scm_make_mutex, etc.
3043
3044 * coop-pthreads.h, coop-pthreads.c: New, but unfinished.
3045
087ed40d
MV
30462002-10-21 Marius Vollmer <mvo@zagadka.ping.de>
3047
65a23095
MV
3048 * null-threads.c: Include <time.h>. Also, use <...> for inclusion
3049 of system headers.
3050
087ed40d
MV
3051 * async.c, goops.h, modules.h, validate.h (SCM_MAKE_VALIDATE_MSG):
3052 New. Use it instead of SCM_MAKE_VALIDATE in lots of places to
30f920c3 3053 give better error messages. Thanks to Bill Schottstaedt!
087ed40d 3054
5ec1d2c8
DH
30552002-10-19 Dirk Herrmann <D.Herrmann@tu-bs.de>
3056
3057 * evalext.h, evalext.c (scm_definedp, scm_defined_p): Renamed
3058 scm_definedp to scm_defined_p and deprecated scm_definedp.
3059
100ae50d
DH
30602002-10-19 Dirk Herrmann <D.Herrmann@tu-bs.de>
3061
3062 * async.h, async.c (scm_system_async): Fixed deprecation to work
3063 correctly when deprecated features are excluded.
3064
2794cb50
MV
30652002-10-16 Marius Vollmer <marius.vollmer@uni-dortmund.de>
3066
3067 * async.c (scm_system_async_mark_for_thread): Validate thread
3068 argument.
3069
3070 * coop-threads.c (scm_i_thread_root): Do not validate argument.
3071
3072 * feature.c (scm_init_feature): Don't add 'threads' for
3073 USE_NULL_THREADS.
3074
3075 * inline.h (scm_cell, scm_double_cell): Also allow
3076 USE_NULL_THREADS to not protect the slot initializers.
3077
3078 * scmsigs.c (scm_sigaction_for_thread): It's "USE_THREADS" not
3079 "USE_THREAD".
3080
3081 * Makefile.am (noinst_HEADERS): Added null-threads.c.
3082 (modinclude_HEADERS): Added null-threads.h.
3083
3084 * threads.h: Include null-threads.h when !USE_COOP_THREADS.
3085 * threads.c: Include null-threads.c when !USE_COOP_THREADS.
3086 (scm_init_threads): Use generic type names scm_t_mutex and
3087 scm_t_cond instead of coop_m and coop_c.
3088
3089 * null-threads.c, null-threads.h: New files.
3090
ff810d7a
MV
30912002-10-15 Marius Vollmer <mvo@zagadka.ping.de>
3092
3093 * Makefile.am: Replaced "$<" in non-pattern rules with its value.
3094 This is to support makes that know about "$<" only in pattern
3095 rules, like Sun's make.
3096
a90bdb73
MV
30972002-10-13 Marius Vollmer <mvo@zagadka.ping.de>
3098
3099 * Makefile.am (libpath.h): Fixed typo in top_srcdir_absolute
3100 substitution. Thanks to David Allouche!
3101
e71a8bf2
DH
31022002-10-13 Dirk Herrmann <D.Herrmann@tu-bs.de>
3103
3104 * evalext.h: Replaced SCM_DEBUG_DEPRECATED with
3105 !SCM_ENABLE_DEPRECATED.
3106
41f77ff5
MV
31072002-10-11 Marius Vollmer <marius.vollmer@uni-dortmund.de>
3108
504d99c5 3109 * async.c (scm_system_async_mark_for_thread): Only call
41f77ff5
MV
3110 scm_i_thread_root when USE_THREADS is defined. Use scm_root
3111 otherwise.
3112
3113 * scmsigs.c (take_signal): Only call scm_i_thread_root when
3114 USE_THREADS is defined. Use scm_root otherwise.
3115 (scm_sigaction_for_thread): Ignore THREAD argument when
3116 USE_THREADS is not defined. Also, move THREAD argument defaulting
3117 out of HAVE_SIGACTION section, which was a bug.
3118
6d16b125
MV
31192002-10-10 Marius Vollmer <marius.vollmer@uni-dortmund.de>
3120
3121 * scmsigs.c (scm_sigaction_for_thread): Store original handler in
3122 signal_handlers, not the closure that is used as the async.
3123 The closure is stored in signal_handler_cells, as previously.
3124
acfa1f52
MV
31252002-10-10 Marius Vollmer <mvo@zagadka.ping.de>
3126
3127 * root.h (scm_root_state): Added 'block_async' slot.
3128 (scm_active_asyncs): Removed abbrev.
3129 * root.c (scm_make_root): Initialize 'block_asyncs' slot.
3130
3131 * __scm.h (SCM_ASYNC_TICK): Do without the scm_active_asyncs
3132 abbrev.
3133
3134 * async.h (scm_call_with_blocked_asyncs,
3135 scm_call_with_unblocked_asyncs, scm_c_call_with_blocked_asyncs,
3136 scm_c_call_with_unblocked_asyncs): New prototypes.
3137 (scm_mask_signals, scm_unmask_signals): Deprecated.
3138 (scm_mask_ints): Turned into a macro.
3139 * async.c (scm_mask_ints): Removed.
3140 (scm_run_asyncs): Do not set scm_mask_ints while running an async.
3141 this should not be necessary.
3142 (scm_async_click): Test block_asyncs instead of scm_mask_ints.
3143 (scm_mask_signals, scm_unmask_signals): Deprecated. Emit
3144 deprecation warning and check for errornous use. Set block_asyncs
3145 instead of scm_mask_ints.
3146 (increase_block, decrease_block, scm_call_with_blocked_asyncs,
3147 scm_call_with_unblocked_asyncs, scm_c_call_with_blocked_asyncs,
3148 scm_c_call_with_unblocked_asyncs): New.
3149
3150 * script.c (scm_compile_shell_switches): Do not set scm_mask_ints.
3151 Asyncs are enabled by default.
3152
34010f56
NJ
31532002-10-09 Neil Jerram <neil@ossau.uklinux.net>
3154
3155 * vports.c (scm_make_soft_port): Allow vector argument to carry a
3156 6th element: an input waiting thunk.
3157 (sf_input_waiting): New.
3158
9310d6f2
MV
31592002-10-05 Marius Vollmer <mvo@zagadka.ping.de>
3160
3161 * root.c (root_mark): Mark active_asyncs slot.
3162
3163 * async.c (scm_async_click): Set the cdr of a executed handler
3164 cell to SCM_BOOL_F, not SCM_EOL.
3165 (scm_i_queue_async_cell): Queue the cell at the end of the list,
3166 and only if the handler procedure is not already present.
3167 (scm_system_async_mark_for_thread): Initialize cdr of handler cell
3168 with SCM_BOOL_F.
3169 * scmsigs.c (scm_sigaction_for_thread): Likewise.
3170
ac48c719
RB
31712002-10-04 Rob Browning <rlb@defaultvalue.org>
3172
1360a142
RB
3173 * guile.c (main): switch to scm_lt_dlset_preloaded_symbols;
3174
3175 * dynl.c (sysdep_dynl_link): switch to scm_lt_dlhandle,
3176 scm_lt_dlopenext, and scm_lt_dlerror.
3177 (sysdep_dynl_unlink): switch to scm_lt_dlhandle, scm_lt_dlclose,
3178 and scm_lt_dlerror.
3179 (sysdep_dynl_func): switch to scm_lt_dlhandle, scm_lt_dlsym,
3180 and scm_lt_dlerror.
3181 (sysdep_dynl_init): switch to scm_lt_dlinit();
3182
3183 * Makefile.am (libguile_la_LIBADD): switch to use
3184 libguile-ltdl.la.
3185
504d99c5 3186 * numbers.c (scm_integer_expt): (expt 0 1) should be 1.
ac48c719 3187
497092c9
MV
31882002-10-04 Marius Vollmer <mvo@zagadka.ping.de>
3189
3190 * scmsigs.h (scm_sigaction_for_thread): New prototype.
3191 * scmsigs.c (got_signal): Removed.
3192 (signal_handler_cells, signal_handler_threads): New.
3193 (take_signal): Queue the cell of the signal for the specified
3194 thread. Reset the signal handler on systems that don't have
3195 sigaction.
3196 (sys_deliver_signals): Removed.
3197 (close_1): New.
3198 (scm_sigaction_for_thread): Renamed from scm_sigaction and
3199 extended to also set the thread of a signal and allocate a cell
3200 for it. Keep the Scheme name "sigaction". Check that signum is
3201 within range. Also, use SCM_VECTOR_REF instead of SCM_VELTS.
3202 (scm_sigaction): Implement in terms of scm_sigaction_for_thread.
3203 (scm_init_scmsigs): Allocate signal_handler_cells and
3204 signal_handler_threads vectors.
3205
3206 * async.c: Removed GUILE_OLD_ASYNC_CLICK code. Reorganized so
3207 that system asnycs and user asyncs are separated. Reimplemented
3208 system asyncs to work per-thread.
3209
3210 * gc.c (scm_init_gc): Do not use scm_system_async.
3211
3212 * async.h (scm_asyncs_pending, scm_set_tick_rate,
3213 scm_set_switch_rate, scm_system_async_mark_from_signal_handler):
3214 Removed prototypes.
3215 (scm_i_queue_async_cell): New.
3216
3217 * __scm.h (scm_asyncs_pending_p): Removed.
3218 (SCM_ASYNC_CLICK): Check scm_active_asyncs instead of
3219 scm_asyncs_pending_p.
3220
3221 * async.h (scm_system_async_mark_for_thread): New prototype.
3222
3223 * __scm.h: Removed GUILE_OLD_ASYNC_CLICK code.
3224
3225 * root.h (scm_root_state): Added new "active_asyncs" slot.
3226 * root.c (scm_make_root): Initialize it to SCM_EOL.
3227
3228 * coop-defs.h (coop_t): Added new "handle" slot.
3229 * coop-threads.c (all_threads, scm_current_thread,
3230 scm_all_threads, scm_i_thread_root): New.
3231 (scm_threads_init): Add main thread to all_threads.
3232 (scheme_launch_thread): Remove thread from all_threads when it
3233 terminates.
3234 (scm_call_with_new_thread): Initialize handle slot of coop_t
3235 structure and add new thread to all_threads.
3236 (scm_spawn_thread): Likewise.
3237
3238 * threads.h (scm_current_thread, scm_all_threads): New prototypes.
3239 * threads.c (scm_current_thread, scm_all_threads): Register as
3240 primitives.
3241
3242 * dynl.c: Use scm_lt_ prefix for libltdl functions.
3243
480fa28d
NJ
32442002-09-29 Neil Jerram <neil@ossau.uklinux.net>
3245
3246 * script.c (scm_compile_shell_switches): Fix bad spelling of
3247 `explicitly' in comment.
3248
32492002-09-28 Neil Jerram <neil@ossau.uklinux.net>
3250
3251 * posix.c (scm_geteuid, scm_getegid, scm_seteuid, scm_setegid):
3252 Refer to provided? in doc string rather than deprecated feature?.
3253
3553e1d1
GH
32542002-09-24 Gary Houston <ghouston@arglist.com>
3255
3256 * inline.h (scm_double_cell): prevent reordering of statements
3257 with any following code (for GCC 3 strict-aliasing).
3258 * numbers.c (scm_make_real), num2float.i.c (FLOAT2NUM): removed
3259 the earlier version of the reordering prevention.
3260
4ad0814a
HWN
32612002-09-19 Han-Wen Nienhuys <hanwen@cs.uu.nl>
3262
3263 * inline.h (scm_double_cell): move SET_GCMARK set out of if body.
3264
e88e4f2e
HWN
32652002-09-09 Han-Wen Nienhuys <hanwen@cs.uu.nl>
3266
3267 * gc-malloc.c (scm_gc_register_collectable_memory): more overflow
3268 protection.
3269
1e71eafb
HWN
32702002-09-08 Han-Wen Nienhuys <hanwen@cs.uu.nl>
3271
3272 * inline.h: include stdio.h
3273
3274 * smob.c (free_print): abort if scm_debug_cell_accesses_p is set
3275
61ef9c1f
HWN
32762002-09-05 Han-Wen Nienhuys <hanwen@cs.uu.nl>
3277
dac04e9f
HWN
3278 * gc-segment.c (scm_i_make_initial_segment): check user settings
3279 for sanity.
3280
3281 * gc-malloc.c (scm_gc_init_malloc): check user settings for
3282 sanity.
dac04e9f
HWN
3283
3284 * gc-freelist.c (scm_init_freelist): check user settings for sanity.
3285
ffd72400
HWN
3286 * struct.h: change scm_structs_to_free to scm_i_structs_to_free
3287
3288 * gc-malloc.c (scm_gc_register_collectable_memory): use floats;
1e71eafb
HWN
3289 these won't ever wrap around with high memory usage. Thanks to
3290 Sven Hartrumpf for finding this.
ffd72400 3291
5bd4a949
HWN
3292 * gc-freelist.c: include <stdio.h>
3293
61ef9c1f
HWN
3294 * gc-malloc.c: add DEBUGINFO for mtrigger GCs.
3295
ffd0ef3b
MV
32962002-09-01 Marius Vollmer <mvo@zagadka.ping.de>
3297
a27e3d14
MV
3298 * vectors.h (SCM_VECTOR_REF): New.
3299
ffd0ef3b
MV
3300 * snarf.h (SCM_DEFINE_PUBLIC): New.
3301
f8a1712b
MV
33022002-08-30 Marius Vollmer <mvo@zagadka.ping.de>
3303
3304 * socket.c (scm_addr_vector): Added size of address to arguments.
3305 Use it to avoid accessing a non-existent path in a sockaddr_un.
3306 Changed all callers.
3307
7200a36b
HWN
33082002-08-29 Han-Wen Nienhuys <hanwen@cs.uu.nl>
3309
1383773b
HWN
3310 * gc.h: remove DOUBLECELL card flags.
3311
3312 * gc-malloc.c (scm_calloc): try to use calloc() before calling
3313 scm_realloc().
3314
3315 * gc-segment.c (scm_i_initialize_heap_segment_data): remove card
3316 init loop; handle this from scm_init_card_freelist()
3317
3318 * gc-card.c (scm_init_card_freelist): init bit vector here.
3319
7200a36b 3320 * numbers.c (scm_make_real): prevent reordering of statements
8fa5786d 3321 num2float.i.c (FLOAT2NUM): idem
7200a36b 3322
9981de3a
HWN
33232002-08-27 Han-Wen Nienhuys <hanwen@cs.uu.nl>
3324
3325 * eval.h: prepend libguile/ to include path
3326
19647556
MV
33272002-08-26 Marius Vollmer <mvo@zagadka.ping.de>
3328
3329 * script.c (scm_compile_shell_switches): Added "2002" to Copyright
3330