(filter-map): More tests.
[bpt/guile.git] / libguile / ChangeLog
Content-type: text/html HCoop Git - bpt/guile.git/blame - libguile/ChangeLog


500 - Internal Server Error

Malformed UTF-8 character (fatal) at (eval 8) line 1, <$fd> line 3049.
CommitLineData
f1531813
KR
12005-03-13 Kevin Ryde <user42@zip.com.au>
2
3 * numbers.c, numbers.h (scm_i_clonebig): Remove static, so can use in
4 srfi-60.
5
6 * numbers.c (scm_logior): Must scm_i_normbig results as per scm_logand,
7 because OR-ing bits into a negative can reduce the value to an inum.
8
9 * numbers.c (scm_num_eq_p): On 64-bit systems, be careful about
10 casting inum to double since that can lose precision.
11
a9fae247
MV
122005-03-10 Marius Vollmer <marius.vollmer@uni-dortmund.de>
13
14 * threads.h, threads.c (scm_i_thread): Added gc_running_p field.
15 (guilify_self_1): Initialize it.
16
17 * gc.h, gc.c (SCM_FREECELL_P): Removed for good.
18 (scm_block_gc, scm_gc_heap_lock): Removed. Removed all uses.
19 (scm_gc_running_p): Now a macro that refers to the scm_i_thread
20 field.
21 (scm_i_sweep_mutex): Now a non-recursive mutex. GC can not happen
22 recursively.
23 (scm_igc, scm_i_gc): Renamed former to latter. Changed all uses.
24 Do not lock scm_i_sweep_mutex, which is now non-recursive, or set
25 scm_gc_running_p. Do not run the scm_after_gc_c_hook.
26 (scm_gc): Lock scm_i_sweep_mutex, set scm_gc_running_p and run the
27 scm_after_gc_c_hook here.
28 (scm_gc_for_new_cell): Set scm_gc_running_p here and run the
29 scm_after_gc_c_hook when a full GC has in fact been performed.
30 (scm_i_expensive_validation_check): Call scm_gc, not scm_i_gc.
31
32 * gc-segment.c (scm_i_get_new_heap_segment): Do not check
33 scm_gc_heap_lock.
34
35 * gc-malloc.c (scm_realloc, increase_mtrigger): Set
36 scm_gc_running_p while the scm_i_sweep_mutex is locked.
37
38 * inline.h (scm_cell, scm_double_cell): Do not check
39 scm_gc_running_p, allocation during sweeping is OK.
40
41 * gdbint.c (SCM_BEGIN_FOREIGN_BLOCK, SCM_END_FOREIGN_BLOCK): Do
42 not set scm_block_gc.
43
44 * init.c (scm_i_init_guile): Do not set scm_block_gc.
45
46 * deprecation.c (scm_c_issue_deprecation_warning): Use malloc
47 instead of scm_malloc. The latter can not be used during GC.
48
d1c38e11
MV
492005-03-09 Marius Vollmer <mvo@zagadka.de>
50
51 * script.c (scm_compile_shell_switches): Added 2005 to Copyright
52 years.
53
99ec43c1
MV
542005-03-09 Marius Vollmer <marius.vollmer@uni-dortmund.de>
55
56 * gc-card.c (scm_i_sweep_card): Do not increase/decrease
57 scm_gc_running_p. Sweeping can happen in parallel with
58 allocation.
59
60 * inline.h: Updated comments for current threading implementation.
61
62 * threads.h, threads.c (scm_i_frame_single_threaded): Removed.
63 (scm_i_thread): Removed unused signal_asyncs field.
64 (threads_mark): Do not mark it.
65 (guilify_self_1): Do not initialize it. Do initialize
66 continuation_root field.
67 (do_thread_exit): Do not remove thread from all_threads list.
68 (on_thread_exit): Do it here, after leaving guile mode.
69 (sleep_level): Removed.
70 (scm_i_thread_put_to_sleep): Leave thread_admin_mutex locked when
71 returning. Do not support recursive sleeps.
72 (scm_i_thread_wake_up): Expect thread_admin_mutex to be locked on
73 entry. Do not support recursive sleeps.
74
75 * fluids.c (ensure_state_size, ensure_all_state_sizes,
76 resize_all_states): Collapsed ensure_state_size and
77 ensure_all_state_sizes into one function named resize_all_states.
78 Allocate new vectors outside of single threaded region. Do only
79 simple things inside that region.
80 (scm_make_fluid, scm_make_dynamic_state): Lock fluid_admin_mutex
81 while adding to the global lists.
82
83
461f34aa
MV
842005-03-08 Marius Vollmer <mvo@zagadka.de>
85
86 libltdl is no longer distributed. We expect it to be installed
87 already.
88
89 * Makefile.am (INCLUDES): Removed @LTDLINCL@.
90 (libguile_la_LIBADD): Removed @LIBLTDL@.
91
4e047c3e
MV
922005-03-07 Marius Vollmer <mvo@zagadka.de>
93
94 * threads.h, async.h, threads.c (SCM_CRITICAL_SECTION_START,
95 SCM_CRITICAL_SECTION_END): Moved here from threads.h since now
96 they also block/unblock execution of asyncs and call
97 scm_async_click which is declared in async.h but threads.h can not
98 include async.h since async.h already includes threads.h.
99 (scm_i_critical_section_level): New, for checking mistakes in the
100 use of the SCM_CRITICAL_SECTION_* macros.
101 (scm_i_critical_section_mutex): Make it a recursive mutex so that
102 critical sections can be nested.
103
104 * throw.c (scm_ithrow): Abort when scm_i_critical_section_level is
105 not zero.
106
107 * threads.h, threads.c (scm_frame_lock_mutex): New.
108 (scm_frame_critical_section): Take mutex as argument.
109 (framed_critical_section_mutex): New, used as default for above.
110 (scm_init_threads): Initialize it.
111 (scm_threads_prehistory): Do not initialize thread_admin_mutex and
112 scm_i_critical_section_mutex; both are initialized statically.
113
114 * continuation.c, deprecated.c, goops.c, guardians.c keywords.c,
115 libguile_la-arrays.loT, objprop.c, ports.c, smob.c, sort.s,
b9d9ad3a
MV
116 srcprop.c, stime.c, struct.c, throw.c, regex-posix.c: Include
117 "libguile/async.h" for SCM_CRITICAL_SECTION_START/END.
4e047c3e
MV
118
119 * debug.c (scm_debug_options): Replace
120 SCM_CRITICAL_SECTION_START/END with a frame and
121 scm_frame_critical_section.
122
123 * continuations.c (scm_make_continuation): No longer a critical
124 section.
125 (scm_dynthrow): Abort when scm_i_critical_section_level is
126 not zero.
127
d0a45bff
MV
1282005-03-04 Marius Vollmer <marius.vollmer@uni-dortmund.de>
129
db6673e5
MV
130 * threads.c (scm_try_mutex): Renamed argument for consistency.
131
d0a45bff
MV
132 * root.c (scm_call_with_dynamic_root): New docstring.
133
134 * eval.c: Define _GNU_SOURCE.
135
9de87eea
MV
1362005-03-02 Marius Vollmer <marius.vollmer@uni-dortmund.de>
137
138 Big merge from the mvo-thread-cleanup branch. The main changes
139 are:
140
141 - The dynamic roots functionality has been split into dynamic
142 states and continuations barriers. Fluids have been
143 reimplemented and can now be garbage collected.
144
145 - Initialization of Guile now works in a multi-thread friendly
146 manner. Threads can freely enter and leave guile mode.
147
148 - Blocking on mutexes or condition variables or while selecting
149 can now be reliably interrupted via system asyncs.
150
151 - The low-level threading interface has been removed.
152
153 - Signals are delivered via a pipe to a dedicated 'signal delivery
154 thread'.
155
156 - SCM_DEFER_INTS, SCM_ALLOW_INTS etc have been deprecated.
157
158 * throw.c (scm_handle_by_message): Exit only the current thread,
159 not the whole process.
160 (scm_handle_by_message_noexit): Exit when catching 'quit.
161
162 * scmsigs.c (take_signal, signal_delivery_thread,
163 start_signal_delivery_thread, ensure_signal_delivery_thread,
164 install_handler): Reimplemented signal delivery as explained in
165 the comments.
166
167 * pthreads-threads.h (scm_i_pthread_t, scm_i_pthread_self,
168 scm_i_pthread_create, scm_i_pthread_detach, scm_i_pthread_exit,
169 scm_i_sched_yield, scm_i_pthread_sigmask,
170 SCM_I_PTHREAD_MUTEX_INITIALIZER,
171 SCM_I_PTHREAD_RECURSIVE_MUTEX_INITIALIZER, scm_i_pthread_mutex_t ,
172 scm_i_pthread_mutex_init, scm_i_pthread_mutex_destroy,
173 scm_i_pthread_mutex_trylock, scm_i_pthread_mutex_lock,
174 scm_i_pthread_mutex_unlock, SCM_I_PTHREAD_COND_INITIALIZER,
175 scm_i_pthread_cond_t, scm_i_pthread_cond_init,
176 scm_i_pthread_cond_destroy, scm_i_pthread_cond_signal,
177 scm_i_pthread_cond_broadcast, scm_i_pthread_cond_wait,
178 scm_i_pthread_cond_timedwait, scm_i_pthread_once_t,
179 SCM_I_PTHREAD_ONCE_INIT, scm_i_pthread_once, scm_i_pthread_key_t ,
180 scm_i_pthread_key_create, scm_i_pthread_setspecific,
181 scm_i_pthread_getspecific, scm_i_scm_pthread_mutex_lock,
182 scm_i_frame_pthread_mutex_lock, scm_i_scm_pthread_cond_wait,
183 scm_i_scm_pthread_cond_timedwait): Provide the obvious mapping
184 when using pthreads.
185 * null-threads.c, null-threads.h: Provide dummy definitions for
186 the above symbols when not using pthreads.
187
188 * modules.h, modules.c (scm_frame_current_module): New.
189
190 * load.c (scm_primitive_load): Use scm_i_frame_current_load_port
191 instead of scm_internal_dynamic_wind.
192
193 * init.h, init.c (restart_stack, start_stack): Removed.
194 (scm_boot_guile, invoke_main_func): Simply use scm_with_guile.
195 (scm_boot_guile_1): Removed.
196 (scm_i_init_mutex): New.
197 (really_cleanup_for_exit, cleanup_for_exit): New.
198 (scm_init_guile_1, scm_i_init_guile): Renamed former to latter.
199 Moved around some init funcs. Call
200 scm_init_threads_default_dynamic_state. Register cleanup_for_exit
201 with atexit.
202
203 * hashtab.c (scm_hash_fn_create_handle_x, scm_hash_fn_remove_x):
204 Use "!scm_is_eq" instead of "!=".
205
206 * ge-scmconfig.c, gen-scmconfig.h.in (SCM_I_GSC_USE_COOP_THREADS,
207 SCM_USE_COOP_THREADS): Removed.
208
209 * gc.c (scm_igc): Take care that scm_gc_running_p is properly
210 maintained. Unlock scm_i_sweep_mutex before running
211 scm_after_gc_c_hook.
212 (scm_permanent_object): Allocate outside of critical section.
213 (cleanup): Removed.
214
215 * fluids.h, fluids.c: Reimplemented completely.
216 (SCM_FLUID_NUM, SCM_FAST_FLUID_REF,
217 SCM_FAST_FLUID_SET): Reimplemented as functions.
218 (scm_is_fluid): New.
219 (scm_i_make_initial_fluids, scm_i_copy_fluids): Removed.
220 (scm_make_dynamic_state, scm_dynamic_state_p,
221 scm_is_dynamic_state, scm_current_dynamic_state,
222 scm_set_current_dynamic_state, scm_frame_current_dynamic_state,
223 scm_c_with_dynamic_state, scm_with_dynamic_state,
224 scm_i_make_initial_dynamic_state, scm_fluids_prehistory): New.
225
226 * feature.c (progargs_fluid): New.
227 (scm_program_arguments, scm_set_program_arguments): Use it instead
228 of scm_progargs.
229 (scm_init_feature): Allocate it. Also, only add "threads" feature
230 when SCM_USE_PTHREAD_THREADS is true.
231
232 * eval.c (scm_makprom): Use scm_make_recursive_mutex instead of
233 scm_make_rec_mutex, with all the consequences.
234 (scm_eval_x, scm_eval): Use scm_frame_begin etc instead of
235 scm_internal_dynamic_wind. Handle dynamic states as second
236 argument.
237
238 * threads.h, threads.c (scm_internal_select): Renamed to
239 scm_std_select and discouraged old name.
240 (scm_thread_sleep, scm_thread_usleep): Likewise, as scm_std_sleep
241 and scm_std_usleep.
242 (scm_tc16_fair_mutex, scm_tc16_fair_condvar, SCM_MUTEXP,
243 SCM_FAIR_MUTEX_P, SCM_MUTEX_DATA, SCM_CONDVARP,
244 SCM_FAIR_CONDVAR_P, SCM_CONDVAR_DATA, SCM_THREADP,
245 SCM_THREAD_DATA): Removed.
246 (SCM_I_IS_THREAD, SCM_I_THREAD_DATA): New.
247 (scm_i_thread): New.
248 (SCM_VALIDATE_THREAD, SCM_VALIDATE_MUTEX, SCM_VALIDATE_CONDVAR):
249 Use scm_assert_smob_type.
250 (scm_c_scm2thread, scm_thread_join, scm_thread_detach,
251 scm_thread_self, scm_thread_yield, scm_mutex_init,
252 scm_mutex_destroy, scm_mutex_trylock, scm_mutex_unlock,
253 scm_rec_mutex_init, scm_rec_mutex_destroy, scm_make_rec_mutex,
254 scm_rec_mutex_free, scm_rec_mutex_lock, scm_rec_mutex_trylock,
255 scm_cond_init, scm_cond_destroy, scm_cond_wait,
256 scm_cond_timedwait, scm_cond_signal, scm_cond_broadcast,
257 scm_key_create, scm_key_delete, scm_setspecific, scm_getspecific,
258 scm_thread_select): Removed. Replaced with scm_i_pthread
259 functions as appropriate.
260 (scm_in_guile, scm_outside_guile): Removed.
261 (scm_t_guile_ticket, scm_leave_guile, scm_enter_guile): Return and
262 take a ticket.
263 (scm_with_guile, scm_without_guile, scm_i_with_guile_and_parent):
264 New.
265 (scm_i_frame_single_threaded): New.
266 (scm_init_threads_default_dynamic_state): New.
267 (scm_i_create_thread): Removed.
268 (scm_make_fair_mutex, scm_make_fair_condition_variable): Removed.
269 (scm_make_recursive_mutex): New.
270 (scm_frame_critical_section): New.
271 (SCM_CURRENT_THREAD, SCM_I_CURRENT_THREAD): Renamed former to
272 latter, changed all uses.
273 (scm_i_dynwinds, scm_i_setdynwinds, scm_i_last_debug_frame,
274 scm_i_set_last_debug_frame): New, use them instead of scm_root
275 stuff.
276 (SCM_THREAD_LOCAL_DATA, SCM_SET_THREAD_LOCAL_DATA,
277 scm_i_root_state_key,m scm_i_set_thread_data): Removed.
278 (scm_pthread_mutex_lock, scm_frame_pthread_mutex_lock,
279 scm_pthread_cond_wait, scm_pthread_cond_timedwait).
280 (remqueue): Allow the removal of already removed cells. Indicate
281 whether a real removal has happened.
282 (scm_thread): Removed, replaced with scm_i_thread.
283 (make_thread, init_thread_creatant): Removed.
284 (cur_thread): Removed.
285 (block_self, unblock_from_queue): New.
286 (block, timed_block, unblock): Removed.
287 (guilify_self_1, guilify_self_2, do_thread_exit,
288 init_thread_key_once, init_thread_key,
289 scm_i_init_thread_for_guile, get_thread_stack_base,
290 scm_init_guile): New initialisation method.
291 (scm_call_with_new_thread, scm_spawn_thread): Use it to simplify
292 thread creation.
293 (fair_mutex, fat_mutex, etc, fair_condvar, fat_condvar): Renamed
294 "fair" to fat and implemented new semantics, including reliable
295 interruption.
296 (all_threads): Now a pointer to a scm_i_thread, not a SCM.
297 (scm_threads_mark_stacks): Explicitly mark handle.
298 (scm_std_select): Allow interruption by also selecting on the
299 sleep_pipe.
300 (scm_i_thread_put_to_sleep): Handle recursive requests for
301 single-threadedness.
302 (scm_threads_prehistory, scm_init_threads): Put current thread
303 into guile mode via guileify_self_1 and guileify_self_2,
304 respectively.
305
306 * fluid.h (SCM_FLUIDP): Deprecated.
307
308 * coop-threads.c: Removed.
309
310 * continuations.h, continuations.c (scm_with_continuation_barrier,
311 scm_c_with_continuation_barrier, scm_i_with_continuation_barrier):
312 New.
313
314 * async.h, async.c (scm_i_setup_sleep, scm_i_reset_sleep): New.
315 (async_mutex): New.
316 (scm_async_click): Protected with async_mutex. Do not deal with
317 signal_asyncs, which are gone. Set cdr of handled async cell to
318 #f.
319 (scm_i_queue_async_cell): Protected with async_mutex. Interrupt
320 current sleep.
321 (scm_system_async_mark_for_thread): Do not use scm_current_thread
322 since that might not work during early initialization.
323
324 * __scm.h (SCM_DEFER_INTS, SCM_ALLOW_INTS, SCM_REDEFER_INTS,
325 SCM_REALLOW_INTS): Deprecated by moving into deprecated.h and
326 deprecated.c. Replaced all uses with SCM_CRITICAL_SECTION_START
327 and SCM_CRITICAL_SECTION_END.
328 (SCM_ENTER_A_SECTION, SCM_EXIT_A_SECTION): Removed. Replaced with
329 SCM_CRITICAL_SECTION_START/END.
330
331 * Makefile.am (modinclude_HEADER): Removed threads-plugin.h.
332 (libguile_la_SOURCES): Added null-threads.c
333 (EXTRA_libguile_la_SOURCES): Removed pthread-threads.c and
334 threads-plugin.c.
335 * pthread-threads.c, threads-plugin.c, threads-plugin.h: Removed.
336
337 * root.h, root.c (scm_tc16_root, SCM_ROOTP, SCM_ROOT_STATE,
338 scm_root_state, scm_stack_base, scm_save_regs_gc_mark,
339 scm_errjmp_bad, scm_rootcont, scm_dynwinds, scm_progargs,
340 scm_last_debug_frame, scm_exitval, scm_cur_inp, scm_outp,
341 scm_cur_err, scm_cur_loadp, scm_root, scm_set_root,
342 scm_make_root): Removed or deprecated. Replaced with references
343 to the current thread, dynamic state, continuation barrier, or
344 some fluid, as appropriate.
345 (root_mark, root_print): Removed.
346 (scm_internal_cwdr): Reimplemented guts with
347 scm_frame_current_dynamic_state and
348 scm_i_with_continuation_barrier.
349 (scm_dynamic_root): Return current continuation barrier.
350
351
ad3d5a65
MV
3522005-02-28 Marius Vollmer <mvo@zagadka.de>
353
354 * socket.c (scm_setsockopt): Handle IP_ADD_MEMBERSHIP and
355 IP_DROP_MEMBERSHIP options. Also, reorganized the code a bit for
356 cleanliness.
357 (scm_init_socket): Define IP_ADD_MEMBERSHIP and
358 IP_DROP_MEMBERSHIP.
359 Thanks to Greg Troxel!
360
73a90115
MD
3612005-02-27 Mikael Djurfeldt <djurfeldt@nada.kth.se>
362
363 * gh.h: Bugfix: Include <libguile.h> outside of the extern "C"
364 block.
365
5d2cb3ab
MV
3662005-02-25 Marius Vollmer <mvo@zagadka.de>
367
368 * hashtab.c (scm_i_rehash): Remove elements from old bucket vector
369 so that no two weak alist vectors share a spine.
370 (scm_hash_fn_create_handle_x): Deal with a possible rehashing
371 during GC before inserting the new alist cell.
372
838c4126
MV
3732005-02-23 Marius Vollmer <marius.vollmer@uni-dortmund.de>
374
375 * hashtab.c (scm_i_rehash): Cope with the case that a GC modifies
376 the hashtable.
377 (scm_hash_fn_create_handle_x): Likewise.
378 * vectors.h (SCM_I_SET_WVECT_TYPE): New, for use in scm_i_rehash.
379
29fed193
MD
3802005-02-10 Mikael Djurfeldt <djurfeldt@nada.kth.se>
381
382 * unif.c (prototype_to_type): Bugfix: Don't compare prototype to
383 the prototypical examples mentioned in the old reference manual.
384 Instead keep the old semantics of dispatching on type. (Yes, this
385 is extremely ugly, but the whole point of keeping the deprecated
386 interface is not to break old code.)
387
9cc49060
MD
3882005-02-08 Mikael Djurfeldt <djurfeldt@nada.kth.se>
389
390 * deprecated.h (SCM_ARRAY_DIMS): Rename scm_i_attay_dims -->
391 scm_i_array_dims.
392
8447f463
KR
3932005-01-28 Kevin Ryde <user42@zip.com.au>
394
395 * numbers.c (scm_ash): Rewrite using shifts, much faster than
396 integer-expt and multiply/divide. Inexacts and fractions no longer
397 supported (they happened to work before for left shifts, but not
398 right). Don't really need inexacts and fractions, since ash is
399 documented as a "bitwise operation", and all the rest of those only
400 take exact integers.
401
1367aa5e
HWN
4022005-01-27 Han-Wen Nienhuys <hanwen@xs4all.nl>
403
856fca7e
HWN
404 * gc-card.c (scm_i_card_statistics): map structs, closures and
405 subrs to one tag.
406
1367aa5e 407 * gc.c (s_scm_gc_live_object_stats): return alist, not hashtable.
856fca7e 408 (tag_table_to_type_alist): ignore unknown types.
1367aa5e
HWN
409
410 * gc-segment.c (scm_i_all_segments_statistics): new function.
411 (scm_i_heap_segment_statistics): new function
412
413 * gc.c (s_scm_gc_live_object_stats): new GUILE callable: return
414 statistics on the number of live objects of each type.
415
416 * gc-card.c (scm_i_tag_name): new function.
417 (scm_i_card_statistics): new function.
418
333db3b8
KR
4192005-01-24 Kevin Ryde <user42@zip.com.au>
420
421 * posix.c (scm_setlocale): Force errno=EINVAL for an error, since
422 POSIX and C99 don't document errno being set. Reported by Bruno
423 Haible.
424 (scm_flock): Update docstring from manual.
425
8447f463
KR
426 * random.c (scm_i_init_rstate): Compare w to -1 not 0xffffffffUL, now
427 that it's an scm_t_int32. Otherwise gcc 3.4 says it's always false on
428 a 64-bit system.
429
430 * scmsigs.c (scm_sigaction_for_thread): Use scm_to_long for
431 sa_handler, needs to be a long on 64-bit systems where int is only 32
432 bits.
433
88f59e53
MV
4342005-01-20 Marius Vollmer <marius.vollmer@uni-dortmund.de>
435
0eeb2611
MV
436 * environments.c (obarray_enter, obarray_replace): Call
437 SCM_HASHTABLE_INCREMENT when adding a new entry.
438
88f59e53
MV
439 * objects.c: Include goops.h for the scm_class_of prototype.
440
441 * hashtab.c (hashtable_size, HASHTABLE_SIZE_N): Restrict hashtable
442 sizes to be smaller than the maximum lengths of vectors.
443
219b2868
MV
4442005-01-18 Marius Vollmer <marius.vollmer@uni-dortmund.de>
445
446 * ports.c, smob.c: Include "libguile/goops.h".
447
448 * objects.h, objects.c, goops.c, goops.h (scm_class_boolean,
449 scm_class_char, scm_class_pair, scm_class_procedure,
450 scm_class_string, scm_class_symbol,
451 scm_class_procedure_with_setter, scm_class_primitive_generic,
452 scm_class_vector, scm_class_null, scm_class_real,
453 scm_class_complex, scm_class_integer, scm_class_fraction,
454 scm_class_unknown, scm_port_class, scm_smob_class,
455 scm_no_applicable_method, scm_class_of): Moved from objects to
456 goops since they are only useable once goops has been loaded.
457 (scm_classes_initialized): Removed.
458 (scm_class_of): Do not check it.
459 (create_standard_classes): Do not set it.
460
009c6b9c
MV
4612005-01-17 Marius Vollmer <marius.vollmer@uni-dortmund.de>
462
50472546
MV
463 * objects.h, objects.c (scm_classes_initialized): New.
464 (scm_class_of): Signal error when scm_classes_initialized is zero.
465 * goops.c (create_standard_classes): Set scm_classes_initialized
466 to one.
467
009c6b9c
MV
468 * random.c (scm_random_solid_sphere_x): Use
469 scm_c_generalized_vector_length instead of
470 scm_uniform_vector_length.
471
7719cbe9
MV
4722005-01-16 Marius Vollmer <mvo@zagadka.de>
473
474 * script.c (scm_compile_shell_switches): Removed debugging output.
475
1ec44fed
KR
4762005-01-15 Kevin Ryde <user42@zip.com.au>
477
478 * numbers.c (scm_logtest, scm_logbit_p, scm_integer_expt): Update
479 docstrings from manual.
480 * random.c (scm_random_solid_sphere_x): Update docstring from manual.
481
6e4cd850
MV
4822005-01-14 Marius Vollmer <marius.vollmer@uni-dortmund.de>
483
0b5a0521
MV
484 * random.c: Don't check for definedness of SCM_HAVE_T_INT64, check
485 its value.
486
487 Implement u64 and s64 uniform numeric vectors with bignums when
488 scm_t_uint64 and scm_t_int64 are not available.
489
490 * srfi-4.h, srfi-4.c, srfi-4.i.c (scm_take_u64vector,
491 scm_array_handle_u64_elements,
492 scm_array_handle_u64_writable_elements, scm_u64vector_elements,
493 scm_u64vector_writable_elements): Do not define when scm_t_uint64
494 is not available.
495 (scm_take_s64vector, scm_array_handle_s64_elements,
496 scm_array_handle_s64_writable_elements, scm_s64vector_elements,
497 scm_s64vector_writable_elements): Likewise for scm_t_int64.
498 (uvec_sizes, uvec_print, uvec_equalp): Use SCM bignums when
499 scm_t_int64/scm_t_uint64 are not available.
500 (uvec_mark): New, to mark the bignums.
501 (alloc_uvec): Initialize bignums.
502 (uvec_fast_ref): Return bignums directly.
503 (scm_uint64_min, scm_uint64_max, scm_int64_min, scm_int64_max,
504 assert_exact_integer): New.
505 (uvec_fast_set): Use them to validate the bignums.
506 (scm_init_srfi_4): Set mark function of smob when needed.
507 Initialize scm_uint64_min, scm_uint64_max, scm_int64_min,
508 scm_int64_max.
509
6e4cd850
MV
510 Recognize 1.4 -e syntax.
511
512 * script.c (sym_at, sym_atat, sym_main, all_symbols): New.
513 (scm_compile_shell_switches): Use them to recognize and convert
514 1.4 "-e" syntax.
515
3b698afe
MV
5162005-01-12 Marius Vollmer <marius.vollmer@uni-dortmund.de>
517
518 * deprecated.h, deprecated.c, strings.h, strings.c: Turn all
519 deprecated features that once were macros but are now functions
520 back into macros.
521
d6dc83a9
MV
5222005-01-11 Marius Vollmer <marius.vollmer@uni-dortmund.de>
523
49086691
MV
524 * eval.c, debug.h (SCM_WARN_DEPRECATED): New debug option.
525 * deprecation.c (scm_issue_deprecation_warning,
526 scm_c_issue_deprecation_warning_fmt): Use it.
527 (mode): Removed.
528 (print_summary): New.
529 (scm_init_deprecation): Initialize SCM_WARN_DEPRECATED instead of
530 mode.
531
d6dc83a9
MV
532 Deprecated SCM_ARRAY* macros.
533
534 * unif.h, unif.c, ramap.c, vectors.c, srfi-4.c, srfi-4.i.c
535 (SCM_ARRAYP, SCM_I_ARRAYP): Renamed former to latter internal
536 version. Changed all uses.
537 (scm_tc16_array, scm_i_tc16_array,
538 scm_tc16_enclosed_array, scm_i_tc16_enclosed_array,
539 SCM_ARRAY_FLAG_CONTIGUOUS, SCM_I_ARRAY_FLAG_CONTIGUOUS,
540 SCM_ENCLOSE_ARRAYP, SCM_I_ENCLOSE_ARRAYP,
541 SCM_ARRAY_NDIM, SCM_I_ARRAY_NDIM,
542 SCM_ARRAY_CONTP, SCM_I_ARRAY_CONTP,
543 SCM_ARRAY_MEM, SCM_I_ARRAY_MEM,
544 SCM_ARRAY_V, SCM_I_ARRAY_V,
545 SCM_ARRAY_BASE, SCM_I_ARRAY_BASE,
546 SCM_ARRAY_DIMS, SCM_I_ARRAY_DIMS,
547 scm_t_array, scm_i_t_array): Likewise.
548 (SCM_SET_ARRAY_CONTIGUOUS_FLAG, SCM_CLR_ARRAY_CONTIGUOUS_FLAG):
549 Moved from unif.h to unif.c.
550 (scm_c_array_rank): New.
551 (scm_array_rank): Reimplement using it.
552
553 * deprecated.h, deprecated.c (SCM_ARRAYP, SCM_ARRAY_NDIM,
554 SCM_ARRAY_CONTP, SCM_ARRAY_MEM, SCM_ARRAY_V, SCM_ARRAY_BASE,
555 SCM_ARRAY_DIMS, scm_t_array): New deprecated versions.
556
dc91d8de
MV
5572005-01-11 Marius Vollmer <mvo@zagadka.de>
558
559 * ramap.c: Replace uses of scm_make_ra with scm_i_make_ra.
560 (GVREF, GVSET): New abbreviations. Use them everywhere instead of
561 scm_c_generalized_vector_ref and scm_cvref, and
562 scm_c_generalized_vector_set_x, respectively.
563 (RVREF, IVDEP, BINARY_ELTS_CODE, BINARY_PAIR_ELTS_CODE,
564 UNARY_ELTS_CODE, UNARY_PAIR_ELTS_CODE): Removed since unused.
565
566 * unif.h, unif.c (indices_to_pos, scm_array_handle_pos): Renamed
567 former to latter and made public. Changed all uses.
568 (scm_i_make_ra): Made public, changed tag param to enclosed flag.
569 (scm_make_ra): Deprecated, changed all uses to scm_i_make_ra.
570 (scm_i_shap2ra): New internal version of scm_shap2ra.
571 (scm_shap2ra): Deprecated, changed all uses to scm_i_shap2ra.
572 (scm_i_ra_set_contp): New internal version of scm_ra_set_contp.
573 (scm_ra_set_contp): Deprecated, changed all uses to
574 scm_i_ra_set_contp.
575 (scm_cvref, scm_aind, scm_raprin1): Deprecated.
576
66d33784
MV
5772005-01-10 Marius Vollmer <marius.vollmer@uni-dortmund.de>
578
b06f099d
MV
579 * eval.c (scm_eval): Added example to docstring. Thanks to Issac
580 Trotts!
581
5d35ad81
MV
582 * unif.c (scm_list_to_typed_array): Allow the specification of the
583 upper bound as well. This is needed for empty arrays.
584 (l2ra): Give needed number of elements in error message.
585 (scm_i_print_array): Print length information for arrays that need
586 it.
587 (scm_i_read_array): Parse it.
588
66d33784
MV
589 * deprecated.h, deprecated.c (SCM_CHARS, SCM_UCHARS, SCM_LENGTH,
590 scm_i_object_chars, scm_i_object_length): Brought back from the
591 dead.
592
d7d7d401
MV
5932005-01-10 Marius Vollmer <mvo@zagadka.de>
594
74c58fce
MV
595 * ramap.c: Replaced single-index uses of scm_array_set_x with
596 scm_c_generalized_vector_set_x.
597
d7d7d401
MV
598 * unif.c (scm_array_rank, scm_array_dimensions,
599 scm_shared_array_offset, scm_shared_array_increments,
600 scm_array_ref, scm_array_set_x): Use scm_t_array_handle operations
601 to simplify code and make it more general.
602 (scm_shared_array_root): Work with all kinds of arrays, including
603 naked vectors.
604 (indices_to_pos): New.
74c58fce
MV
605 (scm_make_shared_array): Use it instead of scm_aind; use handle
606 for oldra.
607
4475d3fe
KR
6082005-01-10 Kevin Ryde <user42@zip.com.au>
609
610 * posix.c (scm_mkstemp): Update docstring from manual.
611
d3ddc95e
KR
612 * stime.c (scm_mktime): Missing default errno=EINVAL from prev change.
613
8c8491f5
MV
6142005-01-09 Marius Vollmer <mvo@zagadka.de>
615
b89ecc6f
MV
616 * srfi-4.h, srfi-4.c, srfi-4.i.c (scm_i_uniform_vector_ref_proc,
617 scm_i_uniform_vector_set_proc): New.
618 (u8ref, u8set, s8ref, s8set, etc): New.
619 (uvec_reffers, uvec_setters): New.
620 (uvec_to_list): Use generic scm_array_handle_ref instead of
621 uvec_fast_ref since scm_array_handle_ref should be faster now.
8cb01d9f
MV
622 (coerce_to_uvec, scm_c_uniform_vector_ref,
623 scm_c_uniform_vector_set_x): Likewise.
b89ecc6f
MV
624
625 * unif.h, unif.c, inline.h (scm_i_t_array_ref, scm_i_t_array_set):
626 New.
627 (scm_t_array_handle): Added ref, set, elements and
628 writable_elements for fast inline operation of
629 scm_array_handle_ref and scm_array_handle_set.
630 (scm_array_handle_ref, scm_array_handle_set): Moved to inline.h
631 and replaced with inline code that simply calls the ref/set
632 members of the handle.
633 (enclosed_ref, vector_ref, string_ref, bitvector_ref, memoize_ref,
634 enclosed_set, vector_set, string_set, bitvector_set, memoize_set):
635 New.
636 (scm_array_handle_get): Initialize ref/set fields to memoize_ref
637 and memoize_set.
638 (scm_bitvector_fill_x, scm_bitvector_to_list, scm_bit_count,
639 scm_bit_position, scm_bit_set_star_x, scm_bit_count_star,
640 scm_bit_invert_x): Correctly multiply index with increment in the
641 general case.
642
8c8491f5
MV
643 * unif.c (scm_array_handle_set): Correctly execute only one
644 alternative. D'Oh!
645 (scm_list_to_typed_array, l2ra): Use scm_t_array_handle to fill
646 the array; this covers all cases with much simpler code.
647
648 * srfi-4.c (scm_uniform_element_size): Deprecated implementation
649 as well.
650
cd5d55c7
MV
6512005-01-09 Marius Vollmer <marius.vollmer@uni-dortmund.de>
652
653 * srfi-4.c (uvec_type): New.
654 (uvec_to_list, uvec_ref, uvec_set_x, scm_c_uniform_vector_ref,
655 scm_c_uniform_vector_x): Use it to get concrete type.
656
657 * unif.h (scm_t_array_dim): Changed type of members to ssize_t, to
658 fit the docs.
659
660 * unif.c (ra2l): Handle zero rank arrays.
661 (scm_i_print_array): Print zero rank arrays specially.
662 (tag_to_type): Return #t for an empty tag, not the empty symbol.
663 (scm_i_read_array): Allow zero rank arrays.
664
a4aad74e
MV
6652005-01-07 Marius Vollmer <marius.vollmer@uni-dortmund.de>
666
667 * hashtab.h, hashtab.c (SCM_HASHTAB_BUCKET_LOC): Removed.
668 (scan_weak_hashtables): Rewrote its use with SCM_HASHTAB_BUCKET
669 and SCM_SET_HASHTAB_BUCKET.
670
671 * print.h, print.c (scm_print_state, SCM_PRINT_STATE_LAYOUT):
672 Removed ref_stack field.
673 (PSTATE_STACK_REF, PSTATE_STACK_SET): New, for accessing the stack
674 of a print state. Use them everywhere instead of ref_stack.
675
3a40d5e1
MV
676 * srfi-4.h (scm_uniform_element_size): Deprecated for real.
677
a4aad74e
MV
678 * srfi-4.c: Include deprecation.h.
679
680 * vectors.h, vectors.c, unif.h, unif.c, deprecated.h,
681 deprecated.c, eq.c
682 (SCM_BITVEC_REF, SCM_BITVEC_SET, SCM_BITVEC_CLR): Removed.
683 (scm_vector_elements, scm_vector_writable_elements,
684 scm_generalized_vector_get_handle): Moved to vectors.[hc] from
685 unif.[hc].
686 (SCM_SIMPLE_VECTOR_LOC): Removed.
687 (SCM_VECTOR_MAX_LENGTH, SCM_VECTOR_LENGTH, SCM_VELTS,
688 SCM_WRITABLE_VELTS, SCM_VECTOR_REF, SCM_VECTOR_SET,
689 scm_vector_equal_p): Moved from vectors.[hc] to deprecated.[hc].
690 (scm_vector_equal_p, scm_i_vector_equal_p): Renamed former to
691 latter. Changed use in eq.c.
692
f01fe441
MV
6932005-01-07 Marius Vollmer <mvo@zagadka.de>
694
695 Make the uniform vector routines also deal with one dimensional
696 arrays.
697
698 * srfi-4.c (SCM_IS_UVEC): New, use it instead of
699 SCM_SMOB_PREDICATE in this file.
700 (is_uvec): Also recognize one-dimensional uniform numeric arrays
701 of the right type.
702 (scm_is_uniform_vector): Likewise.
703 (uvec_fast_ref): Made BASE param const.
704 (uvec_writable_elements, uvec_elements): New.
705 (uvec_to_list, uvec_ref, uvec_set_x, uvec_length,
706 scm_c_uniform_vector_length, scm_c_uniform_vector_ref,
707 scm_c_uniform_set_x): Use them to also deal with one-dimensional
708 arrays.
709 (scm_uniform_vector_ref, scm_uniform_vector_set_x): Deprecate old
710 argument convention.
711 (scm_uniform_vector_to_list): Let uvec_to_list do all the
712 checking.
713 (scm_uniform_vector_length): Use uvec_length.
714
2aaf5726
MV
7152005-01-06 Marius Vollmer <marius.vollmer@uni-dortmund.de>
716
717 * srfi-4.h, srfi-4.c (scm_c_uniform_vector_element_size,
718 scm_c_uniform_vector_size): Removed.
719 (scm_array_handle_uniform_element_size): New.
720
721
722 * unif.h (scm_array_handle_ref, scm_array_handle_set): Changed
723 type of POS parameter to be signed, positions can be negative.
724 (scm_array_handle_release): New, changed all uses of
725 scm_t_array_handle to properly call it.
726 (scm_vector_get_handle, scm_generalized_vector_get_handle):
727 Renamed former to latter, changed all uses.
728
34ae52fc
MV
7292005-01-05 Marius Vollmer <mvo@zagadka.de>
730
731 Updated bitvector routines to also use scm_t_array_handles.
732
733 * unif.h (scm_bitvector_elements,
734 scm_bitvector_writable_elements): Use a scm_t_array_handle and
735 deliver offset, length and increment to caller. Changed all uses.
736 (scm_bitvector_release_elements,
737 scm_frame_bitvector_release_elements,
738 scm_bitvector_release_writable_elements,
739 scm_frame_bitvector_release_writable_elements): Removed.
740 (scm_array_handle_bit_elements,
741 scm_array_handle_bit_writable_elements,
742 scm_array_handle_bit_elements_offset): New.
743 (scm_make_typed_array): The special value for non-initialized
744 arrays is now SCM_UNSPECIFIED. The old special value SCM_BOOL_F
745 was a valid value to fill bitvectors with, so it can't really be
746 specialed out.
747
c4cb7628
KR
7482005-01-04 Kevin Ryde <user42@zip.com.au>
749
750 * stime.c (scm_strftime): Free t.tm_zone produced by bdtime2c.
751 Reported by Bill Schottstaedt.
752
0356881d
MV
7532005-01-02 Marius Vollmer <mvo@zagadka.de>
754
755 * sort.c (quicksort): Added INC parameter for non-contigous
756 vectors.
757 (quicksort1): New, for contigous vectors. Both functions are
758 generated from the same code by including "quicksort.i.c".
759 (scm_restricted_vector_sort_x): Call one of quicksort and
760 quicksort1, depending on increment of vector.
761 (scm_sort): Simply call scm_sort_x on a copy of the list or
762 vector.
763 (scm_merge_vector_x, scm_merge_vector_step): Changed indices to
764 size_t, added inc parameter.
765 (scm_stable_sort_x): Allocate temporary storage as Scheme vector
766 so that it doesn't leak.
767 (scm_stable_sort): Simply call scm_stable_sort_x on a copy of the
768 list or vector.
769
770 * ramap.c (scm_array_map_x): Do not try to convert fill value
771 before filling, any necessary conversion is done while storing.
772
773 * gc-card.c (scm_i_sweep_card): Call scm_i_vector_free instead of
774 doing it inline.
775
776 * hashtab.c, hashtab.h (SCM_HASHTABLE_BUCKETS): Removed.
777 (SCM_HASHTABLE_BUCKET, SCM_HASHTABLE_BUCKET_LOC): New. Replaced
778 all uses of SCM_HASHTABLE_BUCKETS with SCM_HASHTABLE_BUCKET.
779
780 * tags.h, weaks.c, vports.c, hashtab.c, convert.c, sort.c,
781 convert.c, convert.h, convert.i.c, deprecated.c, environments.c,
782 eval.c, filesys.c, fluids.c, gc-mark.c, gh.h, gh_data.c, goops.c,
783 hash.c, init.c, libguile_la-arrays.loT, modules.c, net_db.c,
784 objects.c, ports.c, posix.c, print.c, random.c, read.c,
785 regex-posix.c, scmsigs.c, socket.c, stime.c, symbols.c: Use new
786 vector elements API or simple vector API, as appropriate. Removed
787 SCM_HAVE_ARRAYS ifdefery. Replaced all uses of
788 SCM_HASHTABLE_BUCKETS with SCM_HASHTABLE_BUCKET.
789
790 * srfi-4.h, srfi-4.c,
791 srfi-4.i.c (scm_array_handle_uniform_elements,
792 scm_array_handle_uniform_writable_elements,
793 scm_uniform_vector_elements,
794 scm_uniform_vector_writable_elements):
795 (scm_<foo>vector_elements, scm_<foo>vector_writable_elements): Use
796 scm_t_array_handle, deliver length and increment.
797 (scm_array_handle_<foo>_elements,
798 scm_array_handle_<foo>_writable_elements): New.
799
800 * gen-scmconfig.h.in (SCM_I_GSC_HAVE_ARRAYS): Removed.
801 * gen-scmconfig.c: Hard code SCM_HAVE_ARRAYS to "1".
802
803 * unif.h, unif.c (scm_t_array_handle, scm_array_get_handle,
804 scm_array_handle_rank, scm_array_handle_dims, scm_array_handle_ref
805 scm_array_handle_set, scm_array_handle_elements
806 scm_array_handle_writable_elements, scm_vector_get_handle): New.
807 (scm_make_uve, scm_array_prototype, scm_list_to_uniform_array,
808 scm_dimensions_to_uniform_array): Deprecated for real.
809 (scm_array_p, scm_i_array_p): Use latter for SCM_DEFINE since
810 snarfing wont allow a mismatch between C and Scheme arglists.
811 (scm_make_shared_array, scm_enclose_array): Correctly use
812 scm_c_generalized_vector_length instead of
813 scm_uniform_vector_length.
814
815 * validate.h (SCM_VALIDATE_VECTOR,
816 SCM_VALIDATE_VECTOR_OR_DVECTOR): use scm_is_simple_vector instead
817 of SCM_VECTORP.
818
819 * weaks.h, weaks.c: Use new internal weak vector API from
820 vectors.h.
821
822 * Makefile.am (libguile_la_SOURCES, DOT_X_FILES, DOT_DOC_FILES,
823 EXTRA_libguile_la_SOURCES): Changed ramap.c and unif.c from being
824 'extra' to being regular sources.
825 (noinst_HEADERS): Added quicksort.i.c.
826 * quicksort.i.c: New file.
827
828 * vectors.h, vector.c (SCM_VECTORP, SCM_VECTOR_LENGTH, SCM_VELTS,
829 SCM_WRITABLE_VELTS, SCM_VECTOR_REF, SCM_VECTOR_SET): Deprecated
830 and reimplemented. Replaced all uses with scm_vector_elements,
831 scm_vector_writable_elements, or SCM_SIMPLE_VECTOR_*, as
832 appropriate.
833 (scm_is_simple_vector, SCM_SIMPLE_VECTOR_LENGTH,
834 SCM_SIMPLE_VECTOR_REF, SCM_SIMPLE_VECTOR_SET,
835 SCM_SIMPLE_VECTOR_LOC): New.
836 (SCM_VECTOR_BASE, SCM_SET_VECTOR_BASE, SCM_VECTOR_MAX_LENGTH,
837 SCM_MAKE_VECTOR_TAG, SCM_SET_VECTOR_LENGTH,
838 SCM_VELTS_AS_STACKITEMS, SCM_SETVELTS, SCM_GC_WRITABLE_VELTS):
839 Removed.
840 (scm_vector_copy): New.
841 (scm_vector_elements, scm_vector_writable_elements): Use
842 scm_t_array_handle, deliver length and increment. Moved to
843 unif.h. Changed all uses.
844 (scm_vector_release_elements,
845 scm_vector_release_writable_elements,
846 (scm_frame_vector_release_elements,
847 scm_frame_vector_release_writable_elements): Removed.
848 (SCM_I_IS_VECTOR, SCM_I_VECTOR_ELTS, SCM_I_VECTOR_WELTS,
849 SCM_I_VECTOR_LENGTH, scm_i_vector_free): New internal API.
850 (SCM_I_WVECTP SCM_I_WVECT_LENGTH SCM_I_WVECT_VELTS
851 SCM_I_WVECT_GC_WVELTS SCM_I_WVECT_TYPE SCM_I_WVECT_GC_CHAIN
852 SCM_I_SET_WVECT_GC_CHAIN, scm_i_allocate_weak_vector): New, for
853 weak vectors.
854
0336d18b
MV
8552004-12-29 Marius Vollmer <mvo@zagadka.de>
856
857 No longer use creators to specify the type of an array. Creators
858 expose the fact that arrays are wrapped around vectors, but that
859 might change.
860
861 * srfi-4.h (scm_i_proc_make_u8vector, scm_i_proc_make_s8vector,
862 scm_i_proc_make_u16vector, scm_i_proc_make_s16vector,
863 scm_i_proc_make_u32vector, scm_i_proc_make_s32vector,
864 scm_i_proc_make_u64vector, scm_i_proc_make_s64vector,
865 scm_i_proc_make_f32vector, scm_i_proc_make_f64vector,
866 scm_i_proc_make_c32vector, scm_i_proc_make_c64vector,
867 uvec_proc_vars): Removed.
868 (scm_i_generalized_vector_creator): Removed.
869 (scm_i_generalized_vector_type): New.
870
871 * unif.h, unif.c (scm_typed_array_p, scm_make_array,
872 scm_make_typed_array, scm_array_type, scm_list_to_array,
873 scm_list_to_typed_array, scm_is_array, scm_is_typed_array): New.
874 (scm_array_creator): Removed.
875 (scm_array_p): Deprecated second PROT argument.
876 (scm_dimensions_to_uniform_array, scm_list_to_uniform_array):
877 Deprecated, reimplemented in terms of scm_make_typed_array and
878 scm_list_to_typed_array.
879 (scm_i_proc_make_vector, scm_i_proc_make_string,
880 scm_i_proc_make_bitvector): Removed.
881 (type_creator_table, init_type_creator_table, type_to_creator,
882 make_typed_vector): New.
883 (scm_i_convert_old_prototype): Removed.
884 (prototype_to_type): New.
885 (scm_make_uve): Deprecated, reimplemented using make_typed_vector.
886 (scm_array_dimensions): Use scm_list_1 instead of scm_cons for
887 minor added clarity.
888 (scm_make_shared_array, scm_ra2contig): Use make_typed_vector
889 instead of scm_make_uve.
890 (tag_creator_table, scm_i_tag_to_creator): Removed.
891 (tag_to_type): New.
892 (scm_i_read_array): Use scm_list_to_typed_array instead of
893 scm_list_to_uniform_array.
894
277e8472
MV
8952004-12-27 Marius Vollmer <mvo@zagadka.de>
896
32b26202
MV
897 * unif.h, unif.c (scm_bitvector_elements): Made return value "const".
898 (scm_bitvector_writable_elements): New.
899 (scm_bitvector_release, scm_bitvector_release_elements):
900 Renamed former to latter. Added explicit call to
901 scm_remember_upto_here_1.
902 (scm_frame_bitvector_release,
903 scm_frame_bitvector_release_elements): Renamed former to latter.
904 (scm_bitvector_release_writable_elements,
905 scm_bitvector_release_writable_elements): New.
906 Changed all uses as required by the changes above.
907
908 * srfi-4.h, srfi-4.c, srfi-4.i.c (scm_uniform_vector_elements,
909 scm_u8vector_elements, etc): Made return value "const".
910 (scm_uniform_vector_writable_elements,
911 scm_u8vector_writable_elements, etc): New.
912 (scm_uniform_vector_release, scm_uniform_vector_release_elements):
913 Renamed former to latter. Added explicit call to
914 scm_remember_upto_here_1.
915 (scm_frame_uniform_vector_release,
916 scm_frame_uniform_vector_release_elements): Renamed former to latter.
917 (scm_uniform_vector_release_writable_elements,
918 scm_frame_uniform_vector_release_writable_elements): New. Takes
919 crown of longest identifier yet.
920 Changed all uses as required by the changes above.
921
277e8472
MV
922 * vectors.h, vectors.c (scm_c_vector_set_x): Make return type
923 void.
924 (scm_is_vector, scm_vector_p, scm_vector_length,
925 scm_c_vector_length, scm_vector_ref, scm_c_vector_ref,
926 scm_vector_set_x, scm_c_vector_set_x, scm_vector_to_list,
927 scm_vector_move_left_x, scm_vector_move_right_x,
928 scm_vector_fill_x): handle one-dimensional arrays.
32b26202
MV
929 (scm_vector_elements, scm_vector_release_elements,
930 scm_vector_frame_release_elements, scm_vector_writable_elements,
931 scm_vector_release_writable_elements,
932 scm_vector_frame_release_writable_elements): New.
933 (scm_list_to_vector, scm_vector_to_list, scm_vector_fill,
934 scm_vector_move_left_x, scm_vector_move_right_x): Use them.
277e8472
MV
935
936 * ramap.c (scm_ramapc, scm_raeql): Use
937 scm_c_generalized_vector_length instead of
938 scm_uniform_vector_length.
939 (scm_ramap, rafe): Use scm_c_vector_ref instead of SCM_VELTS. use
940 scm_c_generalized_vector_ref instead of scm_uniform_vector_ref.
941
49c51610
MV
9422004-12-23 Marius Vollmer <marius.vollmer@uni-dortmund.de>
943
944 * continuations.h, continuations.c (scm_t_contregs): New 'offset'
945 member for relocating debug frames.
946 (scm_make_continuation): Set it.
947
948 * stacks.c (read_frame, read_frames, scm_make_stack,
949 scm_last_stack_frame, scm_stack_id): Use the new 'offset' member
950 of continuations instead of calculating the offset ourselves.
951 Relocate 'vect' member of scm_t_debug_frame.
952
3b2ee265
KR
9532004-12-16 Kevin Ryde <user42@zip.com.au>
954
955 * ramap.c (scm_array_map_x): Check for at least one source argument.
956
e120686a
KR
9572004-12-14 Kevin Ryde <user42@zip.com.au>
958
959 * srfi-13.c (string-any, string-every): Use a scheme wrapper around
960 the C code so for the final call to the predicate procedure is a tail
961 call, per SRFI-13 spec.
962
680b5237
KR
9632004-12-10 Kevin Ryde <user42@zip.com.au>
964
965 * eq.c (scm_eq_p, scm_eqv_p, scm_equal_p): Update docstrings from
966 recent revision to the reference manual.
967
968 * numbers.c (scm_modulo): Amend fixme comment about negative divisor
969 with "%", C99 says it's well-defined.
970
971 * socket.c (scm_from_ipv6): Just use mpz_import. Don't bother trying
972 to fit scm_from_ulong_long, since that uses mpz_import anyway. Don't
973 bother trying to fit scm_from_ulong, not really worth the trouble if
974 addresses are more than 4 bytes usually.
975
446d320c
KR
9762004-11-30 Kevin Ryde <user42@zip.com.au>
977
978 * gc_os_dep.c (NetBSD): Test __m68k__ and __arm__ as well as m68k and
979 arm32. Reported by Greg Troxel.
980
f2654760
MV
9812004-11-14 mvo <mvo@zagadka.de>
982
983 * unif.c, unif.h (scm_i_cvref): Made non-static for ramap.c.
984
985 * Makefile.am (INCLUDES): It is "@LTDLINCL@", not "@LTDLINC@".
986
d550e35f
MV
9872004-11-12 Marius Vollmer <marius.vollmer@uni-dortmund.de>
988
989 Enclosed arrays are now their own smob. This has been done to
990 make the code more explicit about them and to prepare for the time
f2654760
MV
991 when generalized vectors include arbitrary one-dimensional
992 arrays. (Uptonow, enclosed arrays have been recognized by their
993 use of an array as their storage 'vector'. When all generalized
994 vectors are allowed as storage, including one-dimensional arrays,
995 this will no longer work.)
d550e35f
MV
996
997 * unif.h, unif.c: (scm_tc16_enclosed_array, SCM_ENCLOSED_ARRAYP):
998 New.
999 (exactly_one_third, singp): Removed.
1000 (scm_array_p, scm_array_dimensions, scm_shared_array_root,
1001 scm_shared_array_offset, scm_shared_array_increments): Handle
1002 enclosed arrays explicitely.
1003 (scm_array_rank): Likewise. Also, do not return zero for
1004 non-arrays, signal an error instead since arrays with rank zero do
1005 exist.
1006 (scm_i_make_ra): New, for specifying the tag of the new array.
1007 (scm_make_enclosed_array): Use it.
1008 (scm_make_ra): Reimplemented in terms of scm_i_make_ra.
1009 (scm_make_shared_array): Use scm_c_generalized_vector_length
1010 instead of scm_uniform_vector_length.
1011 (scm_array_in_bounds_p): Rewritten to be much cleaner.
1012 (scm_i_cvref): New, doing the job of scm_cvref.
1013 (scm_cvref): Use scm_i_cvref.
1014 (scm_array_ref): Do not accept non-arrays when no indices are
1015 given. Use scm_i_cvref to do the actual access.
1016 ("uniform-array-set1"): Do not register.
1017 (scm_array_set_x, scm_uniform_array_read_x,
1018 scm_uniform_array_write): Handle enclosed arrays explicitly.
1019 (ra2l): Use scm_i_cvref instead of scm_uniform_vector_ref to also
1020 handle enclosed arrays.
1021 (scm_array_to_list): Handle enclosed arrays explicitly.
1022 (rapr1): Removed.
1023 (scm_i_print_array_dimension): Use scm_i_cvref to also handle
1024 enclosed arrays.
1025 (scm_i_print_enclosed_array): New.
1026 (tag_proto_table, tag_creator_table): Renamed former to latter.
1027 Added "a" and "b" for strings and bitvectors, resp.
1028 (scm_i_tag_to_prototype, scm_i_tag_to_creator): Renamed former to
1029 latter. Tag "a" is in the table now, no need to handle it as a
1030 legacy tag.
1031 (scm_raprin1): Just call scm_iprin1.
1032 (scm_array_creator, scm_array_prototype): Handle enclosed arrays
1033 explicitly.
1034 (scm_init_unif): Initialize scm_tc16_enclosed_array smob.
1035 Use scm_i_print_array as printer for scm_tc16_array.
1036
2ed34885
MV
10372004-11-10 Marius Vollmer <mvo@zagadka.de>
1038
823086c1
MV
1039 * ramap.c (cind): Changed second arg to be pointer to long instead
1040 of uniform vector.
1041 (scm_ramapc): Allocate index vector with scm_malloc and not as
d550e35f 1042 uniform vector. Wrap it in a frame so that it gets properly freed.
823086c1
MV
1043 (scm_array_index_map_x): Likewise.
1044
1045 * unif.c: Changed all uses of scm_array_prototype to
1046 scm_array_creator. (scm_i_get_old_prototype): Signal error when no
1047 prototype is known.
1048 (scm_uniform_array_read_x, scm_uniform_array_write): Reimplemented
1049 in terms of scm_uniform_vector_read_x and
1050 scm_uniform_vector_write, respectively. Strings and
1051 bitvector support has been dropped.
1052
2ed34885
MV
1053 * srfi-4.h, srfi-4.c: Do not include <libguile.h>, include the
1054 needed files directly. Include config.h, <unistd.h> and <io.h>
1055 when available.
1056 (scm_uniform_vector_read_x, scm_uniform_vector_write): New.
1057
2c72f253
MV
10582004-11-09 Marius Vollmer <mvo@zagadka.de>
1059
1060 * gh_data.c (gh_uniform_vector_length): Properly use
1061 scm_c_uniform_vector_length instead of scm_uniform_vector_length.
1062
3cc0a296
MV
10632004-11-09 Marius Vollmer <marius.vollmer@uni-dortmund.de>
1064
1065 * srfi-4.h (scm_c_uniform_vector_ref, scm_c_uniform_vector_set_x):
1066 New.
1067 (scm_i_uniform_vector_creator): Removed.
1068 (scm_i_generalized_vector_creator): New.
1069 (scm_uniform_vector_length, scm_uniform_element_size): Do not
1070 handle generalized vectors, only uniform numeric vectors.
1071 (alloc_uvec): Do length check here...
1072 (make_uvec): ...but not here.
1073 (coerce_to_uvec): Use new generalized vector functions to handle
1074 all kinds of vectors in one go.
1075
1076 * tags.h (scm_tc7_bvect): Renamed to scm_tc7_unused7, renaming the
1077 remaining scm_tc7_unused tags to get a neatly ordered list.
1078
1079 * eq.c, evalext.c, gc-card.c, gc-mark.c, objects.c, print.c: Do no
1080 longer handle scm_tc7_bvect bitvectors.
1081
1082 * ramap.c: Use the new generalized vector functions to handle all
1083 vector like things.
1084
1085 * vectors.h, vectors.c (scm_is_vector, scm_c_vector_length,
1086 scm_c_vector_ref, scm_c_vector_set_x, scm_generalized_vector_p,
1087 scm_generalized_vector_length, scm_generalized_vector_ref,
1088 scm_generalized_vector_set_x, scm_generalized_vector_to_list,
1089 scm_is_generalized_vector, scm_c_generalized_vector_length,
1090 scm_c_generalized_vector_ref, scm_c_generalized_vector_set_x):
1091 New.
1092
1093 * unif.h, unif.c (scm_bitvector_p, scm_bitvector,
1094 scm_make_bitvector, scm_bitvector_length, scm_bitvector_ref,
1095 scm_bitvector_set_x, scm_list_to_bitvector, scm_bitvector_to_list,
1096 scm_bitvector_fill_x, scm_is_bitvector, scm_c_make_bitvector,
1097 scm_c_bitvector_length, scm_c_bitvector_ref,
1098 scm_c_bitvector_set_x, scm_bitvector_elements,
1099 scm_bitvector_release, scm_frame_bitvector_release,
1100 scm_tc16_bitvector, bitvector_free, bitvector_print,
1101 bitvector_equalp, count_ones, find_first_one): New.
1102 (scm_bit_count, scm_bit_position, scm_bit_set_star_x,
1103 scm_bit_count_star, scm_bit_invert_x, scm_istr2bve): Rewritten
1104 using the new C API for bitvectors and maybe count_ones or
1105 find_first_one, as appropriate.
1106 (SCM_I_MAX_LENGTH, SCM_BITVECTOR_P, SCM_BITVECTOR_BASE,
1107 SCM_SET_BITVECTOR_BASE, SCM_BITVECTOR_MAX_LENGTH,
1108 SCM_BITVECTOR_LENGTH, SCM_MAKE_BITVECTOR_TAG,
1109 SCM_SET_BITVECTOR_LENGTH): Removed. Replaced all uses with the
1110 new functions from above.
1111 (scm_i_proc_make_vector, scm_i_proc_make_string,
1112 scm_i_proc_make_bitvector): Made non-static for use in
1113 scm_i_generalized_vector_creator.
1114 (scm_make_u1vector): Removed, replaced by scm_make_bitvector.
1115 (scm_make_uve): Validate that the created object is a generalized
1116 vector.
1117 (scm_i_legacy_tag): Removed.
1118 (scm_i_print_array): Do it here.
1119 (scm_raprin1): Only print enclosed arrays.
1120
1121 * Makefile.am (DOT_DOC_FILES): Added srfi-4.doc.
1122
c24d026b
MV
11232004-11-04 Marius Vollmer <marius.vollmer@uni-dortmund.de>
1124
1f2328fe
MV
1125 * srfi-4.c (make_uvec): Use SCM_I_SIZE_MAX instead of SIZE_MAX for
1126 added portability.
1127
1128 * chars.c (scm_charnames, scm_charnums): Added "sp" as an alias
1129 for "space". Thanks to Bruce Korb!
1130
c24d026b
MV
1131 * rw.c (scm_read_string_x_partial): Bugfix, apply offset to dest
1132 only after dest has been set. Thanks to Hyper Division!
1133
1134 * gh_data.c (gh_uniform_vector_length): Use
1135 scm_uniform_vector_length instead of SCM_UVECTOR_LENGTH.
1136
d4ea47c8
MV
11372004-11-03 Marius Vollmer <mvo@zagadka.de>
1138
1139 * unif.h (SCM_UVECTOR_BASE, SCM_SET_UVECTOR_BASE,
1140 SCM_UVECTOR_MAXLENGTH, SCM_UVECTOR_LENGTH, SCM_MAKE_UVECTOR_TAG,
1141 SCM_SET_UVECTOR_LENGTH): Removed.
1142
236288e2
MV
11432004-11-02 Marius Vollmer <mvo@zagadka.de>
1144
1145