(make-polar, magnitude): New tests.
[bpt/guile.git] / libguile / ChangeLog
CommitLineData
cbfe8e62
HWN
12003-07-06 Han-Wen Nienhuys <hanwen@cs.uu.nl>
2
3 * gc-malloc.c (decrease_mtrigger): new function
4 (increase_mtrigger): new function, separate debug registering and
5 mtrigger administration.
6 (scm_gc_realloc): bugfix: do mtrigger administration before the
7 actual realloc, for the realloc might invalidate a GC-d segment of
8 memory. Thanks to Sam Hocevar for pointing this out.
9 (scm_gc_realloc): use scm_malloc_reregister instead of
10 unregistering and registering in sequence.
11
aeb4c2e1
HWN
122003-07-03 Han-Wen Nienhuys <hanwen@cs.uu.nl>
13
14 * __scm.h (SCM_ASSERT): change "else" expansion to "do { } while (0)"
15
4c27f8d2
HWN
162003-07-02 Han-Wen Nienhuys <hanwen@cs.uu.nl>
17
18 * __scm.h (SCM_ASRTGO): add "else" to macro expansions with if
19 clauses.
20
983e697d
MV
212003-06-29 Marius Vollmer <mvo@zagadka.de>
22
23 * deprecated.h (SCM_OPDIRP, scm_fport, scm_option, scm_srcprops,
24 scm_srcprops_chunk, scm_info_frame, scm_stack, scm_array,
25 scm_array_dim, SCM_ARRAY_CONTIGUOUS, SCM_FUNC_NAME, SCM_WTA,
26 RETURN_SCM_WTA, SCM_VALIDATE_NUMBER_COPY,
27 SCM_VALIDATE_NUMBER_DEF_COPY, SCM_VALIDATE_OPDIR): Re-added from
28 the release_1_6 branch.
29
78b6566e
SJ
302003-06-25 Stefan Jahn <stefan@lkcc.org>
31
32 * continuations.c: Redeclaration of getcontext() via the
33 __asm__ ("getcontext") directive.
34
35 * continuations.h: Include <ucontext.h> instead of
36 <sys/ucontext.h>.
37
1ebb8497
KR
382003-06-21 Kevin Ryde <user42@zip.com.au>
39
40 * numbers.c (_GNU_SOURCE): #define, to get C99 things.
41 (scm_asinh, scm_acosh, scm_atanh, scm_truncate, $asinh, $acosh,
42 $atanh, truncate): Use C library asinh, acosh, atanh and trunc, when
43 available.
44 (scm_inexact_to_exact): Expand isfinite to its definition !xisinf.
45 (isfinite): Remove, conflicts with C99 isfinite().
46
fbf85ba4
MV
472003-06-19 Marius Vollmer <mvo@zagadka.de>
48
49 * deprecated.h, deprecated.c (scm_strhash, scm_sym2ovcell_soft,
50 scm_sym2ovcell, scm_intern_obarray_soft, scm_intern_obarray,
51 scm_symbol_value0, scm_string_to_obarray_symbol scm_intern_symbol,
52 scm_unintern_symbol, scm_symbol_binding, scm_symbol_interned_p,
53 scm_symbol_bound_p, scm_symbol_set_x, scm_gentemp): Re-added from
54 the release_1_6 branch.
55
fcc5d734
SJ
562003-06-14 Stefan Jahn <stefan@lkcc.org>
57
58 * threads.h: Redefined scm_getspecific() and scm_setspecific()
59 to be functions instead of macros.
60
61 * threads.c: Conditionalized inclusion of <sys/time.h> and
62 <unistd.h>.
63 (scm_getspecific, scm_setspecific): Made these two function
64 real part of the API.
65
66 * posix.c (s_scm_putenv): Added some code to make a
67 (putenv "FOO="), i.e. setting an empty string, work also on
68 Win32 systems. Thanks to Kevin Ryde for the proposal.
69
c3ae8e07
KR
702003-06-12 Kevin Ryde <user42@zip.com.au>
71
75b14838
KR
72 * posix.c (scm_putenv): Free temporary ptr in mingw unset. Add
73 freebsd to comment about need to use unsetenv.
c3ae8e07 74
9d9fa092
MV
752003-06-02 Marius Vollmer <mvo@zagadka.de>
76
77 * ports.c (scm_peek_char): Safe the column of the port around the
78 getc/ungetc calls. Thanks to Dr. Peter Ivanyi!
79
f2478375
KR
802003-06-07 Kevin Ryde <user42@zip.com.au>
81
82 * tags.h: Use inttypes.h and stdint.h when available, for INTPTR_MAX
83 and friends required by scm_t_bits setups.
84
6375e040
DH
852003-06-06 Dirk Herrmann <D.Herrmann@tu-bs.de>
86
87 * tags.h (scm_tc2_int): Added.
88
89 * tags.h (scm_tc3_int_1, scm_tc3_int_2): Expressed in terms of
90 scm_tc2_int.
91
92 * tags.h (scm_tcs_cons_imcar, scm_tcs_cons_nimcar, scm_tcs_struct,
93 scm_tcs_closures): Hard coded values replaced by symbolic ones.
94
f5c6ec2f
DH
952003-06-05 Dirk Herrmann <D.Herrmann@tu-bs.de>
96
97 * eval.c: Partially undid my patch from 2003-05-31. This patch
98 caused the segfault referenced in the previous changelog entry.
99
47dbd81e
DH
1002003-06-05 Dirk Herrmann <D.Herrmann@tu-bs.de>
101
102 * tags.h: Fixed comment about the immediate type code layout.
103
104 * eval.c: Fixed handling of non-special instructions. Without
105 this patch, guile will segfault on (#\0) and similar instructions.
106
3ec52c51
KR
1072003-06-05 Kevin Ryde <user42@zip.com.au>
108
109 * numbers.c (scm_max, scm_min): For inum, bignum and real, if other
110 operand is NaN, then return NaN. Also avoid passing NaN to mpz_cmp_d.
111
e418bd7c
KR
112 * read.c (scm_input_error): Pass arg list parameter to scm_error_scm,
113 rather than SCM_EOL. Needed by "Unknown # object" case in scm_lreadr.
114
d0624e39
DH
1152003-06-04 Dirk Herrmann <D.Herrmann@tu-bs.de>
116
117 * __scm.h, gc-card.c (SCM_DEBUG_DEBUGGER_SUPPORT,
118 SCM_DEBUG_DEBUGGING_SUPPORT): Renamed macro
119 SCM_DEBUG_DEBUGGER_SUPPORT to SCM_DEBUG_DEBUGGING_SUPPORT and
120 generalized it to apply not only to C level functions but also to
121 scheme level functions.
122
123 * debug.c, debug.h, eval.c (make-iloc, scm_make_iloc, iloc?,
124 scm_iloc_p, dbg-make-iloc, scm_dbg_make_iloc, dbg-iloc?,
125 scm_dbg_iloc_p): Moved functions scm_make_iloc, scm_iloc_p to
126 eval.c, made them available under SCM_DEBUG_DEBUGGING_SUPPORT == 1
127 only and renamed them to scm_dbg_make_iloc, scm_dbg_iloc_p,
128 respectively.
129
130 * deprecated.h, eval.c, eval.h (SCM_ILOC00, SCM_IDINC,
131 SCM_IDSTMSK): Deprecated. The macro definitions are moved from
132 eval.h into eval.c and a copy is placed into deprecated.h.
133
134 * eval.c, eval.h (SCM_MAKE_ILOC): Removed from eval.h and placed
135 into eval.c. This definition was not part of the API in any
136 officially released version of guile and thus does not need to go
137 through a phase of deprecation.
138
e90c3a89
DH
1392003-06-02 Dirk Herrmann <D.Herrmann@tu-bs.de>
140
d0624e39
DH
141 * deprecated.c, deprecated.h, eval.c, eval.h (scm_s_expression,
142 scm_s_test, scm_s_body, scm_s_bindings, scm_s_variable,
143 scm_s_clauses, scm_s_formals): Deprecated. In eval.c the
e90c3a89
DH
144 definitions are make static and renamed from scm_s_xxx to s_xxx.
145 In deprecated.c the original definitions are copied.
146
d0624e39
DH
147 * deprecated.h, eval.c, eval (SCM_EVALIM2, SCM_EVALIM, SCM_XEVAL,
148 SCM_XEVALCAR): Deprecated. The macro definitions are moved from
e90c3a89
DH
149 eval.h into eval.c and a copy (slightly modified to work in user
150 code) is placed into deprecated.h.
151
152 * eval.c: Use the local static s_xxx definitions instead of the
153 scm_s_xxx definitions throughout.
154
14b18ed6
DH
1552003-06-01 Dirk Herrmann <D.Herrmann@tu-bs.de>
156
157 This set of patches separates the representation of the cxr family
158 of functions (car, cdr etc.) from the dsubr family of functions
159 (i. e. functions that take a double precision floating point
160 argument). Further, the algorithm for handling the cxr function
161 is improved.
162
163 * eval.c (SCM_CEVAL, SCM_APPLY, scm_trampoline_1), numbers.c
164 (scm_asinh, scm_acosh, scm_atanh, scm_truncate, scm_round, floor,
165 ceil, sqrt, fabs, exp, log, sin, cos, tan, asin, acos, atan, sinh,
166 cosh, tanh), objects.c (scm_class_of), procprop.c
167 (scm_i_procedure_arity), ramap.c (scm_array_map_x), tags.h
168 (scm_tc7_dsubr, scm_tcs_subrs): Introduce scm_tc7_dsubr as new
169 typecode for the dsubr family of functions.
170
171 * ramap.c (ramap_cxr, ramap_dsubr): Renamed ramap_cxr to
172 ramap_dsubr.
173
174 * eval.c (SCM_CEVAL, SCM_APPLY, call_cxr_1), pairs.c
175 (scm_init_pairs): Make use of the (now usable) second cell element
176 of a scm_tc7_cxr function to implement the cxr family of functions
177 more efficiently.
178
2ca0d207
DH
1792003-05-31 Dirk Herrmann <D.Herrmann@tu-bs.de>
180
181 * eval.c (SCM_CEVAL, SCM_APPLY, scm_trampoline_0,
182 scm_trampoline_1, scm_trampoline_2): Postpone error cases to the
183 end of an if-else-if-sequence of checks.
184
9a069bdd
DH
1852003-05-30 Dirk Herrmann <D.Herrmann@tu-bs.de>
186
187 * eval.c (SCM_CEVAL): Improved readability of call-with-values
188 execution. Generalize apply_closure to apply_proc and use that
189 for call-with-values.
190
e910e9d2
DH
1912003-05-30 Dirk Herrmann <D.Herrmann@tu-bs.de>
192
193 * eval.c (SCM_CEVAL): Avoid one level of indirection when applying
194 a non closure.
195
1e498fbd
SJ
1962003-05-30 Stefan Jahn <stefan@lkcc.org>
197
198 * posix.c (s_scm_putenv): Use the new HAVE_UNSETENV
199 appropriately for mingw32 hosts.
200
201 * numbers.h: Defining copysign(), isnan() and finite() to
202 be prefixed by a single '_' for mingw32 hosts.
203
c47e2599
KR
2042003-05-30 Kevin Ryde <user42@zip.com.au>
205
206 * numbers.c (z_negative_one): New variable.
207 (scm_init_numbers): Initialize it.
208 (scm_logcount): Use it and mpz_hamdist to count zeros for negatives.
209
2e945bcc
SJ
2102003-05-29 Stefan Jahn <stefan@lkcc.org>
211
212 * win32-dirent.c: Use malloc() instead of scm_malloc().
213
214 * stime.c (s_scm_strftime): Add a type cast to avoid compiler
215 warning.
216
217 * posix.c (s_scm_putenv): Disable use of unsetenv() for the
218 mingw32 build.
219
220 * modules.c (s_scm_module_import_interface): Renamed local
221 variable interface to _interface. Seems like 'interface'
222 is a special compiler directive for the mingw32 compiler.
223
224 * mkstemp.c: Provide prototype to avoid compiler warning.
225
226 * load.c (s_scm_search_path): Fixed absolute and relative
227 path detections for native Windows platforms.
228
229 * gc.h, threads.h: Export some more symbols using SCM_API (necessary
230 to build on mingw32).
231
232 * gc-freelist.c ("s_scm_map_free_list",
233 "s_scm_gc_set_debug_check_freelist_x"): Fixed use of FUNC_NAME.
234
235 * fports.c (fport_fill_input): Disable use of
236 fport_wait_for_input() on Win32 platforms.
237
238 * filesys.c (s_scm_basename): Fixed __MINGW32__ code.
239
240 * Makefile.am: Modified some rules for cross compiling.
241
ddd8f927
DH
2422003-05-25 Dirk Herrmann <D.Herrmann@tu-bs.de>
243
244 * eval.c (SCM_CEVAL): In case of an application, all checks for a
245 proper function object and the correct number of arguments are now
246 performed in the application part of SCM_CEVAL.
247
248 (scm_badformalsp): Removed.
249
f8ba2197
DH
2502003-05-25 Dirk Herrmann <D.Herrmann@tu-bs.de>
251
252 * deprecated.c (scm_read_and_eval_x): Fixed C99-ism.
253
79f55b7c
MD
2542003-05-22 Mikael Djurfeldt <djurfeldt@nada.kth.se>
255
a502595f
MD
256 * num2integral.i.c (NUM2INTEGRAL): Avoid warning about conditional
257 always being false by inserting preprocessor conditional. (Thanks
258 to Bruce Korb.)
259
79f55b7c
MD
260 * __scm.h (SCM_STACK_PTR): New macro. (Cast argument through
261 (void *) in order to avoid an aliasing warning; thanks to Bruce
262 Korb.)
263
264 * stackchk.h (SCM_STACK_OVERFLOW_P): Use SCM_STACK_PTR.
265
266 * threads.c (suspend, launch_thread, scm_threads_mark_stacks): Use
267 SCM_STACK_PTR.
268
269 * threads.c (scm_threads_mark_stacks): Bugfix: Changed
270 thread->base --> t->base.
271
272 * eval.c (SCM_CEVAL): Don't cast argument of SCM_STACK_OVERFLOW_P.
273
47dee228
MV
2742003-05-20 Marius Vollmer <marius.vollmer@uni-dortmund.de>
275
276 * deprecated.h, deprecated.c (scm_makstr, scm_makfromstr,
277 scm_variable_set_name_hint, scm_builtin_variable,
278 scm_internal_with_fluids, scm_make_gsubr,
279 scm_make_gsubr_with_generic, scm_create_hook, SCM_LIST0,
280 SCM_LIST1, SCM_LIST2, SCM_LIST3, SCM_LIST4, SCM_LIST5, SCM_LIST6,
281 SCM_LIST7, SCM_LIST8, SCM_LIST9, scm_listify, scm_sloppy_memq,
85494587
MV
282 scm_sloppy_memv, scm_sloppy_member, scm_read_and_eval_x,
283 scm_subr_entry, SCM_SUBR_DOC, scm_make_subr,
284 scm_make_subr_with_generic, scm_make_subr_opt,
285 scm_call_catching_errors, scm_make_smob_type_mfpe,
286 scm_set_smob_mfpe, scm_strprint_obj, scm_read_0str, scm_eval_0str,
287 SCM_CHARS, SCM_UCHARS, SCM_LENGTH): Re-added from the release_1_6
288 branch. Some have been slightly rewritten.
289 (scm_i_object_chars, scm_i_object_length): New, to support
290 SCM_CHARS, SCM_UCHARS, and SCM_LENTH.
291
e681d187
DH
2922003-05-19 Dirk Herrmann <D.Herrmann@tu-bs.de>
293
294 * eval.c (scm_m_do, unmemocopy, SCM_CEVAL): Reversed order of
295 names and inits in the memoized code of do.
296
7e59d9d4
MD
2972003-05-19 Mikael Djurfeldt <djurfeldt@nada.kth.se>
298
299 * c-tokenize.lex (yyget_lineno, yyget_in, yyget_out, yyget_leng,
300 yyget_text, yyset_lineno, yyset_in, yyset_out, yyget_debug,
301 yyset_debug, yylex_destroy): Added prototypes (otherwise we'll get
302 a compilation error if error-on-warning is enabled).
303
9d9fa092 304>>>>>>> 1.1883
9950a42c
MV
3052003-05-17 Marius Vollmer <mvo@zagadka.de>
306
307 * c-tokenize.lex: Gobble up complete lines after a '#'. This
308 removes preprocessor directives from the snarfage that might
309 otherwise confuse us. These directives appear when compiling with
310 "-g3", for example.
311
0068984b
HWN
3122003-05-16 Han-Wen Nienhuys <hanwen@cs.uu.nl>
313
26e68795
HWN
314 * ChangeLog: add my surname
315
0068984b
HWN
316 * srcprop.c (scm_finish_srcprop): use
317 scm_gc_register_collectable_memory()
318 (scm_make_srcprops): idem.
319
131805f0
HWN
3202003-05-14 Han-Wen Nienhuys <hanwen@cs.uu.nl>
321
322 * gc-malloc.c (scm_gc_register_collectable_memory): avoid
323 wrap-around for scm_mtrigger
324 (scm_gc_register_collectable_memory): abort on overflowing
325 scm_mallocated().
326
d4611024
KR
3272003-05-13 Kevin Ryde <user42@zip.com.au>
328
329 * numbers.c (xmpz_cmp_d): New macro, handling infs if gmp doesn't.
330 (scm_num_eq_p, scm_less_p, scm_max, scm_min): Use it.
331
7aaf8dc9
MD
3322003-05-12 Mikael Djurfeldt <djurfeldt@nada.kth.se>
333
dfd03fb9
MD
334 * backtrace.c (scm_display_error_message): Introduced fancy
335 printing with max level 7 and length 10. (Purpose: avoid printing
336 gigantic objects in error messages.)
337
338 * print.c, print.h (scm_i_port_with_print_state): New function.
339
340 * print.c (scm_iprin1, scm_printer_apply,
341 scm_port_with_print_state): Use scm_i_port_with_print_state.
342 (scm_simple_format): Modified not to destroy print states.
343 (print_state_mutex): New mutex.
344 (scm_make_print_state, scm_free_print_state, scm_prin1):
345 Lock/unlock print_state_mutex.
346
7aaf8dc9
MD
347 * deprecated.h (SCM_GC8MARKP, SCM_SETGC8MARK, SCM_CLRGC8MARK):
348 Use current names in definitions.
349
a4d9ffa1
KR
3502003-05-10 Kevin Ryde <user42@zip.com.au>
351
352 * numbers.c (scm_num_eq_p, scm_less_p): Don't pass NaN to mpz_cmp_d.
353
d25e96a4
KR
354 * numbers.c (scm_integer_length): On negative bignums, adjust
355 mpz_sizeinbase to account for it looking at absolute value where we
356 want ones-complement.
357
358 * numbers.c (scm_gcd): In bignum/inum, don't pass yy==0 to mpz_gcd_ui
359 since we're only using the ulong return value, and x might not fit.
360
5bf6a6f0
DH
3612003-05-06 Dirk Herrmann <D.Herrmann@tu-bs.de>
362
363 * eval.c, eval.h, read.c, read.h (scm_sym_dot): Moved from eval to
364 read. This will allow to make the definition in read.c static.
365
f58c472a
DH
3662003-05-06 Dirk Herrmann <D.Herrmann@tu-bs.de>
367
368 * eval.c, eval.h, evalext.c, evalext.h (scm_m_undefine): Moved
369 from evalext to eval. This will allow to make some of the
370 definitions in eval.c static.
371
90382aeb
KR
3722003-05-06 Kevin Ryde <user42@zip.com.au>
373
374 * numbers.c (scm_difference): In inum - bignum, handle negative inum.
375 (scm_logcount): Use mpz_com, not mpz_neg.
376
3b88ed2a
DH
3772003-05-04 Dirk Herrmann <D.Herrmann@tu-bs.de>
378
379 The purpose of this patch is to make guile's internal memoizers
380 distinguishable from memoizing macros created on the scheme level
381 or from user provided primitive memoizing macros. The reason is,
382 that the internal memoizers are the only ones that are allowed to
383 transform their scheme input into memoizer byte code, while all
384 other memoizing macros may only transform scheme code into new
385 scheme code.
386
387 To achieve this, a new macro type 'builtin-macro!' is introduced.
388 Currently, 'builtin-macro!'s are handled as memoizing macros, but
389 this will change when the memoizer and executor are separated.
390
391 * macros.[ch] (scm_i_makbimacro): New.
392
393 * macros.h (SCM_BUILTIN_MACRO_P): New.
394
395 * macros.c (macro_print, scm_macro_type): Support builtin-macro!s.
396
397 * eval.c, goops.c: All of guile's primitive memoizing macros are
398 primitive builtin-macros now.
399
400 * eval.c (scm_macroexp, SCM_CEVAL): Make sure the primitive
401 builtin-macros are handled equally to memoizing macros.
402
b0780eb1
MV
4032003-05-04 Marius Vollmer <mvo@zagadka.de>
404
405 * throw.c (scm_ithrow): Remove "asm volatile" hack. It used to
406 work around a bug in GCC 2.95.2 but is now a bug in itself.
407
1cbf4fe9
MV
4082003-05-02 Marius Vollmer <mvo@zagadka.de>
409
410 * deprecated.h (scm_rstate, scm_rng, SCM_SLOPPY_CONSP,
411 SCM_SLOPPY_NCONSP, scm_tc7_ssymbol, scm_tc7_msymbol,
412 scm_tcs_symbols): New.
413
1a61d41b
MV
4142003-04-30 Marius Vollmer <marius.vollmer@uni-dortmund.de>
415
096ecbaf
MV
416 * deprecated.h, deprecated.c (scm_protect_object,
417 scm_unprotect_object, SCM_SETAND_CAR, SCM_SETOR_CAR,
418 SCM_SET_AND_CDR, SCM_SET_OR_CDR, SCM_FREEP, SCM_NFREEP,
419 SCM_GC8MARKP, SCM_SETGC8MARK, SCM_CLRGC8MARK, SCM_GCTYP16,
420 SCM_GCCDR, scm_remember, scm_the_root_module, scm_make_module,
421 scm_ensure_user_module, scm_load_scheme_module, scm_port,
422 scm_ptob_descriptor, scm_port_rw_active,
423 scm_close_all_ports_except): New.
424
1a61d41b
MV
425 * ports.c (scm_c_port_for_each): New function, mostly copied from
426 scm_port_for_each.
427 (scm_port_for_each): Reimplemented using scm_c_port_for_each.
428 * ports.h (scm_c_port_for_each): New prototype.
429
c8e1d354
MD
4302003-04-28 Mikael Djurfeldt <djurfeldt@nada.kth.se>
431
432 * eval.c (scm_m_atdispatch): Removed until actually needed. (This
433 macro was introduced in anticipation of GOOPS method compilation
434 code.)
435
436 * goops.c: Removed binding of @dispatch.
437
a4aa2134
DH
4382003-04-28 Dirk Herrmann <D.Herrmann@tu-bs.de>
439
440 * eval.c, goops.c (@dispatch, @slot-ref, @slot-set!): Move the
441 instructions that bind the macros on the scheme level back to
442 goops.c in order to make sure again that the bindings go into the
443 (oop goops) module and are not visible from the outside.
444
9fbee57e
DH
4452003-04-27 Dirk Herrmann <D.Herrmann@tu-bs.de>
446
447 * eval.c: Non functional change: Separated R5RS and non-R5RS
448 macros into different sections of the file and ordered the
449 memoizers alphabetically.
450
12841895
DH
4512003-04-27 Dirk Herrmann <D.Herrmann@tu-bs.de>
452
453 * eval.c (scm_ilookup): Rewritten to improve readability.
454
6a3f13f0
DH
4552003-04-27 Dirk Herrmann <D.Herrmann@tu-bs.de>
456
457 * eval.c (scm_i_call_closure_0, call_closure_1, call_closure_2):
458 Partially reverted patch from 2003-04-23 in oder to find a better
459 compromise between readability and debuggability.
460
b0c5d67b
DH
4612003-04-25 Dirk Herrmann <D.Herrmann@tu-bs.de>
462
463 * eval.c, eval.h, goops.c, goops.h (scm_m_atslot_ref,
464 scm_m_atslot_set_x, scm_m_atdispatch): Move the declarations and
465 definitions of the special goops memoizers from goops.[ch] to
466 eval.[ch]. Hmm... it seems that scm_m_atdispatch is not used
467 throughout guile.
468
b9ad392e
MD
4692003-04-24 Mikael Djurfeldt <mdj@kvast.blakulla.net>
470
471 * ports.c, ports.h (scm_i_port_table_mutex): New mutex.
472
473 * fports.c (scm_evict_ports): Lock/unlock scm_i_port_table_mutex.
474
475 * ports.c (scm_close_port, scm_flush_all_ports): Ditto.
476
477 * ioext.c (scm_fdes_to_ports): Ditto.
478
479 * vports.c (scm_make_soft_port): Changed SCM_DEFER/ALLOW_INTS into
480 lock/unlock scm_i_port_table_mutex.
481
482 * strports.c (scm_mkstrport): Ditto.
483
484 * ports.c (scm_void_port, scm_port_for_each): Ditto.
485
486 * fports.c (scm_fdes_to_port): Ditto.
487
d0b07b5d
DH
4882003-04-23 Dirk Herrmann <D.Herrmann@tu-bs.de>
489
490 This set of patches contains no functional changes, only debatable
491 minor stylistic ones. Still, in order to prepare a patch between
492 my local copy and the CVS version, I decided to submit the changes
493 below. Then, the patch will hopefully only contain relevant
494 modifications :-)
495
496 * eval.c (iqq): Added const specifier.
497
498 * eval.c (scm_trampoline_0, scm_trampoline_1, scm_trampoline_2):
499 Use NULL instead of 0 to indicate that a pointer is returned.
500 Removed some misleading 'fall through' comments.
501
502 * eval.c (scm_i_call_closure_0, call_closure_1, call_closure_2):
503 Split up long expressions into smaller ones to be more debugging
504 friendly.
505
a98e8e98
DH
5062003-04-23 Dirk Herrmann <D.Herrmann@tu-bs.de>
507
508 * eval.h (SCM_ENTER_FRAME_HDLR, SCM_APPLY_FRAME_HDLR,
509 SCM_EXIT_FRAME_HDLR): Use SCM_PACK to convert data to a SCM value
510 rather than casting to SCM.
511
c178c3a6
DH
5122003-04-23 Dirk Herrmann <D.Herrmann@tu-bs.de>
513
514 * sort.c, pairs.h: Removed unnecessary includes.
515
d339981a
DH
5162003-04-23 Dirk Herrmann <D.Herrmann@tu-bs.de>
517
518 * sort.c: Replaced hand-made trampline code by the new official
519 mechanism from eval.c. This fixes a segfault in the new test file
520 sort.test.
521
522 (quicksort, compare_function, scm_restricted_vector_sort_x,
523 scm_sorted_p, scm_merge, scm_merge_list_x, scm_merge_x,
524 scm_merge_list_step, scm_sort_x, scm_sort, scm_merge_vector_x,
525 scm_merge_vector_step, scm_stable_sort_x, scm_stable_sort,
526 scm_sort_list_x, scm_sort_list): Use trampoline mechanism from
527 eval.c.
528
529 (subr2less, lsubrless, closureless, applyless, scm_cmp_function,
530 cmp_fun_t): Removed.
531
532 (compare_function): Added.
533
534 * sort.c (quicksort, SWAP, stack_node): Replaced pointer
535 arithmetics with index arithmetics. Changed quicksort to work on
536 an array of SCM values instead of an array of characters. Avoid
537 bytewise copying of SCM elements. Avoid allocating memory on the
538 stack with alloca. Fixed some comments.
539
821f18a4
DH
5402003-04-21 Dirk Herrmann <D.Herrmann@tu-bs.de>
541
542 * eval.c (EXTEND_ENV): Eliminated.
543
544 (unmemocopy, SCM_CEVAL, SCM_APPLY): Use SCM_EXTEND_ENV instead of
545 EXTEND_ENV.
546
94fb5a6e
DH
5472003-04-21 Dirk Herrmann <D.Herrmann@tu-bs.de>
548
549 * __scm.h (SCM_DEBUG_DEBUGGER_SUPPORT): New compile-time option.
550
551 * gc.card.c (scm_gc_marked_p): Fixed compiler warning when
552 compiling with SCM_DEBUG==1 by moving definition behind prototype.
553
554 * gc.card.c (scm_dbg_t_list_cell, scm_dbg_t_double_cell,
555 scm_dbg_gc_marked_p, scm_dbg_gc_get_card, scm_dbg_gc_get_bvec,
556 scm_t_list_cell_struct, scm_t_list_cell, scm_t_double_cell,
557 scm_gc_marked_p, scm_gc_get_card, scm_gc_get_bvec): Fixed
558 functions such that they check if the object is a non-immediate.
559 Further, renamed identifiers to use the scm_dbg_ prefix and made
560 their inclusion into the lib dependent of the
561 SCM_DEBUG_DEBUGGER_SUPPORT compile time option.
562
fce0b22d
DH
5632003-04-21 Dirk Herrmann <D.Herrmann@tu-bs.de>
564
565 * __scm.h: Fixed comment about the SCM_DEBUG_TYPING_STRICTNESS
566 debug option.
567
1685446c
DH
5682003-04-21 Dirk Herrmann <D.Herrmann@tu-bs.de>
569
821f18a4 570 * list.c (scm_ilength, scm_last_pair), unif.c (l2ra): Prefer
1685446c
DH
571 !SCM_CONSP over SCM_NCONSP. Now, guile itself does not include
572 any calls to SCM_NCONSP any more.
573
574 * unif.c (l2ra): Eliminate redundant check.
575
9ff1720f
DH
5762003-04-21 Dirk Herrmann <D.Herrmann@tu-bs.de>
577
578 * list.c (scm_cons_star), ramap.c (scm_ra_sum, scm_ra_product,
579 scm_array_map_x), unif.c (l2ra): Prefer !SCM_NULLP over
580 SCM_NNULLP. Now, guile itself does not include any calls to
581 SCM_NNULLP any more.
582
05b15362
DH
5832003-04-21 Dirk Herrmann <D.Herrmann@tu-bs.de>
584
585 * eval.c (unmemocopy, SCM_APPLY, scm_map, scm_for_each,
586 scm_copy_tree): Place assignment expressions which are part of
587 other expressions into an expression of their own.
588
0c88d7df
DH
5892003-04-21 Dirk Herrmann <D.Herrmann@tu-bs.de>
590
591 * goops.c (TEST_CHANGE_CLASS, scm_sys_initialize_object): Don't
592 compare SCM values with !=.
593
5cb22e96
DH
5942003-04-20 Dirk Herrmann <D.Herrmann@tu-bs.de>
595
596 * eval.c, eval.h, evalext.c, evalext.h (scm_sym_setter,
597 scm_m_generalized_set_x, scm_init_evalext): Move the declaration
598 and definition of the memoizer for the generalized set! macro from
599 evalext.[ch] to eval.[ch]. Use the SCM_SYNTAX snarfer macro to
600 define the macro object.
601
602 * eval.c, eval.h (s_set_x, scm_s_set_x, scm_m_set_x,
603 scm_m_generalized_set_x): Since now scm_s_set_x is only used in
604 eval.c, it is made static and renamed to s_set_x.
605
606 * evalext.c (scm_defined_p, scm_m_undefine): Prefer !SCM_<foo>
607 over SCM_N<foo>.
608
a44a9715
DH
6092003-04-20 Dirk Herrmann <D.Herrmann@tu-bs.de>
610
611 * eval.c, root.h (scm_undefineds, SCM_NUM_PROTECTS, undefineds,
612 scm_init_eval): Made scm_undefineds static in eval.c, renamed it
613 to undefineds and registered the object as a permanent object.
614
615 * eval.c, eval.h (scm_f_apply, scm_init_eval): Made scm_f_apply
616 static in eval.c, renamed it to f_apply and registered the object
617 as a permanent object.
618
1b43d24c
DH
6192003-04-20 Dirk Herrmann <D.Herrmann@tu-bs.de>
620
5cb22e96 621 * eval.c (SCM_BIT7, SCM_BIT8, unmemocopy, SCM_CEVAL): Renamed
1b43d24c
DH
622 file-local macro SCM_BIT8 to SCM_BIT7, which is more appropriate.
623
aec16f99
DH
6242003-04-20 Dirk Herrmann <D.Herrmann@tu-bs.de>
625
626 * numbers.c (scm_logtest): Fixed argument bug in the call to
627 mpz_and, which showed up when compiling with SCM_DEBUG defined.
628
f96460ce
DH
6292003-04-20 Dirk Herrmann <D.Herrmann@tu-bs.de>
630
631 * gc-card.c (scm_i_sweep_card, scm_i_init_card_freelist): Fixed
632 type errors that showed up when compiling with SCM_DEBUG defined.
633
d0f6ceb8
DH
6342003-04-20 Dirk Herrmann <D.Herrmann@tu-bs.de>
635
636 * continuations.c, continuations.h, eval.c, eval.h, extensions.c,
637 gsubr.c, guile.c, init.c, read.c, root.c, root.h, stackchk.h,
638 throw.c: Removed uses of DEBUG_EXTENSIONS and DYNAMIC_LINKING to
639 fix compile errors with --disable-deprecated.
640
19a7a089
RB
6412003-04-17 Rob Browning <rlb@defaultvalue.org>
642
643 * numbers.c (scm_integer_expt): fix case where we were declaring
644 vars in the middle of a statement block. Thanks to Thamer
645 Al-Harbash.
646
47cd67db
MD
6472003-04-17 Mikael Djurfeldt <djurfeldt@nada.kth.se>
648
0fd7dcd3
MD
649 * goops.c (TEST_CHANGE_CLASS): Update variable class after class
650 change.
651
47cd67db
MD
652 * eq.c (scm_eqv_p): Turned into a primitive generic.
653
3b8b889c
RB
6542003-04-16 Rob Browning <rlb@defaultvalue.org>
655
312006bb
RB
656 * gc_os_dep.c: Added patch for UnixWare and OpenUNIX support.
657 Thanks to Boyd Gerber.
658 Added check for __arm__ in addition to arm for LINUX and copied
659 __s390__ defines from upstream libgc. Thanks to James Treacy for
660 reporting the problems.
c7ef2ea1 661
3b8b889c
RB
662 * numbers.c (PTRDIFF_MIN): use SCM_CHAR_BIT.
663
664 * socket.c: use SCM_CHAR_BIT.
665
666 * random.c (scm_c_random_bignum): use SCM_CHAR_BIT.
667
668 * num2integral.i.c (NUM2INTEGRAL): use SCM_CHAR_BIT.
669
43261b39
MD
6702003-04-16 Mikael Djurfeldt <mdj@kvast.blakulla.net>
671
672 * feature.c (scm_init_feature): Always add threads feature.
673
58241edc
MD
6742003-04-15 Mikael Djurfeldt <djurfeldt@nada.kth.se>
675
676 * goops.c (scm_sys_fast_slot_ref): Use SCM_SLOT instead of
677 scm_at_assert_bound_ref. (We don't want the unbound check. See
678 oop/goops/active-slot.scm.)
679
94e91275
RB
6802003-04-14 Rob Browning <rlb@defaultvalue.org>
681
682 * tags.h: scm_t_intptr should have been intptr_t.
683
3071ea27
RB
6842003-04-13 Rob Browning <rlb@defaultvalue.org>
685
686 * __scm.h (SCM_FLUSH_REGISTER_WINDOWS): don't just rely on "sparc"
687 test. Instead use
688 #if defined (sparc) || defined (__sparc__) || defined (__sparc)
689 as gc_os_dep.c suggests is appropriate.
690
691 * goops.c (prep_hashsets): make static to match prototype.
692 (scm_sym_args): SCM_SYMBOL -> SCM_GLOBAL_SYMBOL. Thanks to Albert
693 Chin.
694
695 * c-tokenize.lex: remove trailing comma from enum. Thanks to
696 Albert Chin.
697
698 * gc_os_dep.c: add NetBSD powerpc config info. Thanks to Thomas
699 Klausner.
700
21ab2aeb
MD
7012003-04-13 Mikael Djurfeldt <djurfeldt@nada.kth.se>
702
703 * goops.c (scm_sys_prep_layout_x): Instance allocation is now
704 indicated through extra fields in getters-n-setters.
705 (scm_add_slot): Adapted to new format of getters_n_setters slot.
706 (Thanks to Andy Wingo.)
707
dff96e95
HWN
7082003-02-25 Han-Wen Nienhuys <hanwen@cs.uu.nl>
709
710 * gc-segment.c: add comment
711
07921c76
RB
7122003-04-07 Rob Browning <rlb@defaultvalue.org>
713
b5331f10
RB
714 * debug.h: change "id" arg name to "info_id" to avoid objective-c
715 clash.
716
07921c76
RB
717 * num2integral.i.c (NUM2INTEGRAL): fix bug pointed out by Mikael
718 and add regression test to standalone/.
719
7202003-04-06 Rob Browning <rlb@defaultvalue.org>
721
722 * strings.c (scm_mem2string): use memcpy rather than by-hand loop.
723 Thanks to Dale P. Smith.
724
725 * random.c: #include gmp.h.
726 (scm_c_random_bignum): normalize result on return.
727
728 * init.c: #include gmp.h.
729
730 * numbers.h: remove the gmp.h #include (not needed now).
731
732 * posix.h: change occurences of "id" to something else so we don't
733 cause trouble when included via objective-c (can't hurt, might
734 help). Still have usage in debug.h, though.
735
938f6b7c
MD
7362003-04-06 Mikael Djurfeldt <djurfeldt@nada.kth.se>
737
372691d8
MD
738 * random.c (scm_c_random_bignum): Don't generate a random number
739 equal to m (the second argument of scm_c_random_bignum); only
740 generate numbers in the range 0 <= r < m.
c5f268f8
MD
741 (scm_c_default_rstate): Use SCM_VARIABLE_REF to access
742 scm_var_random_state.
372691d8 743
938f6b7c
MD
744 * num2integral.i.c (INTEGRAL2BIG): Put negation of n inside then
745 clause.
746
6cdb8c3f
RB
7472003-04-05 Rob Browning <rlb@defaultvalue.org>
748
938f6b7c 749 * modules.c (scm_module_import_interface): move declaration of
6cdb8c3f
RB
750 uses before any code.
751
15635be5
MD
7522003-04-05 Mikael Djurfeldt <djurfeldt@nada.kth.se>
753
1ecfd013
MD
754 * Makefile.am (scmconfig.h): Look for config.h in top_builddir,
755 not top_srcdir.
756
15635be5
MD
757 * hashtab.c (rehash_after_gc): Clear to_rehash list before
758 processing it in order to avoid an infinite loop.
759
760 * print.c (scm_prin1): Remember old state of pstate->writingp.
761
73be1d9e
MV
7622003-04-05 Marius Vollmer <mvo@zagadka.de>
763
764 * Changed license terms to the plain LGPL thru-out.
765
ad815c06
RB
7662003-04-04 Rob Browning <rlb@defaultvalue.org>
767
768 * socket.c (FLIPCPY_NET_HOST_128): new macro.
769 (ipv6_net_to_num, ipv6_num_to_net, bignum_in_ipv6_range_p):
770 rewrite to handle GMP bignums.
771
772
773 * random.c (scm_c_random_bignum): rewrite to handle GMP bignums.
774
775 * ports.c (scm_getc): minor tweak.
776
777 * numbers.h: remove SCM_BIGDIG conditionals, reorganize, and
778 rewrite to handle GMP bignums.
779
780 * numbers.c: rewrite *many* functions to handle GMP bignums.
781
782 * num2integral.i.c (NUM2INTEGRAL, INTEGRAL2NUM, INTEGRAL2BIG):
783 handle GMP bignums.
784
785 * num2float.i.c (NUM2FLOAT): handle GMP bignums.
786
787 * init.c (check_config): remove SCM_BIGDIG conditionals.
788 (scm_init_guile_1): test to make sure mpz_t fits in a double_cell.
789
790 * gc-card.c ("sweep_card"): handle new mpz_t bignums.
791
792 * eval.c: remove SCM_BIGDIG conditionals.
793
794 * eq.c (s_scm_eqv_p): scm_i_bigcomp -> scm_i_bigcmp.
795
6cdb8c3f
RB
7962003-03-31 Rob Browning <rlb@defaultvalue.org>
797
798 * Makefile.am (scmconfig.h): change srcdir to builddir. (Thanks
799 to Kevin Ryde.)
800
8012003-03-27 Rob Browning <rlb@defaultvalue.org>
802
803 * threads.h: fix various preprocessor usages of new public
804 symbols to expect 0 or 1 values rather than 1 or undefined.
805 i.e. change #ifdef to #if, etc.
806
807 * threads.c: fix various preprocessor usages of new public
808 symbols to expect 0 or 1 values rather than 1 or undefined.
809 i.e. change #ifdef to #if, etc.
810
811 * tags.h: fix various preprocessor usages of new public
812 symbols to expect 0 or 1 values rather than 1 or undefined.
813 i.e. change #ifdef to #if, etc.
814
815 * stacks.c: fix various preprocessor usages of new public
816 symbols to expect 0 or 1 values rather than 1 or undefined.
817 i.e. change #ifdef to #if, etc.
818
819 * stackchk.h: fix various preprocessor usages of new public
820 symbols to expect 0 or 1 values rather than 1 or undefined.
821 i.e. change #ifdef to #if, etc.
822
823 * stackchk.c: fix various preprocessor usages of new public
824 symbols to expect 0 or 1 values rather than 1 or undefined.
825 i.e. change #ifdef to #if, etc.
826
827 * sort.c: fix various preprocessor usages of new public
828 symbols to expect 0 or 1 values rather than 1 or undefined.
829 i.e. change #ifdef to #if, etc.
830
831 * read.c: fix various preprocessor usages of new public
832 symbols to expect 0 or 1 values rather than 1 or undefined.
833 i.e. change #ifdef to #if, etc.
834
835 * random.c: fix various preprocessor usages of new public
836 symbols to expect 0 or 1 values rather than 1 or undefined.
837 i.e. change #ifdef to #if, etc.
838
839 * print.c: fix various preprocessor usages of new public
840 symbols to expect 0 or 1 values rather than 1 or undefined.
841 i.e. change #ifdef to #if, etc.
842
843 * objects.c: fix various preprocessor usages of new public
844 symbols to expect 0 or 1 values rather than 1 or undefined.
845 i.e. change #ifdef to #if, etc.
846
847 * numbers.h: fix various preprocessor usages of new public
848 symbols to expect 0 or 1 values rather than 1 or undefined.
849 i.e. change #ifdef to #if, etc.
850
851 * null-threads.c: fix various preprocessor usages of new public
852 symbols to expect 0 or 1 values rather than 1 or undefined.
853 i.e. change #ifdef to #if, etc.
854
855 * lang.c: fix various preprocessor usages of new public
856 symbols to expect 0 or 1 values rather than 1 or undefined.
857 i.e. change #ifdef to #if, etc.
858
859 * lang.h: fix various preprocessor usages of new public
860 symbols to expect 0 or 1 values rather than 1 or undefined.
861 i.e. change #ifdef to #if, etc.
862
863 * iselect.h: fix various preprocessor usages of new public
864 symbols to expect 0 or 1 values rather than 1 or undefined.
865 i.e. change #ifdef to #if, etc.
866
867 * init.c: fix various preprocessor usages of new public
868 symbols to expect 0 or 1 values rather than 1 or undefined.
869 i.e. change #ifdef to #if, etc.
870
871 * gh_data.c: fix various preprocessor usages of new public
872 symbols to expect 0 or 1 values rather than 1 or undefined.
873 i.e. change #ifdef to #if, etc.
874
875 * gh.h: fix various preprocessor usages of new public
876 symbols to expect 0 or 1 values rather than 1 or undefined.
877 i.e. change #ifdef to #if, etc.
878
879 * gen-scmconfig.c: change most new public symbols to be defined to
880 0 or 1 rather than being either 1 or undefined.
881
882 * gc_os_dep.c: fix various preprocessor usages of new public
883 symbols to expect 0 or 1 values rather than 1 or undefined.
884 i.e. change #ifdef to #if, etc.
885 (STACK_GROWS_DOWN): define to 0 or 1 rather than 1 or undef.
886
887 * gc.h: fix various preprocessor usages of new public
888 symbols to expect 0 or 1 values rather than 1 or undefined.
889 i.e. change #ifdef to #if, etc.
890
891 * gc-card.c: fix various preprocessor usages of new public
892 symbols to expect 0 or 1 values rather than 1 or undefined.
893 i.e. change #ifdef to #if, etc.
894
895 * gc-mark.c: fix various preprocessor usages of new public
896 symbols to expect 0 or 1 values rather than 1 or undefined.
897 i.e. change #ifdef to #if, etc.
898
899 * feature.c: fix various preprocessor usages of new public
900 symbols to expect 0 or 1 values rather than 1 or undefined.
901 i.e. change #ifdef to #if, etc.
902
903 * evalext.c: fix various preprocessor usages of new public
904 symbols to expect 0 or 1 values rather than 1 or undefined.
905 i.e. change #ifdef to #if, etc.
906
907 * eval.h: fix various preprocessor usages of new public
908 symbols to expect 0 or 1 values rather than 1 or undefined.
909 i.e. change #ifdef to #if, etc.
910
911 * eval.c: fix various preprocessor usages of new public
912 symbols to expect 0 or 1 values rather than 1 or undefined.
913 i.e. change #ifdef to #if, etc.
914
915 * eq.c: fix various preprocessor usages of new public
916 symbols to expect 0 or 1 values rather than 1 or undefined.
917 i.e. change #ifdef to #if, etc.
918
919 * coop.c: fix various preprocessor usages of new public
920 symbols to expect 0 or 1 values rather than 1 or undefined.
921 i.e. change #ifdef to #if, etc.
922
923 * coop-threads.c: fix various preprocessor usages of new public
924 symbols to expect 0 or 1 values rather than 1 or undefined.
925 i.e. change #ifdef to #if, etc.
926
927 * coop-pthreads.c: fix various preprocessor usages of new public
928 symbols to expect 0 or 1 values rather than 1 or undefined.
929 i.e. change #ifdef to #if, etc.
930
931 * coop-defs.h: fix various preprocessor usages of new public
932 symbols to expect 0 or 1 values rather than 1 or undefined.
933 i.e. change #ifdef to #if, etc.
934
935 * convert.i.c: fix various preprocessor usages of new public
936 symbols to expect 0 or 1 values rather than 1 or undefined.
937 i.e. change #ifdef to #if, etc.
938
939 * continuations.c: fix various preprocessor usages of new public
940 symbols to expect 0 or 1 values rather than 1 or undefined.
941 i.e. change #ifdef to #if, etc.
942
943 * _scm.h: fix various preprocessor usages of new public symbols to
944 expect 0 or 1 values rather than 1 or undefined. i.e. change
945 #ifdef to #if, etc.
946
d11d697a
MV
9472003-03-26 Marius Vollmer <marius.vollmer@uni-dortmund.de>
948
9686f86d
MV
949 * init.c (scm_init_guile_1): Call scm_i_init_deprecated.
950
951 * deprecated.c, deprecated.h: New files, to collect deprecated
952 things in one place.
953 * Makefile.am: Added them in all the right places.
954
d11d697a
MV
955 * Makefile.am (EXTRA_DIST): Added "scmconfig.h.top".
956 (scmconfig.h): Get "scmconfig.h.top" from $(srcdir) so that VPATH
957 builds work.
9686f86d
MV
958 (DOT_X_FILES): Removed "iselect.x".
959 (DOT_DOC_FILES): Removed "iselect.doc".
d11d697a 960
e3c0c3b9
RB
9612003-03-25 Rob Browning <rlb@defaultvalue.org>
962
963 * win32-socket.h: #include "libguile/__scm.h". Replace usage of
964 HAVE_WINSOCK2_H with SCM_HAVE_WINSOCK2_H.
965
966 * win32-socket.c: #include <config.h> if HAVE_CONFIG_H.
967
968 * vports.c: #include <config.h> if HAVE_CONFIG_H.
969
970 * unif.c: #include <config.h> if HAVE_CONFIG_H. Replace usage of
971 HAVE_LONG_LONGS with "SCM_SIZEOF_LONG_LONG != 0".
972
973 * threads.h: replace usage of struct timespect with
974 scm_t_timespec. Replace usage of USE_PTHREAD_THREADS with
975 SCM_USE_PTHREAD_THREADS. Remove typedef for struct timespec in
976 favor of scm_t_timespec from scmconfig.h.
977
978 * threads.c: move libguile/_scm.h include to the top so we pick up
979 any critical defines like _GNU_SOURCE early. Replace usage of
980 struct timespect with scm_t_timespec. Replace usage of
981 STACK_GROWS_UP with SCM_STACK_GROWS_UP. Replace usage of
982 USE_PTHREAD_THREADS with SCM_USE_PTHREAD_THREADS.
983
984 * threads-plugin.h: replace usage of struct timespect with
985 scm_t_timespec.
986
987 * threads-plugin.c: #include <config.h> if HAVE_CONFIG_H. Replace
988 usage of struct timespect with scm_t_timespec.
989
990 * tags.h: move HAVE_STDINT_H handling to scmconfig.h. Move
991 HAVE_INTTYPES_H handling to scmconfig.h. #include
992 "libguile/__scm.h". Rework handling for scm_t_bits,
993 scm_t_signed_bits, SCM_T_BITS_MAX, SCM_T_SIGNED_BITS_MAX,
994 SCM_T_SIGNED_BITS_MIN, and SIZEOF_SCM_T_BITS to use scm_t_intptr,
995 scm_t_uintptr, SCM_SIZEOF_INTPTR_T, and SCM_SIZEOF_UINTPTR_T, and
996 SCM_SIZEOF_UNSIGNED_LONG. Rename usage of HAVE_ARRAYS to
997 SCM_HAVE_ARRAYS.
998
999 * symbols.c: #include <config.h> if HAVE_CONFIG_H.
1000
1001 * struct.c: #include <config.h> if HAVE_CONFIG_H.
1002
1003 * strports.c: #include <config.h> if HAVE_CONFIG_H.
1004
1005 * strop.c: #include <config.h> if HAVE_CONFIG_H.
1006
1007 * stime.h: move handling of time related headers to scmconfig.h.
1008
1009 * stime.c: #include <config.h> if HAVE_CONFIG_H.
1010
1011 * stacks.c: replace usage of STACK_GROWS_UP with
1012 SCM_STACK_GROWS_UP.
1013
1014 * sort.c: #include <config.h> if HAVE_CONFIG_H. Rename usage of
1015 HAVE_ARRAYS to SCM_HAVE_ARRAYS.
1016
1017 * socket.c: #include <config.h> if HAVE_CONFIG_H. Replace usage
1018 of uint32 and HAVE_UINT_32 with scm_t_int32.
1019
1020 * smob.c: #include <config.h> if HAVE_CONFIG_H.
1021
1022 * simpos.c: #include <config.h> if HAVE_CONFIG_H.
1023
1024 * script.c: #include <config.h> if HAVE_CONFIG_H.
1025
1026 * scmsigs.c: #include <config.h> if HAVE_CONFIG_H.
1027
1028 * scmconfig.h.top: new file -- preamble for scmconfig.h.
1029
1030 * rw.c: #include <config.h> if HAVE_CONFIG_H.
1031
1032 * regex-posix.c: #include <config.h> if HAVE_CONFIG_H.
1033
1034 * read.c: rename usage of HAVE_ARRAYS to SCM_HAVE_ARRAYS.
1035
1036 * rdelim.c: #include <config.h> if HAVE_CONFIG_H.
1037
1038 * random.c: #include <config.h> if HAVE_CONFIG_H. Replace usage
1039 of LONG32, LONG64, SIZEOF_LONG, and HAVE_LONG_LONGS with
1040 scm_t_int32, scm_t_int64, and SCM_HAVE_T_INT64. Rename usage of
1041 HAVE_ARRAYS to SCM_HAVE_ARRAYS.
1042
1043 * ramap.c: replace usage of HAVE_LONG_LONGS with
1044 "SCM_SIZEOF_LONG_LONG != 0".
1045
1046 * putenv.c: #include <config.h> if HAVE_CONFIG_H. #include
1047 "libguile/scmconfig.h".
1048
1049 * pthread-threads.c: #include <config.h> if HAVE_CONFIG_H.
1050
1051 * print.c: rename usage of HAVE_ARRAYS to SCM_HAVE_ARRAYS.
1052 Replace usage of HAVE_LONG_LONGS with "SCM_SIZEOF_LONG_LONG != 0".
1053
1054 * posix.c: #include <config.h> if HAVE_CONFIG_H.
1055
1056 * ports.c: #include <config.h> if HAVE_CONFIG_H.
1057
1058 * objects.c: rename usage of HAVE_ARRAYS to SCM_HAVE_ARRAYS.
1059
1060 * numbers.h: replace usage of HAVE_FLOATINGPOINT_H with
1061 SCM_HAVE_FLOATINGPOINT_H. Replace usage of HAVE_IEEEFP_H with
1062 SCM_HAVE_IEEEFP_H. Replace usage of HAVE_NAN_H with
1063 SCM_HAVE_NAN_H. Replace usage of STDC_HEADERS with
1064 SCM_HAVE_STDC_HEADERS. Replace usage of ptrdiff_t with
1065 scm_t_ptrdiff. Replace usage of HAVE_LONG_LONGS with
1066 "SCM_SIZEOF_LONG_LONG != 0".
1067
1068 * numbers.c: #include <config.h> if HAVE_CONFIG_H. Replace usage
1069 of HAVE_LONG_LONGS with "SCM_SIZEOF_LONG_LONG != 0". Replace
1070 usage of ptrdiff_t with scm_t_ptrdiff. Replace usage of
1071 SIZEOF_PTRDIFF_T with SCM_SIZEOF_SCM_T_PTRDIFF.
1072
1073 * num2integral.i.c: #include <config.h> if HAVE_CONFIG_H.
1074
1075 * null-threads.h: replace usage of struct timespect with
1076 scm_t_timespec.
1077
1078 * net_db.c: #include <config.h> if HAVE_CONFIG_H.
1079
1080 * mkstemp.c: #include <config.h> if HAVE_CONFIG_H. #include
1081 "libguile/__scm.h". Remove definition of gcc_uint64_t in favor of
1082 scm_t_uint64 and rename usages.
1083
1084 * mallocs.c: #include <config.h> if HAVE_CONFIG_H.
1085
1086 * load.c: #include <config.h> if HAVE_CONFIG_H.
1087
1088 * iselect.h: move handling of time related headers to scmconfig.h.
1089 Rename usage of HAVE_SYS_SELECT_H to SCM_HAVE_SYS_SELECT_H.
1090 Rename usage of HAVE_WINSOCK2_H to SCM_HAVE_WINSOCK2_H. Rename
1091 usage of USE_COOP_THREADS to SCM_USE_COOP_THREADS.
1092
1093 * iselect.c: #include <config.h> if HAVE_CONFIG_H. Rename usage
1094 of USE_COOP_THREADS to SCM_USE_COOP_THREADS. Rename usage of
1095 USE_NULL_THREADS to SCM_USE_NULL_THREADS.
1096
1097 * ioext.c: #include <config.h> if HAVE_CONFIG_H.
1098
1099 * inline.h: #include "libguile/__scm.h" at the top. Change code
1100 to use SCM_C_INLINE and SCM_INLINE_C_INCLUDINT_INLINE_H to decide
1101 what to do instead of creating a new public #define. Rename usage
1102 of USE_COOP_THREADS to SCM_USE_COOP_THREADS. Rename usage of
1103 USE_NULL_THREADS to SCM_USE_NULL_THREADS. Rename usage of
1104 USE_COPT_THREADS to SCM_USE_COPT_THREADS.
1105
1106 * inline.c: rearrange handling -- now we just #define
1107 SCM_INLINE_C_INCLUDING_INLINE_H to 1 and #include
1108 "libguile/inline.h". scmconfig.h will define SCM_C_INLINE as
1109 appropriate, and we use that in inline.h along with the above
1110 define to determine how to respond.
1111
1112 * init.c: #include <config.h> if HAVE_CONFIG_H. Rename usage of
1113 HAVE_ARRAYS to SCM_HAVE_ARRAYS.
1114
1115 * guile.c: #include <config.h> if HAVE_CONFIG_H.
1116
1117 * gh_data.c: #include <config.h> if HAVE_CONFIG_H. Rename usage
1118 of HAVE_ARRAYS to SCM_HAVE_ARRAYS.
1119
1120 * gh.h: rename usage of HAVE_ARRAYS to SCM_HAVE_ARRAYS.
1121
1122 * gen-scmconfig.h.in: new file -- see gen-scmconfig.c for details.
1123
1124 * gen-scmconfig.c: new file -- see comments in file for details.
1125
1126 * gdbinit.c: #include <config.h> if HAVE_CONFIG_H.
1127
1128 * gc_os_dep.c: #include <config.h> if HAVE_CONFIG_H. Replace
1129 usage of STACK_GROWS_UP with SCM_STACK_GROWS_UP.
1130
1131 * gc.h: replace usage of SIZEOF_LONG with
1132 SCM_SIZEOF_UNSIGNED_LONG. Replace usage of USE_PTHREAD_THREADS
1133 with SCM_USE_PTHREAD_THREADS. Remove SCM_SIZEOF_LONG definition
1134 since we handle that in scmconfig.h now.
1135
1136 * gc.c: #include <config.h> if HAVE_CONFIG_H.
1137
1138 * gc-mark.c: #include <config.h> if HAVE_CONFIG_H. Rename usage
1139 of HAVE_ARRAYS to SCM_HAVE_ARRAYS. Replace usage of
1140 HAVE_LONG_LONGS with "SCM_SIZEOF_LONG_LONG != 0".
1141
1142 * gc-malloc.c: #include <config.h> if HAVE_CONFIG_H.
1143
1144 * gc-card.c: rename usage of HAVE_ARRAYS to SCM_HAVE_ARRAYS.
1145 Replace usage of HAVE_LONG_LONGS with "SCM_SIZEOF_LONG_LONG != 0".
1146
1147 * fports.c: #include <config.h> if HAVE_CONFIG_H.
1148
1149 * filesys.c: #include <config.h> if HAVE_CONFIG_H.
1150
1151 * feature.c: #include <config.h> if HAVE_CONFIG_H. Rename usage
1152 of USE_NULL_THREADS to SCM_USE_NULL_THREADS.
1153
1154 * extensions.c: #include <config.h> if HAVE_CONFIG_H.
1155
1156 * evalext.c: rename usage of HAVE_ARRAYS to SCM_HAVE_ARRAYS.
1157 Replace usage of HAVE_LONG_LONGS with "SCM_SIZEOF_LONG_LONG != 0".
1158
1159 * eval.c: #include <config.h> if HAVE_CONFIG_H. #include
1160 "libguile/__scm.h" rather than scmconfig.h. Rename usage of
1161 HAVE_ARRAYS to SCM_HAVE_ARRAYS. Replace usage of HAVE_LONG_LONGS
1162 with "SCM_SIZEOF_LONG_LONG != 0".
1163
1164 * error.c: #include <config.h> if HAVE_CONFIG_H.
1165
1166 * eq.c: #include <config.h> if HAVE_CONFIG_H. Rename usage of
1167 HAVE_ARRAYS to SCM_HAVE_ARRAYS. Replace usage of HAVE_LONG_LONGS
1168 with "SCM_SIZEOF_LONG_LONG != 0".
1169
1170 * deprecation.c: #include <config.h> if HAVE_CONFIG_H.
1171
1172 * coop.c: replace usage of struct timespect with scm_t_timespec.
1173 #include <config.h> if HAVE_CONFIG_H.
1174
1175 * coop-threads.c: #include "libguile/_scm.h" early. Replace
1176 usage of struct timespect with scm_t_timespec. Replace usage of
1177 STACK_GROWS_UP with SCM_STACK_GROWS_UP.
1178
1179 * coop-pthreads.c: #include "libguile/_scm.h" early. Replace
1180 usage of struct timespect with scm_t_timespec. Replace usage of
1181 STACK_GROWS_UP with SCM_STACK_GROWS_UP.
1182
1183 * coop-defs.h: move handling of time related headers to
1184 scmconfig.h. Add #include "libguile/__scm.h". Rename usage of
1185 HAVE_WINSOCK2_H to SCM_HAVE_WINSOCK2_H. Replace usage of struct
1186 timespect with scm_t_timespec.
1187
1188 * convert.i.c: rename usage of HAVE_ARRAYS to SCM_HAVE_ARRAYS.
1189
1190 * convert.h: rename usage of HAVE_ARRAYS to SCM_HAVE_ARRAYS.
1191
1192 * convert.c: #include <config.h> if HAVE_CONFIG_H. Rename usage
1193 of HAVE_ARRAYS to SCM_HAVE_ARRAYS.
1194
1195 * continuations.c: move libguile/_scm.h include to the top so we
1196 pick up any critical defines like _GNU_SOURCE early.
1197
1198 * backtrace.c: #include <config.h> if HAVE_CONFIG_H.
1199
1200 * async.c: #include <config.h> if HAVE_CONFIG_H.
1201
1202 * alloca.c: #include <config.h> if HAVE_CONFIG_H.
1203
1204 * _scm.h: #include <config.h> if HAVE_CONFIG_H.
1205 Rename usage of USE_PTHREAD_THREADS to SCM_USE_PTHREAD_THREADS.
1206
1207 * __scm.h: move libguile/scmconfig.h include up to the top, so
1208 we're sure to pick up any critical defines like _GNU_SOURCE early.
1209 #include <limits.h> removed in favor of scmconfig.h inclusion when
1210 appropriate. STDC_HEADERS based inclusion of stdlib.h,
1211 sys/types.h, stddef.h, and sys/stdtypes.h removed in favor of
1212 scmconfig.h inclusion when appropriate. Various Win32 related
1213 definitions removed in favor of scmconfig.h inclusion when
1214 appropriate.
1215 (HAVE_UINTPTR_T): definition removed (see NEWS).
1216 (SIZEOF_PTRDIFF_T): definition removed (see NEWS).
1217 (HAVE_LONG_LONGS): definition removed (see NEWS).
1218 (HAVE_LONG_LONG): definition removed (see NEWS).
1219 (HAVE_PTRDIFF_T): definition removed (see NEWS).
1220
1221 * Makefile.am: scmconfig.h is now generated by building and
1222 running gen-scmconfig.h and capturing its output. gen-scmconfig
1223 uses config.h and the configure.in generated gen-scmconfig.h to
1224 decide what to output. See gen-scmconfig.c for details.
1225 (noinst_PROGRAMS): add gen-scmconfig.
1226 (gen_scmconfig_SOURCES): new variable.
1227 (gen-scmconfig.$(OBJEXT)): new target - be careful to handle
1228 cross-compiling right.
1229 (scmconfig.h): build scmconfig.h from gen-scmconfig's output.
1230 (BUILT_SOURCES): add scmconfig.h.
1231
25e0bf97
MV
12322003-03-19 Marius Vollmer <mvo@zagadka.de>
1233
1234 * gc_os_dep.c: Added defines for sparc-unknown-netbsdelf1.5 from
1235 Adrian Bunk. Thanks!
1236
74b6d6e4
MD
12372003-03-19 Mikael Djurfeldt <djurfeldt@nada.kth.se>
1238
1239 * goops.c (make_class_from_template): New fourth arg:
1240 applicablep.
1241 (scm_class_extended_generic_with_setter, scm_class_self): Fixed
1242 cpls.
1243
1244 * smob.c (scm_set_smob_apply): Call scm_i_inherit_applicable.
1245
1246 * goops.c, objects.c, objects.h (scm_make_extended_class): New
1247 second arg: applicablep.
1248 (scm_i_inherit_applicable): New function.
1249
1250 * goops.c, goops.h (scm_class_applicable,
1251 scm_class_extended_accessor): New classes.
1252
5c9e7dad
DH
12532003-03-18 Dirk Herrmann <D.Herrmann@tu-bs.de>
1254
1255 * procs.c (scm_procedure_documentation): Removed redundant
1256 SCM_NIMP test and replaced other calls to SCM_IMP by more explicit
1257 predicates.
1258
f8af5c6d
MD
12592003-03-11 Mikael Djurfeldt <djurfeldt@nada.kth.se>
1260
c614a00b
MD
1261 * list.c, list.h (scm_filter, scm_filter_x): New functions.
1262
109c2c9f
MD
1263 * modules.c (scm_module_import_interface): New function.
1264
f8af5c6d
MD
1265 * goops.c, goops.h (scm_class_accessor_method): Renamed from
1266 scm_class_accessor.
1267 (scm_class_accessor): New class.
1268
a48d60b1
MD
12692003-03-06 Mikael Djurfeldt <djurfeldt@nada.kth.se>
1270
1271 * goops.c (scm_primitive_generic_generic): Enable primitive
1272 generic if not enabled.
1273 (scm_sys_goops_loaded): Setup unextended primitive generics.
1274
1275 * goops.c, goops.h (scm_c_extend_primitive_generic): New function.
1276
1277 * snarf.h (SCM_PRIMITIVE_GENERIC, SCM_PRIMITIVE_GENERIC_1): New
1278 snarf macros.
1279
1280 * numbers.c (scm_abs): Use SCM_PRIMITIVE_GENERIC. (This is only a
1281 testing example. All uses of SCM_GPROC should be converted.)
1282
1283 * procprop.c (scm_stand_in_scm_proc): Use scm_assq instead of
1284 scm_assoc.
1285
1286 * eq.c (scm_equal_p): Turned into a primitive generic.
1287
84edc049
RB
12882003-02-27 Rob Browning <rlb@defaultvalue.org>
1289
1290 * Makefile.am (scmconfig.h): new target -- generate file from
1291 ../config.h.
1292 (modinclude_HEADERS): remove version.h.
1293 (nodist_modinclude_HEADERS): add version.h.
1294
ea5c9285
MD
12952003-02-24 Mikael Djurfeldt <djurfeldt@nada.kth.se>
1296
b4a1358c
MD
1297 This fixes a serious GC bug, introduced during the latest
1298 reorganization of the GC, which disabled freeing of structs and
1299 GOOPS objects:
1300
1301 * struct.c (scm_struct_prehistory): Init scm_i_structs_to_free to
1302 SCM_EOL.
53af8255
MD
1303 (scm_struct_prehistory): Move scm_free_structs to
1304 scm_before_mark_c_hook.
ea5c9285 1305
b4a1358c
MD
1306 * gc-card.c (sweep_card): Check that we haven't swept structs on
1307 this card before. That can happen if scm_i_sweep_all_segments has
1308 been called from some other place than scm_igc.
1309
c35738c1
MD
13102003-02-19 Mikael Djurfeldt <djurfeldt@nada.kth.se>
1311
231a4ea8
MD
1312 * environments.c (DEFAULT_OBARRAY_SIZE): Changed from 137 to 31
1313 (since hash tables now adapt their size).
1314
1315 * modules.c (scm_modules_prehistory): Changed from 2001 to 1533
1316 (current number of prehistory bindings; hashtable code will select
1317 a prime which is greater than this value).
1318
1319 * symbols.c (scm_symbols_prehistory): Changed from 1009 to 2139
1320 (current number of initial symbols).
1321
1322 * properties.c (scm_init_properties): Don't specify size of
1323 scm_properties_whash.
1324
1325 * objprop.c (scm_init_objprop): Don't specify size of
1326 scm_object_whash.
1327
1328 * keywords.c (scm_init_keywords): Don't specify a hash table size.
1329
c35738c1
MD
1330 * hooks.c (scm_c_hook_add): Fixed bug in append mode.
1331
1332 The following changes introduce the use of resizable hash tables
1333 throughout Guile. It also renames the old *-hash-table* functions
1334 to *-alist-vector* and places them, together with the rest of the
1335 weak vector support, in the module (ice-9 weak-vector). We should
1336 probably introduce a new, better, API for weak references, for
1337 example "weak pairs" a la MIT-Scheme. (In Chez scheme, they even
1338 look like and are used like ordinary pairs.)
1339
1340 * environments.c (obarray_enter, obarray_retrieve, obarray_remove,
1341 leaf_environment_fold, obarray_remove_all): Use hashtable
1342 accessors.
1343
1344 * gc.c (scm_init_storage): Moved hook initialization to
1345 scm_storage_prehistory.
1346 (scm_storage_prehistory): New function.
1347 (scm_igc): Added commentary about placement of
1348 scm_after_sweep_c_hook.
1349
1350 * gc-mark.c (scm_mark_all): Use hashtable accessors.
1351 (scm_gc_mark_dependencies): Use SCM_WVECT_WEAK_KEY_P and
1352 SCM_WVECT_WEAK_VALUE_P.
1353
1354 * hashtab.c, hashtab.h (scm_hash_for_each, scm_hash_map): New
1355 functions.
1356 (scm_vector_to_hash_table, scm_c_make_resizing_hash_table):
1357 Removed.
1358 (scm_make_weak_key_hash_table, scm_make_weak_value_hash_table,
1359 scm_make_doubly_weak_hash_table): Moved here from weaks.c.
1360
1361 * init.c (scm_init_guile_1): Removed call to scm_init_weaks; Added
1362 calls to scm_storage_prehistory and scm_hashtab_prehistory.
1363
1364 * modules.c (module-reverse-lookup): Use hashtable accessors.
1365
1366 * symbols.c, symbols.h (scm_i_hash_symbol): New function.
1367
1368 * weaks.c, weaks.h (scm_make_weak_key_alist_vector,
1369 scm_make_weak_value_alist_vector,
1370 scm_make_doubly_weak_alist_vector): New functions.
1371
1372 * weaks.c (scm_init_weaks_builtins): New function.
1373
1374 * weaks.h (SCM_WVECTF_WEAK_KEY, SCM_WVECTF_WEAK_VALUE,
1375 SCM_WVECTF_NOSCAN, SCM_WVECT_WEAK_KEY_P, SCM_WVECT_WEAK_VALUE_P,
1376 SCM_WVECT_NOSCAN_P): New macros.
1377
1378 * weaks.c (scm_scan_weak_vectors): Use SCM_WVECT_WEAK_KEY_P
1379 and SCM_WVECT_WEAK_VALUE_P.
1380
1381 * weaks.c, weaks.h (scm_i_allocate_weak_vector): Renamed from
1382 allocate_weak_vector and exported.
1383
0a4c1355
MD
13842003-02-13 Mikael Djurfeldt <djurfeldt@nada.kth.se>
1385
1386 * hashtab.c: Undid thread safety. (We decided that it's better to
1387 let the user explicitly protect the tables (or not) according what
1388 is suitable for the application.)
1389
87ca11ff
MD
13902003-02-12 Mikael Djurfeldt <djurfeldt@nada.kth.se>
1391
1392 * hashtab.c (scm_hash_fn_remove_x, scm_internal_hash_fold): Made
1393 thread safe and handle resizing tables.
1394 (scm_ihashx, scm_sloppy_assx, scm_delx_x): Removed
1395 SCM_DEFER/ALLOW_INTS.
1396
f59a096e
MD
13972003-02-11 Mikael Djurfeldt <djurfeldt@nada.kth.se>
1398
1399 * hashtab.c (scm_vector_to_hash_table,
1400 scm_c_make_resizing_hash_table, scm_make_hash_table): New
1401 functions.
1402 (scm_hash_fn_get_handle, scm_hash_fn_create_handle_x): Made thread
1403 safe and handle resizing tables.
1404
1405 * weaks.c (scm_make_weak_key_hash_table,
1406 scm_make_weak_value_hash_table, scm_make_doubly_weak_hash_table):
1407 Size argument made optional. Return resizable table if not
1408 specified.
1409
4b612c5b
MD
14102003-02-10 Mikael Djurfeldt <djurfeldt@nada.kth.se>
1411
1412 * eval.c (scm_trampoline_0, scm_trampoline_1, scm_trampoline_2):
1413 Fixed formals tests for closures. (Thanks to Kevin Ryde.)
1414
b3d7f6df
MD
14152003-02-05 Mikael Djurfeldt <djurfeldt@nada.kth.se>
1416
1417 * debug.c (scm_procedure_source): Handle all objects for which
1418 procedure? is #t. (Thanks to Bill Schottstaedt.)
1419
756414cf
MD
14202003-01-23 Mikael Djurfeldt <djurfeldt@nada.kth.se>
1421
361d631f
MD
1422 * futures.c (mark_futures): Don't need to mark data of recycled
1423 futures.
1424 (scan_futures, cleanup_undead): Be smarter about marking
1425 futures---avoid unnecessary passes through future lists.
1426
756414cf
MD
1427 * futures.h, futures.c: New files; Introduced recycling of
1428 futures. For fine-grained threading this lifts performance to
1429 another level. We can now use parallelization in inner loops of
1430 Guile programs without impossible overhead.
1431
1432 * threads.h, threads.c: Moved futures to their own file.
1433
1434 * Makefile.am (libguile_la_SOURCES): Added futures.c.
1435 (DOT_X_FILES): Added futures.x.
1436 (DOT_DOC_FILES): Added futures.doc.
1437 (modinclude_HEADERS): Added futures.h.
1438
1439 * threads.c, threads.h (scm_i_create_thread): Renamed from
1440 create_thread and made global.
1441
1442 * futures.c (scm_make_future): New procedure.
1443
1444 * eval.c: #include "libguile/futures.h".
1445
1446 * init.c: #include "futures.h"
1447 (scm_init_guile_1): Call scm_init_futures.
1448
1449 * stime.c (SCM_TIME_UNITS_PER_SECOND): Renamed from CLKTCK.
1450
1451 * stime.h (SCM_TIME_UNITS_PER_SECOND): Definition moved here.
1452
1453 * eval.c, eval.h (scm_trampoline_0, scm_i_call_closure_0): New
1454 functions.
1455
1456 * eval.c (scm_trampoline_1): Fixed arguments test for closures.
1457
b4debead
MD
14582003-01-22 Mikael Djurfeldt <djurfeldt@nada.kth.se>
1459
1460 * threads.c (create_thread): Don't unwind dynwind chain of parent
1461 thread before creation. Just start the new thread with an empty
1462 dynwind chain.
1463
93f26b7b
MD
14642003-01-20 Mikael Djurfeldt <djurfeldt@nada.kth.se>
1465
1466 * evalext.c, evalext.h (scm_self_evaluating_p): New function.
1467
38d8927c
MD
14682003-01-10 Mikael Djurfeldt <djurfeldt@nada.kth.se>
1469
41c96c32
MD
1470 * threads.c (scm_timed_wait_condition_variable): Support timed
1471 waiting also for simple condition variables.
1472
38d8927c
MD
1473 * goops.c (TEST_CHANGE_CLASS): Use scm_change_object_class instead
1474 of calling the procedure change-object-class.
1475
9cf5d9b7
MD
14762003-01-09 Mikael Djurfeldt <djurfeldt@nada.kth.se>
1477
1478 * ramap.c (scm_ramapc): Typo in error message.
1479
bbf8d523
MD
14802003-01-08 Mikael Djurfeldt <djurfeldt@nada.kth.se>
1481
b46fae00
MD
1482 * goops.c (scm_sys_prep_layout_x): Bugfix: Only create layout for
1483 slots with instance allocation.
1484
bbf8d523
MD
1485 * goops.c, goops.h (scm_class_extended_generic_with_setter): New
1486 class.
1487 (scm_compute_applicable_methods): Use scm_generic_function_methods.
1488
1489 * goops.c (scm_generic_function_methods): Support extended
1490 generic functions.
1491
ebf9b47c
MD
14922002-12-29 Mikael Djurfeldt <djurfeldt@nada.kth.se>
1493
1494 * eval.c (unmemocopy): Bugfix: scm_sym_delay --> scm_sym_future.
2e37d6a2 1495 Thanks to Neil for pointing this out!
ebf9b47c 1496
14a9ba3f
NJ
14972002-12-29 Neil Jerram <neil@ossau.uklinux.net>
1498
1499 * lang.h: Remove declarations matching definitions removed from
1500 lang.c (just below).
1501
c6a040a8
NJ
15022002-12-28 Neil Jerram <neil@ossau.uklinux.net>
1503
6054d805
NJ
1504 * lang.c (scm_nil_cons, scm_nil_car, scm_nil_cdr, scm_null,
1505 scm_m_while, scm_nil_eq): Remove definitions that were superfluous
1506 and already commented out.
1507
c6a040a8
NJ
1508 * read.h (scm_lreadparen), read.c (scm_lreadr, scm_read_token,
1509 scm_lreadparen): Support reading vectors with Elisp syntax if
1510 SCM_ELISP_READ_EXTENSIONS is defined. (SCM_ELISP_READ_EXTENSIONS
1511 is not currently defined, and there isn't even a configure switch
1512 to enable it yet.)
1513
3742c12f
MV
15142002-12-26 Marius Vollmer <mvo@zagadka.ping.de>
1515
1516 * Makefile.am (c-tokenize.o): Refer to source via $< so that vpath
1517 builds work.
1518 (EXTRA_DIST): Added version.h.in.
1519
fb50ef08
MD
15202002-12-21 Mikael Djurfeldt <djurfeldt@nada.kth.se>
1521
1522 This change makes it possible for one thread to do lazy sweeping
1523 while other threads are running. Now only the mark phase need to
1524 have all threads asleep. We should look further into this issue.
1525 Presently, I've put the locking of scm_i_sweep_mutex at
1526 "conservative" places due to my current lack of knowledge about
1527 the garbage collector. Please feel free to restrict these regions
1528 further to allow for maximal parallelism!
1529
1530 * gc.c, gc.h (scm_i_sweep_mutex): New mutex.
1531
1532 * gc.c (scm_gc_for_newcell), gc-malloc.c (scm_realloc,
1533 scm_gc_register_collectable_memory): Substitute locking of
1534 scm_i_sweep_mutex for calls to scm_i_thread_put_to_sleep.
1535 (scm_igc): Lock sweep mutex here instead of in callers; Calls to
1536 scm_i_thread_put_to_sleep/scm_i_thread_wake_up used to demarkate
1537 the single-thread section (which now only contains the mark
1538 phase).
1539 (scm_gc): Don't lock sweeo mutex here since scm_igc locks it;
1540 Removed SCM_DEFER/ALLOW_INTS. Simply call scm_igc directly.
1541
1542 * threads.c (gc_section_mutex): Removed.
1543
9ed24633
MD
15442002-12-19 Mikael Djurfeldt <mdj@kvast.blakulla.net>
1545
0d48aca5
MD
1546 * threads.c (create_thread): Clear parent field in root state in
1547 order not to unnecessarily remember dead threads.
1548
9ed24633
MD
1549 * eval.c (call_subr2o_1, call_lsubr2_2): New functions.
1550 (scm_trampoline_1, scm_trampoline_2): Use them.
1551
29717c89
MD
15522002-12-18 Mikael Djurfeldt <mdj@kvast.blakulla.net>
1553
1554 Partial introduction of real plugin interface.
1555
1556 * Makefile.am (modinclude_HEADERS): Added threads-plugin.h.
1557 (EXTRA_DIST): Added threads-plugin.c.
1558
1559 * threads-plugin.h, threads-plugin.c: New files.
1560
1561 * threads.h: #include "libguile/threads-plugin.h".
1562
1563 * threads.c: #include "libguile/threads-plugin.c".
1564
1565 * pthread-threads.c: Temporarily remove debugging functions.
1566
1567 * threads.c, threads.h (scm_yield): Added back.
1568
e29e0b09
MD
15692002-12-18 Mikael Djurfeldt <mdj@kvast.blakulla.net>
1570
1571 * threads.c (really_launch): Detach before unlocking
1572 thread_admin_mutex in order not to risk being joined.
1573 (scm_i_thread_put_to_sleep, scm_i_thread_wake_up): Keep
1574 thread_admin_mutex locked during GC.
1575
1576 * pthread-threads.c, pthread-threads.h: Improvements to debugging
1577 functions.
1578
0b6843b1 15792002-12-16 Mikael Djurfeldt <mdj@kvast.blakulla.net>
93cd4dcd 1580
6da2dfc4
MD
1581 * pthread-threads.c, pthread-threads.h (SCM_DEBUG_THREADS): Added
1582 support for debugging mutex operations.
1583
1b92fb6b
MD
1584 * threads.c (scm_thread): Removed filed joining_threads.
1585 (thread_print): Print thread number as well as address of thread
1586 structure.
0b6843b1
MD
1587 (scm_join_thread): Bugfix.
1588 (scm_lock_mutex, scm_try_mutex, scm_unlock_mutex,
1589 scm_timed_wait_condition_variable, scm_signal_condition_variable,
1590 scm_broadcast_condition_variable): Use the low-level API.
1591 (scm_all_threads): Return copy of thread list (to prevent
1592 unintended destruction).
1593 (scm_threads_prehistory): Initialize heap_mutex of fake thread.
1b92fb6b 1594
93cd4dcd
MD
1595 * pthread-threads.c, pthread-threads.h, threads.c: Fixes to
1596 pthread "native" recursive mutex support.
1597
2ff4f181
MD
15982002-12-15 Mikael Djurfeldt <djurfeldt@nada.kth.se>
1599
28d52ebb
MD
1600 * __scm.h (SCM_DEFER_INTS, SCM_ALLOW_INTS): New definitions.
1601 Simply lock a thread C API recursive mutex.
1602 (SCM_NONREC_CRITICAL_SECTION_START,
1603 SCM_NONREC_CRITICAL_SECTION_END, SCM_REC_CRITICAL_SECTION_START,
1604 SCM_REC_CRITICAL_SECTION_END): Removed.
1605
1606 * eval.c: Replaced SOURCE_SECTION_START / SOURCE_SECTION_END with
1607 direct calls to scm_rec_mutex_lock / unlock around the three calls
1608 to scm_m_expand_body.
1609
1610 * eval.c, eval.h (promise_free): New function.
1611 (scm_force): Rewritten; Now thread-safe; Removed
1612 SCM_DEFER/ALLOW_INTS.
1613
1614 * pthread-threads.h: Added partially implemented plugin interface
1615 for recursive mutexes. These are, for now, only intended to be
1616 used internally within the Guile implementation.
1617
1618 * pthread-threads.c: New file.
1619
1620 * threads.c: Conditionally #include "pthread-threads.c".
1621
1622 * eval.c, eval.h (scm_makprom, scm_force): Rewritten to be
1623 thread-safe;
1624
1625 * snarf.h (SCM_MUTEX, SCM_GLOBAL_MUTEX, SCM_REC_MUTEX,
1626 SCM_GLOBAL_REC_MUTEX): New macros.
1627
1628 * eval.c, threads.c, threads.h, snarf.h: Rewrote critical section
1629 macros---use mutexes instead.
1630
1631 * tags.h (SCM_IM_FUTURE): New tag.
1632
1633 * eval.c (scm_m_future): New primitive macro.
1634 (SCM_CEVAL): Support futures.
1635 (unmemocopy): Support unmemoization of futures.
1636
1637 * print.c (scm_isymnames): Name of future isym.
1638
2ff4f181
MD
1639 * version.c: Unmade some changes to my private copy that got
1640 committed by mistake.
1641
392d2833
MD
16422002-12-11 Mikael Djurfeldt <mdj@kvast.blakulla.net>
1643
e200ddee
MD
1644 * gc-malloc.c, gc.h, init.c: Reverted gc-malloc change of
1645 2002-12-10.
1646
392d2833
MD
1647 * gc.c (scm_igc): Don't call scm_i_thread_invalidate_freelists.
1648
1649 * gc.c (scm_gc_sweep): Call it here instead, which is a more
1650 logical place.
1651
1652 * threads.c (create_thread): Remember root object until the handle
1653 of the new thread is on all_threads list.
1654
1655 * root.c (scm_make_root): Moved copying of fluids until after
1656 creation of root handle so that the fluids are GC protected. Also
1657 removed the critical section.
1658
c4c52ebe
MD
16592002-12-10 Mikael Djurfeldt <mdj@kvast.blakulla.net>
1660
960c408c
MD
1661 * gc-malloc.c, gc.h (scm_gc_malloc_prehistory): New function.
1662
3cdde9d6 1663 * gc-malloc.c (malloc_mutex): New mutex.
960c408c 1664 (scm_gc_malloc_prehistory): Initialize it.
3cdde9d6
MD
1665 (scm_realloc): Serialize call to realloc
1666 (scm_calloc): Same for calloc.
1667 Thanks to Wolfgang Jaehrling!
1668 (Now we have to make sure all calls to malloc/realloc are made
1669 through scm_malloc.)
1670
960c408c
MD
1671 * init.c (scm_init_guile_1): Call scm_gc_malloc_prehistory.
1672
c4c52ebe
MD
1673 * threads.c (really_launch): Release heap (to prevent deadlock).
1674 (create_thread): Release heap before locking thread admin mutex.
1675
b0dc3d71
MD
16762002-12-10 Mikael Djurfeldt <mdj@kvast.blakulla.net>
1677
1678 * threads.c (scm_i_thread_invalidate_freelists): New
1679 function.
1680
1681 * gc.c (scm_igc): Call scm_i_thread_invalidate_freelists.
1682
1683 * modules.c (scm_export): Inserted a return statement.
1684
06e80f59
HWN
16852002-12-10 Han-Wen Nienhuys <hanwen@cs.uu.nl>
1686
1687 * modules.c (scm_export): new function
1688
1689 * gc-card.c: add a note about malloc()/free() overhead.
1690
a12611c3
MD
16912002-12-10 Mikael Djurfeldt <mdj@kvast.blakulla.net>
1692
1693 * Makefile.am (c-tokenize.$(OBJEXT)): Don't look for c-tokenize.c
1694 in srcdir.
1695
c7fabadf
MD
16962002-12-10 Mikael Djurfeldt <djurfeldt@nada.kth.se>
1697
1698 These changes remove scm_ints_disabled (which hasn't has any
1699 effect in Guile for quite some time).
1700
1701 * async.c, error.h (scm_ints_disabled): Removed.
1702
1703 * gc.c (scm_gc_for_newcell), init.c (scm_init_guile_1),
1704 root.c (scm_internal_cwdr), gdbint.c (SCM_BEGIN_FOREIGN_BLOCK,
1705 SCM_END_FOREIGN_BLOCK): Don't touch scm_ints_disabled.
1706 (old_ints): Removed.
1707
1708 * __scm.h (SCM_DEFER_INTS, SCM_ALLOW_INTS): Define as a recursive
1709 critical section.
1710 (SCM_REDEFER_INTS, SCM_ALLOW_INTS): Define as SCM_DEFER_INTS and
1711 SCM_ALLOW_INTS.
1712
9bc4701c
MD
17132002-12-09 Mikael Djurfeldt <djurfeldt@nada.kth.se>
1714
52340b65
MD
1715 * threads.c (scm_mutex_lock, scm_cond_wait, scm_cond_timedwait):
1716 Removed accidental #if 0 around these functions.
1717
9bc4701c
MD
1718 These changes are the start of support for preemptive
1719 multithreading. Marius and I have agreed that I commit this code
1720 into the repository although it isn't thoroughly tested and surely
1721 introduces many bugs. The bugs should only be exposed when using
1722 threads, though. Signalling and error handling for threads is
1723 very likely broken. Work on making the implementation cleaner and
1724 more efficient is needed.
1725
1726 * __scm.h (SCM_ALLOW_INTS_ONLY): Removed.
1727 (SCM_NONREC_CRITICAL_SECTION_START,
1728 SCM_NONREC_CRITICAL_SECTION_END, SCM_REC_CRITICAL_SECTION_START,
1729 SCM_REC_CRITICAL_SECTION_END): New macros.
1730 (SCM_CRITICAL_SECTION_START/END): Defined here.
1731
1732 * eval.c: Insert SOURCE_SECTION_START / SOURCE_SECTION_END around
1733 the three calls to scm_m_expand_body.
1734
1735 * gc.h: #include "libguile/pthread-threads.h";
1736 (SCM_FREELIST_CREATE, SCM_FREELIST_LOC): New macros.
1737
1738 * gc.c (scm_i_freelist, scm_i_freelist2): Defined to be of type
1739 scm_t_key;
1740
1741 * gc.c, gc-freelist.c, inline.h: Use SCM_FREELIST_LOC for freelist
1742 access.
1743
1744 * gc-freelist.c (scm_gc_init_freelist): Create freelist keys.
1745
1746 * gc-freelist.c, threads.c (really_launch): Use
1747 SCM_FREELIST_CREATE.
1748
1749 * gc-malloc.c (scm_realloc, scm_gc_register_collectable_memory):
1750
1751 * gc.c (scm_i_expensive_validation_check, scm_gc,
1752 scm_gc_for_newcell): Put threads to sleep before doing GC-related
1753 heap administration so that those pieces of code are executed
1754 single-threaded. We might consider rewriting these code sections
1755 in terms of a "call_gc_code_singly_threaded" construct instead of
1756 calling the pair of scm_i_thread_put_to_sleep () and
1757 scm_i_thread_wake_up (). Also, we would want to have as many of
1758 these sections eleminated.
1759
1760 * init.c (scm_init_guile_1): Call scm_threads_prehistory.
1761
1762 * inline.h: #include "libguile/threads.h"
1763
1764 * pthread-threads.h: Macros now conform more closely to the
1765 pthreads interface. Some of them now take a second argument.
1766
1767 * threads.c, threads.h: Many changes.
1768
17692002-12-09 Mikael Djurfeldt <djurfeldt@nada.kth.se>
1770
1771 * Makefile.am (version.h): Changed $^ --> $< in rule for
1772 version.h.
1773
b2cbe8d8
RB
17742002-12-08 Rob Browning <rlb@defaultvalue.org>
1775
1776 * version.h.in (SCM_MICRO_VERSION): use @--@ substitution now.
1777 (SCM_MINOR_VERSION): use @--@ substitution now.
1778 (SCM_MICRO_VERSION): use @--@ substitution now.
1779 (scm_effective_version): new function prototype.
1780
1781 * version.c (scm_effective_version): new function, also add
1782 effective-version.
1783
1784 * Makefile.am (schemelibdir): VERSION -> GUILE_EFFECTIVE_VERSION.
1785 (libpath.h): use GUILE_EFFECTIVE_VERSION to compute
1786 SCM_LIBRARY_DIR.
1787 (version.h): generate this here rather than configure.in. This
1788 approach tracks source edits better (i.e. more immediately).
1789 Might be worth considering for other .in files too.
1790
5441c65c
MV
17912002-12-02 Marius Vollmer <mvo@zagadka.ping.de>
1792
1793 Reorganized thread package selection. A thread package now only
1794 implements a small set of pthread like functions and Guile
1795 implements the rest on top of that. Guile's implementation is
1796 what the "coop-pthreads" package has been previously. Support for
1797 "coop" threads has been removed until I get time to add it again.
1798
1799 * Makefile.am (libguile_la_SOURCES): Removed iselect.c.
1800 (noinst_HEADERS): Removed coop-threads.c, coop-threads.h, coop.c,
1801 null-threads.c, coop-pthreads.c.
1802 (modinclude_HEADERS): Removed coop-defs.h, coop-pthreads.h. Added
1803 pthread-threads.h.
1804
1805 * validate.h (SCM_VALIDATE_THREAD): Moved to threads.h.
1806
1807 * threads.h: Do not include "libguile/coop-defs.h". Include
1808 "libguile/pthread-threads.h" for USE_COPT_THREADS. Removed
1809 (previously deprecated) C level thread API prototypes. They are
1810 now in the thread package specific headers, "null-threads.h" and
1811 "pthread-threads.h".
1812 (SCM_VALIDATE_THREAD, SCM_VALIDATE_MUTEX, SCM_VALIDATE_CONDVAR):
1813 New.
1814 (scm_threads_init): Removed.
1815 (SCM_CRITICAL_SECTION_START, SCM_CRITICAL_SECTION_END,
1816 SCM_THREAD_SWITCHING_CODE, scm_i_switch_counter,
1817 SCM_I_THREAD_SWITCH_COUNT): Define here.
1818 (scm_single_thread_p): Removed.
1819 (scm_call_with_new_thread): Take two args directly instead of list
1820 of two args.
1821 (scm_i_thread_data, scm_i_set_thread_data, SCM_THREAD_LOCAL_DATA,
1822 SCM_SET_THREAD_LOCAL_DATA): Define here.
1823
1824 * threads.c: Merged with "coop-pthreads.c".
1825
1826 * null-threads.h: Implement pthread-like API as a set of macros.
1827
1828 * pthread-threads.h: New, implement pthread-like API by deferring
1829 to pthread itself.
1830
1831 * init.c (scm_init_guile_1): Do not call scm_init_iselect, which
1832 has been lost in the reorganization.
1833
504d99c5
MD
18342002-12-01 Mikael Djurfeldt <mdj@linnaeus>
1835
1836 The following change makes it possible to move procedure
1837 application dispatch outside inner loops. The motivation was
1838 clean implementation of efficient replacements of R5RS primitives
1839 in SRFI-1.
1840
1841 The semantics is clear: scm_trampoline_N returns an optimized
1842 version of scm_call_N (or NULL if the procedure isn't applicable
1843 on N args).
1844
1845 Applying the optimization to map and for-each increases efficiency
1846 noticeably. For example, (map abs ls) is 8 times faster than
1847 before.
1848
1849 * eval.h (scm_t_trampoline_1, scm_t_trampoline_2): New types.
1850
1851 * eval.c, eval.h (scm_trampoline_1, scm_trampoline_2): New functions.
1852
1853 * eval.c (call_subr2_2, call_lsubr_2, call_closure_2): New functions;
1854 (map, for-each): Handle also application on two args as a special
1855 case; Use trampolines.
1856
1857 Other changes:
1858
1859 * sort.c (scm_cmp_function): Choose subr2less for scm_tc7_subr_2o;
1860 (subr2oless): Removed.
1861 (scm_restricted_vector_sort_x): Use scm_return_first to keep the
1862 vector GC protected.
1863
1864 * eval.c (check_map_args): Use scm_out_of_range_pos instead of
1865 scm_out_of_range.
1866
63dd3413
DH
18672002-11-24 Dirk Herrmann <D.Herrmann@tu-bs.de>
1868
1869 * evalext.[ch] (scm_m_undefine, undefine): Deprecated.
1870
4ba5f279
MD
18712002-11-17 Mikael Djurfeldt <mdj@linnaeus>
1872
1873 * debug.c (scm_make_iloc): Added missing "return".
1874
56ae231f
MV
18752002-11-17 Marius Vollmer <mvo@zagadka.ping.de>
1876
1877 * strports.c (scm_eval_string_in_module): Validate second arg to
1878 be a module. Thanks to Arno Peters!
1879
80b28865
DH
18802002-11-16 Dirk Herrmann <D.Herrmann@tu-bs.de>
1881
1882 * .cvsignore: remove goops.c
1883
c88b1456
DH
18842002-11-16 Dirk Herrmann <D.Herrmann@tu-bs.de>
1885
1886 * modules.c (scm_env_top_level, scm_lookup_closure_module,
1887 module_variable, scm_module_lookup_closure,
1888 scm_module_transformer, scm_sym2var, scm_module_reverse_lookup,
1889 scm_system_module_env_p): Don't compare SCM values with C
1890 operators == or !=. Avoid SCM_IMP predicates. Prefer !SCM_FALSEP
1891 over SCM_NFALSEP.
1892
a8a19efc
DH
18932002-11-16 Dirk Herrmann <D.Herrmann@tu-bs.de>
1894
1895 * eval.h (SCM_MAKE_ILOC): New macro.
1896
1897 * debug.c (scm_make_iloc): Use SCM_MAKE_ILOC instead of computing
1898 the iloc bitpattern here.
1899
76734914
MD
19002002-11-14 Mikael Djurfeldt <mdj@linnaeus>
1901
1902 * coop-pthreads.c, coop-pthreads.h: scm_internal_select should be
1903 part of the API, otherwise it's difficult to write Guile
1904 extensions using non-blocking I/O => moved #include
1905 "libguile/iselect.h" from coop-pthreads.c --> coop-pthreads.h.
1906
1907 * coop-pthreads.c (scm_unlock_mutex): Changed s_lock_mutex -->
1908 s_unlock_mutex.
1909
8b5b4a75
MV
19102002-11-10 Marius Vollmer <mvo@zagadka.ping.de>
1911
1912 * __scm.h (USE_THREADS, GUILE_ISELECT): Do not define here. They
1913 are defined in configure.in.
1914
1915 * threads.c: Removed SCM_API from function definitions. SCM_API
1916 is only for declarations.
1917
e5a83084
MD
19182002-11-07 Mikael Djurfeldt <mdj@linnaeus>
1919
9be8bb45
MD
1920 * coop-pthreads.h: Added support for thread specific data to the
1921 generic C API for the coop-pthreads case.
1922
e5a83084
MD
1923 * threads.c, threads.h (scm_cond_init): Undo unintentional API
1924 change.
6c214b62 1925 (scm_cond_broadcast): Added missing function.
e5a83084 1926
7edf178e
MV
19272002-11-04 Marius Vollmer <marius.vollmer@uni-dortmund.de>
1928
1929 * coop.c (coop_next_runnable_thread): Removed, wich should have
1930 happened when GUILE_ISELECT was hard-wired.
1931
7f5b1b77
MV
19322002-11-03 Marius Vollmer <mvo@zagadka.ping.de>
1933
7caa1b07
MV
1934 * Makefile.am (libguile_la_SOURCES): Added threads.c
1935 (DOT_DOC_FILES): Added threads.doc.
1936 (DOT_X_FILES): Added threads.x.
1937 (EXTRA_libguile_la_SOURCES): Removed threads.c.
1938 (noinst_HEADERS): Added coop-pthreads.c.
1939 (modinclude_HEADERS): Added coop-pthreads.h.
1940
1941 * __scm.h (USE_THREADS, GUILE_ISELECT): Define when
1942 SCM_DEBUG_DEPRECATED. Removed their use thru-out Guile.
1943
bb11cbf4
MV
1944 * iselect.c: Include "_scm.h" before testing HAVE_UNISTD_H.
1945 Thanks to Bill Schottstaedt!
1946
1d4cbbed
MV
1947 * numbers.c (scm_integer_expt): Make 0^z == 0 for z != 0.
1948
7f5b1b77
MV
1949 * _scm.h (HAVE_RESTARTABLE_SYSCALLS): Do define even when
1950 SCM_COPT_THREADS is defined.
1951 (SCM_SYSCALL): Use EINTR-expection version when SCM_COPT_THREADS
1952 is defined.
1953
1954 * coop-pthreads.c: Some harmless renamings of internal stuff.
1955 (create_thread): New, generalized version of
1956 scm_call_with_new_thread.
1957 (scm_call_with_new_thread): Use it.
1958 (scm_spawn_thread): New, use create_thread.
1959
d52f53b1
MV
19602002-11-02 Marius Vollmer <mvo@zagadka.ping.de>
1961
1962 * coop-pthreads.c, coop-pthreads.h: Redone completely, you might
1963 start testing it now.
1964
1965 * _scm.h: Include <errno.h< so that SCM_SYSCALL is correctly
1966 defined when HAVE_RESTARTABLE_SYSCALLS is not defined.
1967 (HAVE_RESTARTABLE_SYSCALLS): Do not define when USE_COPT_THREADS
1968 is defined.
1969
30f920c3
MV
19702002-10-27 Marius Vollmer <mvo@zagadka.ping.de>
1971
1972 * scmsigs.c (signal_cell_handlers, install_handler_data,
1973 scm_delq_spine_x, really_install_handler, install_handler): New
1974 scheme for triggering signal handlers, to simplify take_signal.
1975 (take_signal): Simplified, to avoid race conditions.
1976 (scm_sigaction_for_thread): Use new Scheme. Validate that thread
1977 hasn't exited yet.
1978
1979 * async.c (scm_async_click): Reset pending_asyncs, handle
1980 signal_asyncs. Don't set cdr of a non-signal async to #f.
1981 (scm_i_queue_async_cell): Do not check cdr of cell for #f, queue
1982 always. Set pending_asyncs.
1983 (scm_system_async_mark_for_thread): Check that thread has not
1984 exited.
1985 (scm_unmask_signals, decrease_block): Call scm_async_click after
1986 block_asyncs becomes zero.
1987
1988 * __scm.h (SCM_ASYNC_CLICK): Check pending_asyncs instead of
1989 active_asyncs.
1990
1991 * root.h (scm_root_state): Added pending_asyncs and signal_asyncs
1992 fields.
1993 * root.c (root_mark): Mark them.
1994 (make_root): Initialize them.
1995
1996 * iselect.c, iselect.h: Replaced GUILE_ISELECT with
1997 USE_COOP_THREADS.
1998 (scm_internal_select): Define one version for USE_COOP_THREADS and
1999 one for USE_NULL_THREADS.
2000 (scm_init_iselect): Likewise.
2001
2002 * inline.h (scm_cell, scm_double_cell): Also allow
2003 USE_COPT_THREADS to not protect the slot initializers.
2004
2005 * init.c (scm_init_guile_1): Call scm_init_thread_procs. This is
2006 because threads need to be initialized before the stack, but
2007 gsubrs such as scm_timed_condition_variable_wait can only be
2008 created later.
2009
2010 * threads.h: Include "coop-pthreads.h" when requested.
2011 (scm_threads_make_mutex, scm_threads_lock_mutex,
2012 scm_threads_unlock_mutex, scm_threads_monitor): Removed, they were
2013 not implemented anyway.
2014 (scm_init_thread_procs, scm_try_mutex,
2015 scm_timed_condition_variable_wait,
2016 scm_broadcast_condition_variable, scm_c_thread_exited_p,
2017 scm_thread_exited_p): New prototypes.
2018 (struct timespec): Define if not already defined.
2019 (scm_t_mutex, scm_mutex_init, scm_mutex_lock, scm_mutex_trylock,
2020 scm_mutex_unlock, scm_mutex_destroy, scm_t_cond, scm_cond_init,
2021 scm_cond_wait, scm_cond_timedwait, scm_cond_signal,
2022 scm_cond_broadcast, scm_cond_destroy): Declarations moved here and
2023 deprecated.
2024
2025 * threads.c: Include <errno.h>. Include "coop-pthreads.c" when
2026 requested.
2027 (scm_thread_exited_p): New.
2028 (scm_try_mutex, scm_broadcast_condition_variable): Newly
2029 registered procedures.
2030 (scm_wait_condition_variable, scm_timed_wait_condition_variable):
2031 Use the latter as the procedure for "wait-condition-variable",
2032 thus offering a optional timeout parameter to Scheme.
2033 (scm_wait_condition_variable): Implement in terms of
2034 scm_timed_wait_condition_variable.
2035 (scm_mutex_init, scm_mutex_lock, scm_mutex_trylock,
2036 scm_mutex_unlock, scm_mutex_destroy, scm_cond_init,
2037 scm_cond_wait, scm_cond_timedwait, scm_cond_signal,
2038 scm_cond_broadcast, scm_cond_destroy): Implement in terms of
2039 scm_make_mutex, etc, and deprecate.
2040 (scm_init_threads): Do not create smobs, leave this to
2041 scm_threads_init. Do not include "threads.x" file.
2042 (scm_init_thread_procs): New, include "threads.x" here.
2043
2044 * null-threads.h (scm_null_mutex, scm_null_mutex_init,
2045 scm_null_mutex_lock, scm_null_mutex_unlock,
2046 scm_null_mutex_destroy, scm_null_condvar, scm_null_condvar_init,
2047 scm_null_condvar_wait, scm_null_condvar_signal,
2048 scm_null_condvar_destroy): Removed.
2049 (scm_mutex_init, scm_mutex_lock, scm_mutex_unlock, scm_cond_init,
2050 scm_cond_wait, scm_cond_signal, scm_cond_broadcast,
2051 scm_cond_destory): Do not define, they are now deprecated and
2052 handled by threads.{h,c}.
2053
2054 * null-threads.c (scm_null_mutex, scm_null_cond): Define here.
2055 (scm_threads_init): Create smobs here, using the appropriate
2056 sizes.
2057 (block): Removed, now unused.
2058 (scm_c_thread_exited_p): New.
2059 (scm_null_mutex_init, scm_null_mutex_lock, scm_null_mutex_unlock,
2060 scm_null_mutex_destroy, scm_null_condvar_init,
2061 scm_null_condvar_wait, scm_null_condvar_signal,
2062 scm_null_condvar_destroy): Removed and updated users to do their
2063 task directly.
2064 (scm_try_mutex, timeval_subtract,
2065 scm_timed_wait_condition_variable,
2066 scm_broadcast_condition_variable): New.
2067 (scm_wait_condition_variable): Removed.
2068
2069 * coop-defs.h (coop_m): Added 'level' field.
2070 (scm_t_mutex, scm_mutex_init, scm_mutex_lock, scm_mutex_trylock,
2071 scm_mutex_unlock, scm_mutex_destroy, scm_t_cond, scm_cond_init,
2072 scm_cond_wait, scm_cond_timedwait, scm_cond_signal,
2073 scm_cond_broadcast, scm_cond_destroy, struct timespec): Do not
2074 define.
2075 (coop_condition_variable_broadcast): New.
2076
2077 * coop-threads.c (scm_threads_init): Create smobs here, using the
2078 appropriate sizes.
2079 (scm_c_thread_exited_p, scm_try_mutex,
2080 scm_timed_wait_condition_variable,
2081 scm_broadcast_condition_variable): New.
2082 (scm_wait_condition_variable): Removed.
2083
2084 * coop.c (coop_new_mutex_init): Initialize level.
2085 (coop_mutex_trylock, coop_mutex_lock, coop_mutex_unlock): maintain
2086 level.
2087 (coop_condition_variable_signal): Renamed to
2088 coop_condition_variable_broadcast and reimplemented in terms of
2089 that. Thus...
2090 (coop_condition_variable_broadcast): New.
2091
2092 * goops.c (hell_mutex): Reimplemented using scm_make_mutex, etc.
2093
2094 * coop-pthreads.h, coop-pthreads.c: New, but unfinished.
2095
087ed40d
MV
20962002-10-21 Marius Vollmer <mvo@zagadka.ping.de>
2097
65a23095
MV
2098 * null-threads.c: Include <time.h>. Also, use <...> for inclusion
2099 of system headers.
2100
087ed40d
MV
2101 * async.c, goops.h, modules.h, validate.h (SCM_MAKE_VALIDATE_MSG):
2102 New. Use it instead of SCM_MAKE_VALIDATE in lots of places to
30f920c3 2103 give better error messages. Thanks to Bill Schottstaedt!
087ed40d 2104
5ec1d2c8
DH
21052002-10-19 Dirk Herrmann <D.Herrmann@tu-bs.de>
2106
2107 * evalext.h, evalext.c (scm_definedp, scm_defined_p): Renamed
2108 scm_definedp to scm_defined_p and deprecated scm_definedp.
2109
100ae50d
DH
21102002-10-19 Dirk Herrmann <D.Herrmann@tu-bs.de>
2111
2112 * async.h, async.c (scm_system_async): Fixed deprecation to work
2113 correctly when deprecated features are excluded.
2114
2794cb50
MV
21152002-10-16 Marius Vollmer <marius.vollmer@uni-dortmund.de>
2116
2117 * async.c (scm_system_async_mark_for_thread): Validate thread
2118 argument.
2119
2120 * coop-threads.c (scm_i_thread_root): Do not validate argument.
2121
2122 * feature.c (scm_init_feature): Don't add 'threads' for
2123 USE_NULL_THREADS.
2124
2125 * inline.h (scm_cell, scm_double_cell): Also allow
2126 USE_NULL_THREADS to not protect the slot initializers.
2127
2128 * scmsigs.c (scm_sigaction_for_thread): It's "USE_THREADS" not
2129 "USE_THREAD".
2130
2131 * Makefile.am (noinst_HEADERS): Added null-threads.c.
2132 (modinclude_HEADERS): Added null-threads.h.
2133
2134 * threads.h: Include null-threads.h when !USE_COOP_THREADS.
2135 * threads.c: Include null-threads.c when !USE_COOP_THREADS.
2136 (scm_init_threads): Use generic type names scm_t_mutex and
2137 scm_t_cond instead of coop_m and coop_c.
2138
2139 * null-threads.c, null-threads.h: New files.
2140
ff810d7a
MV
21412002-10-15 Marius Vollmer <mvo@zagadka.ping.de>
2142
2143 * Makefile.am: Replaced "$<" in non-pattern rules with its value.
2144 This is to support makes that know about "$<" only in pattern
2145 rules, like Sun's make.
2146
a90bdb73
MV
21472002-10-13 Marius Vollmer <mvo@zagadka.ping.de>
2148
2149 * Makefile.am (libpath.h): Fixed typo in top_srcdir_absolute
2150 substitution. Thanks to David Allouche!
2151
e71a8bf2
DH
21522002-10-13 Dirk Herrmann <D.Herrmann@tu-bs.de>
2153
2154 * evalext.h: Replaced SCM_DEBUG_DEPRECATED with
2155 !SCM_ENABLE_DEPRECATED.
2156
41f77ff5
MV
21572002-10-11 Marius Vollmer <marius.vollmer@uni-dortmund.de>
2158
504d99c5 2159 * async.c (scm_system_async_mark_for_thread): Only call
41f77ff5
MV
2160 scm_i_thread_root when USE_THREADS is defined. Use scm_root
2161 otherwise.
2162
2163 * scmsigs.c (take_signal): Only call scm_i_thread_root when
2164 USE_THREADS is defined. Use scm_root otherwise.
2165 (scm_sigaction_for_thread): Ignore THREAD argument when
2166 USE_THREADS is not defined. Also, move THREAD argument defaulting
2167 out of HAVE_SIGACTION section, which was a bug.
2168
6d16b125
MV
21692002-10-10 Marius Vollmer <marius.vollmer@uni-dortmund.de>
2170
2171 * scmsigs.c (scm_sigaction_for_thread): Store original handler in
2172 signal_handlers, not the closure that is used as the async.
2173 The closure is stored in signal_handler_cells, as previously.
2174
acfa1f52
MV
21752002-10-10 Marius Vollmer <mvo@zagadka.ping.de>
2176
2177 * root.h (scm_root_state): Added 'block_async' slot.
2178 (scm_active_asyncs): Removed abbrev.
2179 * root.c (scm_make_root): Initialize 'block_asyncs' slot.
2180
2181 * __scm.h (SCM_ASYNC_TICK): Do without the scm_active_asyncs
2182 abbrev.
2183
2184 * async.h (scm_call_with_blocked_asyncs,
2185 scm_call_with_unblocked_asyncs, scm_c_call_with_blocked_asyncs,
2186 scm_c_call_with_unblocked_asyncs): New prototypes.
2187 (scm_mask_signals, scm_unmask_signals): Deprecated.
2188 (scm_mask_ints): Turned into a macro.
2189 * async.c (scm_mask_ints): Removed.
2190 (scm_run_asyncs): Do not set scm_mask_ints while running an async.
2191 this should not be necessary.
2192 (scm_async_click): Test block_asyncs instead of scm_mask_ints.
2193 (scm_mask_signals, scm_unmask_signals): Deprecated. Emit
2194 deprecation warning and check for errornous use. Set block_asyncs
2195 instead of scm_mask_ints.
2196 (increase_block, decrease_block, scm_call_with_blocked_asyncs,
2197 scm_call_with_unblocked_asyncs, scm_c_call_with_blocked_asyncs,
2198 scm_c_call_with_unblocked_asyncs): New.
2199
2200 * script.c (scm_compile_shell_switches): Do not set scm_mask_ints.
2201 Asyncs are enabled by default.
2202
34010f56
NJ
22032002-10-09 Neil Jerram <neil@ossau.uklinux.net>
2204
2205 * vports.c (scm_make_soft_port): Allow vector argument to carry a
2206 6th element: an input waiting thunk.
2207 (sf_input_waiting): New.
2208
9310d6f2
MV
22092002-10-05 Marius Vollmer <mvo@zagadka.ping.de>
2210
2211 * root.c (root_mark): Mark active_asyncs slot.
2212
2213 * async.c (scm_async_click): Set the cdr of a executed handler
2214 cell to SCM_BOOL_F, not SCM_EOL.
2215 (scm_i_queue_async_cell): Queue the cell at the end of the list,
2216 and only if the handler procedure is not already present.
2217 (scm_system_async_mark_for_thread): Initialize cdr of handler cell
2218 with SCM_BOOL_F.
2219 * scmsigs.c (scm_sigaction_for_thread): Likewise.
2220
ac48c719
RB
22212002-10-04 Rob Browning <rlb@defaultvalue.org>
2222
1360a142
RB
2223 * guile.c (main): switch to scm_lt_dlset_preloaded_symbols;
2224
2225 * dynl.c (sysdep_dynl_link): switch to scm_lt_dlhandle,
2226 scm_lt_dlopenext, and scm_lt_dlerror.
2227 (sysdep_dynl_unlink): switch to scm_lt_dlhandle, scm_lt_dlclose,
2228 and scm_lt_dlerror.
2229 (sysdep_dynl_func): switch to scm_lt_dlhandle, scm_lt_dlsym,
2230 and scm_lt_dlerror.
2231 (sysdep_dynl_init): switch to scm_lt_dlinit();
2232
2233 * Makefile.am (libguile_la_LIBADD): switch to use
2234 libguile-ltdl.la.
2235
504d99c5 2236 * numbers.c (scm_integer_expt): (expt 0 1) should be 1.
ac48c719 2237
497092c9
MV
22382002-10-04 Marius Vollmer <mvo@zagadka.ping.de>
2239
2240 * scmsigs.h (scm_sigaction_for_thread): New prototype.
2241 * scmsigs.c (got_signal): Removed.
2242 (signal_handler_cells, signal_handler_threads): New.
2243 (take_signal): Queue the cell of the signal for the specified
2244 thread. Reset the signal handler on systems that don't have
2245 sigaction.
2246 (sys_deliver_signals): Removed.
2247 (close_1): New.
2248 (scm_sigaction_for_thread): Renamed from scm_sigaction and
2249 extended to also set the thread of a signal and allocate a cell
2250 for it. Keep the Scheme name "sigaction". Check that signum is
2251 within range. Also, use SCM_VECTOR_REF instead of SCM_VELTS.
2252 (scm_sigaction): Implement in terms of scm_sigaction_for_thread.
2253 (scm_init_scmsigs): Allocate signal_handler_cells and
2254 signal_handler_threads vectors.
2255
2256 * async.c: Removed GUILE_OLD_ASYNC_CLICK code. Reorganized so
2257 that system asnycs and user asyncs are separated. Reimplemented
2258 system asyncs to work per-thread.
2259
2260 * gc.c (scm_init_gc): Do not use scm_system_async.
2261
2262 * async.h (scm_asyncs_pending, scm_set_tick_rate,
2263 scm_set_switch_rate, scm_system_async_mark_from_signal_handler):
2264 Removed prototypes.
2265 (scm_i_queue_async_cell): New.
2266
2267 * __scm.h (scm_asyncs_pending_p): Removed.
2268 (SCM_ASYNC_CLICK): Check scm_active_asyncs instead of
2269 scm_asyncs_pending_p.
2270
2271 * async.h (scm_system_async_mark_for_thread): New prototype.
2272
2273 * __scm.h: Removed GUILE_OLD_ASYNC_CLICK code.
2274
2275 * root.h (scm_root_state): Added new "active_asyncs" slot.
2276 * root.c (scm_make_root): Initialize it to SCM_EOL.
2277
2278 * coop-defs.h (coop_t): Added new "handle" slot.
2279 * coop-threads.c (all_threads, scm_current_thread,
2280 scm_all_threads, scm_i_thread_root): New.
2281 (scm_threads_init): Add main thread to all_threads.
2282 (scheme_launch_thread): Remove thread from all_threads when it
2283 terminates.
2284 (scm_call_with_new_thread): Initialize handle slot of coop_t
2285 structure and add new thread to all_threads.
2286 (scm_spawn_thread): Likewise.
2287
2288 * threads.h (scm_current_thread, scm_all_threads): New prototypes.
2289 * threads.c (scm_current_thread, scm_all_threads): Register as
2290 primitives.
2291
2292 * dynl.c: Use scm_lt_ prefix for libltdl functions.
2293
480fa28d
NJ
22942002-09-29 Neil Jerram <neil@ossau.uklinux.net>
2295
2296 * script.c (scm_compile_shell_switches): Fix bad spelling of
2297 `explicitly' in comment.
2298
22992002-09-28 Neil Jerram <neil@ossau.uklinux.net>
2300
2301 * posix.c (scm_geteuid, scm_getegid, scm_seteuid, scm_setegid):
2302 Refer to provided? in doc string rather than deprecated feature?.
2303
3553e1d1
GH
23042002-09-24 Gary Houston <ghouston@arglist.com>
2305
2306 * inline.h (scm_double_cell): prevent reordering of statements
2307 with any following code (for GCC 3 strict-aliasing).
2308 * numbers.c (scm_make_real), num2float.i.c (FLOAT2NUM): removed
2309 the earlier version of the reordering prevention.
2310
4ad0814a
HWN
23112002-09-19 Han-Wen Nienhuys <hanwen@cs.uu.nl>
2312
2313 * inline.h (scm_double_cell): move SET_GCMARK set out of if body.
2314
e88e4f2e
HWN
23152002-09-09 Han-Wen Nienhuys <hanwen@cs.uu.nl>
2316
2317 * gc-malloc.c (scm_gc_register_collectable_memory): more overflow
2318 protection.
2319
1e71eafb
HWN
23202002-09-08 Han-Wen Nienhuys <hanwen@cs.uu.nl>
2321
2322 * inline.h: include stdio.h
2323
2324 * smob.c (free_print): abort if scm_debug_cell_accesses_p is set
2325
61ef9c1f
HWN
23262002-09-05 Han-Wen Nienhuys <hanwen@cs.uu.nl>
2327
dac04e9f
HWN
2328 * gc-segment.c (scm_i_make_initial_segment): check user settings
2329 for sanity.
2330
2331 * gc-malloc.c (scm_gc_init_malloc): check user settings for
2332 sanity.
dac04e9f
HWN
2333
2334 * gc-freelist.c (scm_init_freelist): check user settings for sanity.
2335
ffd72400
HWN
2336 * struct.h: change scm_structs_to_free to scm_i_structs_to_free
2337
2338 * gc-malloc.c (scm_gc_register_collectable_memory): use floats;
1e71eafb
HWN
2339 these won't ever wrap around with high memory usage. Thanks to
2340 Sven Hartrumpf for finding this.
ffd72400 2341
5bd4a949
HWN
2342 * gc-freelist.c: include <stdio.h>
2343
61ef9c1f
HWN
2344 * gc-malloc.c: add DEBUGINFO for mtrigger GCs.
2345
ffd0ef3b
MV
23462002-09-01 Marius Vollmer <mvo@zagadka.ping.de>
2347
a27e3d14
MV
2348 * vectors.h (SCM_VECTOR_REF): New.
2349
ffd0ef3b
MV
2350 * snarf.h (SCM_DEFINE_PUBLIC): New.
2351
f8a1712b
MV
23522002-08-30 Marius Vollmer <mvo@zagadka.ping.de>
2353
2354 * socket.c (scm_addr_vector): Added size of address to arguments.
2355 Use it to avoid accessing a non-existent path in a sockaddr_un.
2356 Changed all callers.
2357
7200a36b
HWN
23582002-08-29 Han-Wen Nienhuys <hanwen@cs.uu.nl>
2359
1383773b
HWN
2360 * gc.h: remove DOUBLECELL card flags.
2361
2362 * gc-malloc.c (scm_calloc): try to use calloc() before calling
2363 scm_realloc().
2364
2365 * gc-segment.c (scm_i_initialize_heap_segment_data): remove card
2366 init loop; handle this from scm_init_card_freelist()
2367
2368 * gc-card.c (scm_init_card_freelist): init bit vector here.
2369
7200a36b 2370 * numbers.c (scm_make_real): prevent reordering of statements
8fa5786d 2371 num2float.i.c (FLOAT2NUM): idem
7200a36b 2372
9981de3a
HWN
23732002-08-27 Han-Wen Nienhuys <hanwen@cs.uu.nl>
2374
2375 * eval.h: prepend libguile/ to include path
2376
19647556
MV
23772002-08-26 Marius Vollmer <mvo@zagadka.ping.de>
2378
2379 * script.c (scm_compile_shell_switches): Added "2002" to Copyright
2380