* hashtab.c (scm_i_rehash): Cope with the case that a GC modifies
[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 2137.
CommitLineData
29fed193
MD
12005-02-10 Mikael Djurfeldt <djurfeldt@nada.kth.se>
2
3 * unif.c (prototype_to_type): Bugfix: Don't compare prototype to
4 the prototypical examples mentioned in the old reference manual.
5 Instead keep the old semantics of dispatching on type. (Yes, this
6 is extremely ugly, but the whole point of keeping the deprecated
7 interface is not to break old code.)
8
9cc49060
MD
92005-02-08 Mikael Djurfeldt <djurfeldt@nada.kth.se>
10
11 * deprecated.h (SCM_ARRAY_DIMS): Rename scm_i_attay_dims -->
12 scm_i_array_dims.
13
8447f463
KR
142005-01-28 Kevin Ryde <user42@zip.com.au>
15
16 * numbers.c (scm_ash): Rewrite using shifts, much faster than
17 integer-expt and multiply/divide. Inexacts and fractions no longer
18 supported (they happened to work before for left shifts, but not
19 right). Don't really need inexacts and fractions, since ash is
20 documented as a "bitwise operation", and all the rest of those only
21 take exact integers.
22
1367aa5e
HWN
232005-01-27 Han-Wen Nienhuys <hanwen@xs4all.nl>
24
856fca7e
HWN
25 * gc-card.c (scm_i_card_statistics): map structs, closures and
26 subrs to one tag.
27
1367aa5e 28 * gc.c (s_scm_gc_live_object_stats): return alist, not hashtable.
856fca7e 29 (tag_table_to_type_alist): ignore unknown types.
1367aa5e
HWN
30
31 * gc-segment.c (scm_i_all_segments_statistics): new function.
32 (scm_i_heap_segment_statistics): new function
33
34 * gc.c (s_scm_gc_live_object_stats): new GUILE callable: return
35 statistics on the number of live objects of each type.
36
37 * gc-card.c (scm_i_tag_name): new function.
38 (scm_i_card_statistics): new function.
39
333db3b8
KR
402005-01-24 Kevin Ryde <user42@zip.com.au>
41
42 * posix.c (scm_setlocale): Force errno=EINVAL for an error, since
43 POSIX and C99 don't document errno being set. Reported by Bruno
44 Haible.
45 (scm_flock): Update docstring from manual.
46
8447f463
KR
47 * random.c (scm_i_init_rstate): Compare w to -1 not 0xffffffffUL, now
48 that it's an scm_t_int32. Otherwise gcc 3.4 says it's always false on
49 a 64-bit system.
50
51 * scmsigs.c (scm_sigaction_for_thread): Use scm_to_long for
52 sa_handler, needs to be a long on 64-bit systems where int is only 32
53 bits.
54
88f59e53
MV
552005-01-20 Marius Vollmer <marius.vollmer@uni-dortmund.de>
56
0eeb2611
MV
57 * environments.c (obarray_enter, obarray_replace): Call
58 SCM_HASHTABLE_INCREMENT when adding a new entry.
59
88f59e53
MV
60 * objects.c: Include goops.h for the scm_class_of prototype.
61
62 * hashtab.c (hashtable_size, HASHTABLE_SIZE_N): Restrict hashtable
63 sizes to be smaller than the maximum lengths of vectors.
64
219b2868
MV
652005-01-18 Marius Vollmer <marius.vollmer@uni-dortmund.de>
66
67 * ports.c, smob.c: Include "libguile/goops.h".
68
69 * objects.h, objects.c, goops.c, goops.h (scm_class_boolean,
70 scm_class_char, scm_class_pair, scm_class_procedure,
71 scm_class_string, scm_class_symbol,
72 scm_class_procedure_with_setter, scm_class_primitive_generic,
73 scm_class_vector, scm_class_null, scm_class_real,
74 scm_class_complex, scm_class_integer, scm_class_fraction,
75 scm_class_unknown, scm_port_class, scm_smob_class,
76 scm_no_applicable_method, scm_class_of): Moved from objects to
77 goops since they are only useable once goops has been loaded.
78 (scm_classes_initialized): Removed.
79 (scm_class_of): Do not check it.
80 (create_standard_classes): Do not set it.
81
009c6b9c
MV
822005-01-17 Marius Vollmer <marius.vollmer@uni-dortmund.de>
83
50472546
MV
84 * objects.h, objects.c (scm_classes_initialized): New.
85 (scm_class_of): Signal error when scm_classes_initialized is zero.
86 * goops.c (create_standard_classes): Set scm_classes_initialized
87 to one.
88
009c6b9c
MV
89 * random.c (scm_random_solid_sphere_x): Use
90 scm_c_generalized_vector_length instead of
91 scm_uniform_vector_length.
92
7719cbe9
MV
932005-01-16 Marius Vollmer <mvo@zagadka.de>
94
95 * script.c (scm_compile_shell_switches): Removed debugging output.
96
1ec44fed
KR
972005-01-15 Kevin Ryde <user42@zip.com.au>
98
99 * numbers.c (scm_logtest, scm_logbit_p, scm_integer_expt): Update
100 docstrings from manual.
101 * random.c (scm_random_solid_sphere_x): Update docstring from manual.
102
6e4cd850
MV
1032005-01-14 Marius Vollmer <marius.vollmer@uni-dortmund.de>
104
0b5a0521
MV
105 * random.c: Don't check for definedness of SCM_HAVE_T_INT64, check
106 its value.
107
108 Implement u64 and s64 uniform numeric vectors with bignums when
109 scm_t_uint64 and scm_t_int64 are not available.
110
111 * srfi-4.h, srfi-4.c, srfi-4.i.c (scm_take_u64vector,
112 scm_array_handle_u64_elements,
113 scm_array_handle_u64_writable_elements, scm_u64vector_elements,
114 scm_u64vector_writable_elements): Do not define when scm_t_uint64
115 is not available.
116 (scm_take_s64vector, scm_array_handle_s64_elements,
117 scm_array_handle_s64_writable_elements, scm_s64vector_elements,
118 scm_s64vector_writable_elements): Likewise for scm_t_int64.
119 (uvec_sizes, uvec_print, uvec_equalp): Use SCM bignums when
120 scm_t_int64/scm_t_uint64 are not available.
121 (uvec_mark): New, to mark the bignums.
122 (alloc_uvec): Initialize bignums.
123 (uvec_fast_ref): Return bignums directly.
124 (scm_uint64_min, scm_uint64_max, scm_int64_min, scm_int64_max,
125 assert_exact_integer): New.
126 (uvec_fast_set): Use them to validate the bignums.
127 (scm_init_srfi_4): Set mark function of smob when needed.
128 Initialize scm_uint64_min, scm_uint64_max, scm_int64_min,
129 scm_int64_max.
130
6e4cd850
MV
131 Recognize 1.4 -e syntax.
132
133 * script.c (sym_at, sym_atat, sym_main, all_symbols): New.
134 (scm_compile_shell_switches): Use them to recognize and convert
135 1.4 "-e" syntax.
136
3b698afe
MV
1372005-01-12 Marius Vollmer <marius.vollmer@uni-dortmund.de>
138
139 * deprecated.h, deprecated.c, strings.h, strings.c: Turn all
140 deprecated features that once were macros but are now functions
141 back into macros.
142
d6dc83a9
MV
1432005-01-11 Marius Vollmer <marius.vollmer@uni-dortmund.de>
144
49086691
MV
145 * eval.c, debug.h (SCM_WARN_DEPRECATED): New debug option.
146 * deprecation.c (scm_issue_deprecation_warning,
147 scm_c_issue_deprecation_warning_fmt): Use it.
148 (mode): Removed.
149 (print_summary): New.
150 (scm_init_deprecation): Initialize SCM_WARN_DEPRECATED instead of
151 mode.
152
d6dc83a9
MV
153 Deprecated SCM_ARRAY* macros.
154
155 * unif.h, unif.c, ramap.c, vectors.c, srfi-4.c, srfi-4.i.c
156 (SCM_ARRAYP, SCM_I_ARRAYP): Renamed former to latter internal
157 version. Changed all uses.
158 (scm_tc16_array, scm_i_tc16_array,
159 scm_tc16_enclosed_array, scm_i_tc16_enclosed_array,
160 SCM_ARRAY_FLAG_CONTIGUOUS, SCM_I_ARRAY_FLAG_CONTIGUOUS,
161 SCM_ENCLOSE_ARRAYP, SCM_I_ENCLOSE_ARRAYP,
162 SCM_ARRAY_NDIM, SCM_I_ARRAY_NDIM,
163 SCM_ARRAY_CONTP, SCM_I_ARRAY_CONTP,
164 SCM_ARRAY_MEM, SCM_I_ARRAY_MEM,
165 SCM_ARRAY_V, SCM_I_ARRAY_V,
166 SCM_ARRAY_BASE, SCM_I_ARRAY_BASE,
167 SCM_ARRAY_DIMS, SCM_I_ARRAY_DIMS,
168 scm_t_array, scm_i_t_array): Likewise.
169 (SCM_SET_ARRAY_CONTIGUOUS_FLAG, SCM_CLR_ARRAY_CONTIGUOUS_FLAG):
170 Moved from unif.h to unif.c.
171 (scm_c_array_rank): New.
172 (scm_array_rank): Reimplement using it.
173
174 * deprecated.h, deprecated.c (SCM_ARRAYP, SCM_ARRAY_NDIM,
175 SCM_ARRAY_CONTP, SCM_ARRAY_MEM, SCM_ARRAY_V, SCM_ARRAY_BASE,
176 SCM_ARRAY_DIMS, scm_t_array): New deprecated versions.
177
dc91d8de
MV
1782005-01-11 Marius Vollmer <mvo@zagadka.de>
179
180 * ramap.c: Replace uses of scm_make_ra with scm_i_make_ra.
181 (GVREF, GVSET): New abbreviations. Use them everywhere instead of
182 scm_c_generalized_vector_ref and scm_cvref, and
183 scm_c_generalized_vector_set_x, respectively.
184 (RVREF, IVDEP, BINARY_ELTS_CODE, BINARY_PAIR_ELTS_CODE,
185 UNARY_ELTS_CODE, UNARY_PAIR_ELTS_CODE): Removed since unused.
186
187 * unif.h, unif.c (indices_to_pos, scm_array_handle_pos): Renamed
188 former to latter and made public. Changed all uses.
189 (scm_i_make_ra): Made public, changed tag param to enclosed flag.
190 (scm_make_ra): Deprecated, changed all uses to scm_i_make_ra.
191 (scm_i_shap2ra): New internal version of scm_shap2ra.
192 (scm_shap2ra): Deprecated, changed all uses to scm_i_shap2ra.
193 (scm_i_ra_set_contp): New internal version of scm_ra_set_contp.
194 (scm_ra_set_contp): Deprecated, changed all uses to
195 scm_i_ra_set_contp.
196 (scm_cvref, scm_aind, scm_raprin1): Deprecated.
197
66d33784
MV
1982005-01-10 Marius Vollmer <marius.vollmer@uni-dortmund.de>
199
b06f099d
MV
200 * eval.c (scm_eval): Added example to docstring. Thanks to Issac
201 Trotts!
202
5d35ad81
MV
203 * unif.c (scm_list_to_typed_array): Allow the specification of the
204 upper bound as well. This is needed for empty arrays.
205 (l2ra): Give needed number of elements in error message.
206 (scm_i_print_array): Print length information for arrays that need
207 it.
208 (scm_i_read_array): Parse it.
209
66d33784
MV
210 * deprecated.h, deprecated.c (SCM_CHARS, SCM_UCHARS, SCM_LENGTH,
211 scm_i_object_chars, scm_i_object_length): Brought back from the
212 dead.
213
d7d7d401
MV
2142005-01-10 Marius Vollmer <mvo@zagadka.de>
215
74c58fce
MV
216 * ramap.c: Replaced single-index uses of scm_array_set_x with
217 scm_c_generalized_vector_set_x.
218
d7d7d401
MV
219 * unif.c (scm_array_rank, scm_array_dimensions,
220 scm_shared_array_offset, scm_shared_array_increments,
221 scm_array_ref, scm_array_set_x): Use scm_t_array_handle operations
222 to simplify code and make it more general.
223 (scm_shared_array_root): Work with all kinds of arrays, including
224 naked vectors.
225 (indices_to_pos): New.
74c58fce
MV
226 (scm_make_shared_array): Use it instead of scm_aind; use handle
227 for oldra.
228
4475d3fe
KR
2292005-01-10 Kevin Ryde <user42@zip.com.au>
230
231 * posix.c (scm_mkstemp): Update docstring from manual.
232
d3ddc95e
KR
233 * stime.c (scm_mktime): Missing default errno=EINVAL from prev change.
234
8c8491f5
MV
2352005-01-09 Marius Vollmer <mvo@zagadka.de>
236
b89ecc6f
MV
237 * srfi-4.h, srfi-4.c, srfi-4.i.c (scm_i_uniform_vector_ref_proc,
238 scm_i_uniform_vector_set_proc): New.
239 (u8ref, u8set, s8ref, s8set, etc): New.
240 (uvec_reffers, uvec_setters): New.
241 (uvec_to_list): Use generic scm_array_handle_ref instead of
242 uvec_fast_ref since scm_array_handle_ref should be faster now.
8cb01d9f
MV
243 (coerce_to_uvec, scm_c_uniform_vector_ref,
244 scm_c_uniform_vector_set_x): Likewise.
b89ecc6f
MV
245
246 * unif.h, unif.c, inline.h (scm_i_t_array_ref, scm_i_t_array_set):
247 New.
248 (scm_t_array_handle): Added ref, set, elements and
249 writable_elements for fast inline operation of
250 scm_array_handle_ref and scm_array_handle_set.
251 (scm_array_handle_ref, scm_array_handle_set): Moved to inline.h
252 and replaced with inline code that simply calls the ref/set
253 members of the handle.
254 (enclosed_ref, vector_ref, string_ref, bitvector_ref, memoize_ref,
255 enclosed_set, vector_set, string_set, bitvector_set, memoize_set):
256 New.
257 (scm_array_handle_get): Initialize ref/set fields to memoize_ref
258 and memoize_set.
259 (scm_bitvector_fill_x, scm_bitvector_to_list, scm_bit_count,
260 scm_bit_position, scm_bit_set_star_x, scm_bit_count_star,
261 scm_bit_invert_x): Correctly multiply index with increment in the
262 general case.
263
8c8491f5
MV
264 * unif.c (scm_array_handle_set): Correctly execute only one
265 alternative. D'Oh!
266 (scm_list_to_typed_array, l2ra): Use scm_t_array_handle to fill
267 the array; this covers all cases with much simpler code.
268
269 * srfi-4.c (scm_uniform_element_size): Deprecated implementation
270 as well.
271
cd5d55c7
MV
2722005-01-09 Marius Vollmer <marius.vollmer@uni-dortmund.de>
273
274 * srfi-4.c (uvec_type): New.
275 (uvec_to_list, uvec_ref, uvec_set_x, scm_c_uniform_vector_ref,
276 scm_c_uniform_vector_x): Use it to get concrete type.
277
278 * unif.h (scm_t_array_dim): Changed type of members to ssize_t, to
279 fit the docs.
280
281 * unif.c (ra2l): Handle zero rank arrays.
282 (scm_i_print_array): Print zero rank arrays specially.
283 (tag_to_type): Return #t for an empty tag, not the empty symbol.
284 (scm_i_read_array): Allow zero rank arrays.
285
a4aad74e
MV
2862005-01-07 Marius Vollmer <marius.vollmer@uni-dortmund.de>
287
288 * hashtab.h, hashtab.c (SCM_HASHTAB_BUCKET_LOC): Removed.
289 (scan_weak_hashtables): Rewrote its use with SCM_HASHTAB_BUCKET
290 and SCM_SET_HASHTAB_BUCKET.
291
292 * print.h, print.c (scm_print_state, SCM_PRINT_STATE_LAYOUT):
293 Removed ref_stack field.
294 (PSTATE_STACK_REF, PSTATE_STACK_SET): New, for accessing the stack
295 of a print state. Use them everywhere instead of ref_stack.
296
3a40d5e1
MV
297 * srfi-4.h (scm_uniform_element_size): Deprecated for real.
298
a4aad74e
MV
299 * srfi-4.c: Include deprecation.h.
300
301 * vectors.h, vectors.c, unif.h, unif.c, deprecated.h,
302 deprecated.c, eq.c
303 (SCM_BITVEC_REF, SCM_BITVEC_SET, SCM_BITVEC_CLR): Removed.
304 (scm_vector_elements, scm_vector_writable_elements,
305 scm_generalized_vector_get_handle): Moved to vectors.[hc] from
306 unif.[hc].
307 (SCM_SIMPLE_VECTOR_LOC): Removed.
308 (SCM_VECTOR_MAX_LENGTH, SCM_VECTOR_LENGTH, SCM_VELTS,
309 SCM_WRITABLE_VELTS, SCM_VECTOR_REF, SCM_VECTOR_SET,
310 scm_vector_equal_p): Moved from vectors.[hc] to deprecated.[hc].
311 (scm_vector_equal_p, scm_i_vector_equal_p): Renamed former to
312 latter. Changed use in eq.c.
313
f01fe441
MV
3142005-01-07 Marius Vollmer <mvo@zagadka.de>
315
316 Make the uniform vector routines also deal with one dimensional
317 arrays.
318
319 * srfi-4.c (SCM_IS_UVEC): New, use it instead of
320 SCM_SMOB_PREDICATE in this file.
321 (is_uvec): Also recognize one-dimensional uniform numeric arrays
322 of the right type.
323 (scm_is_uniform_vector): Likewise.
324 (uvec_fast_ref): Made BASE param const.
325 (uvec_writable_elements, uvec_elements): New.
326 (uvec_to_list, uvec_ref, uvec_set_x, uvec_length,
327 scm_c_uniform_vector_length, scm_c_uniform_vector_ref,
328 scm_c_uniform_set_x): Use them to also deal with one-dimensional
329 arrays.
330 (scm_uniform_vector_ref, scm_uniform_vector_set_x): Deprecate old
331 argument convention.
332 (scm_uniform_vector_to_list): Let uvec_to_list do all the
333 checking.
334 (scm_uniform_vector_length): Use uvec_length.
335
2aaf5726
MV
3362005-01-06 Marius Vollmer <marius.vollmer@uni-dortmund.de>
337
338 * srfi-4.h, srfi-4.c (scm_c_uniform_vector_element_size,
339 scm_c_uniform_vector_size): Removed.
340 (scm_array_handle_uniform_element_size): New.
341
342
343 * unif.h (scm_array_handle_ref, scm_array_handle_set): Changed
344 type of POS parameter to be signed, positions can be negative.
345 (scm_array_handle_release): New, changed all uses of
346 scm_t_array_handle to properly call it.
347 (scm_vector_get_handle, scm_generalized_vector_get_handle):
348 Renamed former to latter, changed all uses.
349
34ae52fc
MV
3502005-01-05 Marius Vollmer <mvo@zagadka.de>
351
352 Updated bitvector routines to also use scm_t_array_handles.
353
354 * unif.h (scm_bitvector_elements,
355 scm_bitvector_writable_elements): Use a scm_t_array_handle and
356 deliver offset, length and increment to caller. Changed all uses.
357 (scm_bitvector_release_elements,
358 scm_frame_bitvector_release_elements,
359 scm_bitvector_release_writable_elements,
360 scm_frame_bitvector_release_writable_elements): Removed.
361 (scm_array_handle_bit_elements,
362 scm_array_handle_bit_writable_elements,
363 scm_array_handle_bit_elements_offset): New.
364 (scm_make_typed_array): The special value for non-initialized
365 arrays is now SCM_UNSPECIFIED. The old special value SCM_BOOL_F
366 was a valid value to fill bitvectors with, so it can't really be
367 specialed out.
368
c4cb7628
KR
3692005-01-04 Kevin Ryde <user42@zip.com.au>
370
371 * stime.c (scm_strftime): Free t.tm_zone produced by bdtime2c.
372 Reported by Bill Schottstaedt.
373
0356881d
MV
3742005-01-02 Marius Vollmer <mvo@zagadka.de>
375
376 * sort.c (quicksort): Added INC parameter for non-contigous
377 vectors.
378 (quicksort1): New, for contigous vectors. Both functions are
379 generated from the same code by including "quicksort.i.c".
380 (scm_restricted_vector_sort_x): Call one of quicksort and
381 quicksort1, depending on increment of vector.
382 (scm_sort): Simply call scm_sort_x on a copy of the list or
383 vector.
384 (scm_merge_vector_x, scm_merge_vector_step): Changed indices to
385 size_t, added inc parameter.
386 (scm_stable_sort_x): Allocate temporary storage as Scheme vector
387 so that it doesn't leak.
388 (scm_stable_sort): Simply call scm_stable_sort_x on a copy of the
389 list or vector.
390
391 * ramap.c (scm_array_map_x): Do not try to convert fill value
392 before filling, any necessary conversion is done while storing.
393
394 * gc-card.c (scm_i_sweep_card): Call scm_i_vector_free instead of
395 doing it inline.
396
397 * hashtab.c, hashtab.h (SCM_HASHTABLE_BUCKETS): Removed.
398 (SCM_HASHTABLE_BUCKET, SCM_HASHTABLE_BUCKET_LOC): New. Replaced
399 all uses of SCM_HASHTABLE_BUCKETS with SCM_HASHTABLE_BUCKET.
400
401 * tags.h, weaks.c, vports.c, hashtab.c, convert.c, sort.c,
402 convert.c, convert.h, convert.i.c, deprecated.c, environments.c,
403 eval.c, filesys.c, fluids.c, gc-mark.c, gh.h, gh_data.c, goops.c,
404 hash.c, init.c, libguile_la-arrays.loT, modules.c, net_db.c,
405 objects.c, ports.c, posix.c, print.c, random.c, read.c,
406 regex-posix.c, scmsigs.c, socket.c, stime.c, symbols.c: Use new
407 vector elements API or simple vector API, as appropriate. Removed
408 SCM_HAVE_ARRAYS ifdefery. Replaced all uses of
409 SCM_HASHTABLE_BUCKETS with SCM_HASHTABLE_BUCKET.
410
411 * srfi-4.h, srfi-4.c,
412 srfi-4.i.c (scm_array_handle_uniform_elements,
413 scm_array_handle_uniform_writable_elements,
414 scm_uniform_vector_elements,
415 scm_uniform_vector_writable_elements):
416 (scm_<foo>vector_elements, scm_<foo>vector_writable_elements): Use
417 scm_t_array_handle, deliver length and increment.
418 (scm_array_handle_<foo>_elements,
419 scm_array_handle_<foo>_writable_elements): New.
420
421 * gen-scmconfig.h.in (SCM_I_GSC_HAVE_ARRAYS): Removed.
422 * gen-scmconfig.c: Hard code SCM_HAVE_ARRAYS to "1".
423
424 * unif.h, unif.c (scm_t_array_handle, scm_array_get_handle,
425 scm_array_handle_rank, scm_array_handle_dims, scm_array_handle_ref
426 scm_array_handle_set, scm_array_handle_elements
427 scm_array_handle_writable_elements, scm_vector_get_handle): New.
428 (scm_make_uve, scm_array_prototype, scm_list_to_uniform_array,
429 scm_dimensions_to_uniform_array): Deprecated for real.
430 (scm_array_p, scm_i_array_p): Use latter for SCM_DEFINE since
431 snarfing wont allow a mismatch between C and Scheme arglists.
432 (scm_make_shared_array, scm_enclose_array): Correctly use
433 scm_c_generalized_vector_length instead of
434 scm_uniform_vector_length.
435
436 * validate.h (SCM_VALIDATE_VECTOR,
437 SCM_VALIDATE_VECTOR_OR_DVECTOR): use scm_is_simple_vector instead
438 of SCM_VECTORP.
439
440 * weaks.h, weaks.c: Use new internal weak vector API from
441 vectors.h.
442
443 * Makefile.am (libguile_la_SOURCES, DOT_X_FILES, DOT_DOC_FILES,
444 EXTRA_libguile_la_SOURCES): Changed ramap.c and unif.c from being
445 'extra' to being regular sources.
446 (noinst_HEADERS): Added quicksort.i.c.
447 * quicksort.i.c: New file.
448
449 * vectors.h, vector.c (SCM_VECTORP, SCM_VECTOR_LENGTH, SCM_VELTS,
450 SCM_WRITABLE_VELTS, SCM_VECTOR_REF, SCM_VECTOR_SET): Deprecated
451 and reimplemented. Replaced all uses with scm_vector_elements,
452 scm_vector_writable_elements, or SCM_SIMPLE_VECTOR_*, as
453 appropriate.
454 (scm_is_simple_vector, SCM_SIMPLE_VECTOR_LENGTH,
455 SCM_SIMPLE_VECTOR_REF, SCM_SIMPLE_VECTOR_SET,
456 SCM_SIMPLE_VECTOR_LOC): New.
457 (SCM_VECTOR_BASE, SCM_SET_VECTOR_BASE, SCM_VECTOR_MAX_LENGTH,
458 SCM_MAKE_VECTOR_TAG, SCM_SET_VECTOR_LENGTH,
459 SCM_VELTS_AS_STACKITEMS, SCM_SETVELTS, SCM_GC_WRITABLE_VELTS):
460 Removed.
461 (scm_vector_copy): New.
462 (scm_vector_elements, scm_vector_writable_elements): Use
463 scm_t_array_handle, deliver length and increment. Moved to
464 unif.h. Changed all uses.
465 (scm_vector_release_elements,
466 scm_vector_release_writable_elements,
467 (scm_frame_vector_release_elements,
468 scm_frame_vector_release_writable_elements): Removed.
469 (SCM_I_IS_VECTOR, SCM_I_VECTOR_ELTS, SCM_I_VECTOR_WELTS,
470 SCM_I_VECTOR_LENGTH, scm_i_vector_free): New internal API.
471 (SCM_I_WVECTP SCM_I_WVECT_LENGTH SCM_I_WVECT_VELTS
472 SCM_I_WVECT_GC_WVELTS SCM_I_WVECT_TYPE SCM_I_WVECT_GC_CHAIN
473 SCM_I_SET_WVECT_GC_CHAIN, scm_i_allocate_weak_vector): New, for
474 weak vectors.
475
0336d18b
MV
4762004-12-29 Marius Vollmer <mvo@zagadka.de>
477
478 No longer use creators to specify the type of an array. Creators
479 expose the fact that arrays are wrapped around vectors, but that
480 might change.
481
482 * srfi-4.h (scm_i_proc_make_u8vector, scm_i_proc_make_s8vector,
483 scm_i_proc_make_u16vector, scm_i_proc_make_s16vector,
484 scm_i_proc_make_u32vector, scm_i_proc_make_s32vector,
485 scm_i_proc_make_u64vector, scm_i_proc_make_s64vector,
486 scm_i_proc_make_f32vector, scm_i_proc_make_f64vector,
487 scm_i_proc_make_c32vector, scm_i_proc_make_c64vector,
488 uvec_proc_vars): Removed.
489 (scm_i_generalized_vector_creator): Removed.
490 (scm_i_generalized_vector_type): New.
491
492 * unif.h, unif.c (scm_typed_array_p, scm_make_array,
493 scm_make_typed_array, scm_array_type, scm_list_to_array,
494 scm_list_to_typed_array, scm_is_array, scm_is_typed_array): New.
495 (scm_array_creator): Removed.
496 (scm_array_p): Deprecated second PROT argument.
497 (scm_dimensions_to_uniform_array, scm_list_to_uniform_array):
498 Deprecated, reimplemented in terms of scm_make_typed_array and
499 scm_list_to_typed_array.
500 (scm_i_proc_make_vector, scm_i_proc_make_string,
501 scm_i_proc_make_bitvector): Removed.
502 (type_creator_table, init_type_creator_table, type_to_creator,
503 make_typed_vector): New.
504 (scm_i_convert_old_prototype): Removed.
505 (prototype_to_type): New.
506 (scm_make_uve): Deprecated, reimplemented using make_typed_vector.
507 (scm_array_dimensions): Use scm_list_1 instead of scm_cons for
508 minor added clarity.
509 (scm_make_shared_array, scm_ra2contig): Use make_typed_vector
510 instead of scm_make_uve.
511 (tag_creator_table, scm_i_tag_to_creator): Removed.
512 (tag_to_type): New.
513 (scm_i_read_array): Use scm_list_to_typed_array instead of
514 scm_list_to_uniform_array.
515
277e8472
MV
5162004-12-27 Marius Vollmer <mvo@zagadka.de>
517
32b26202
MV
518 * unif.h, unif.c (scm_bitvector_elements): Made return value "const".
519 (scm_bitvector_writable_elements): New.
520 (scm_bitvector_release, scm_bitvector_release_elements):
521 Renamed former to latter. Added explicit call to
522 scm_remember_upto_here_1.
523 (scm_frame_bitvector_release,
524 scm_frame_bitvector_release_elements): Renamed former to latter.
525 (scm_bitvector_release_writable_elements,
526 scm_bitvector_release_writable_elements): New.
527 Changed all uses as required by the changes above.
528
529 * srfi-4.h, srfi-4.c, srfi-4.i.c (scm_uniform_vector_elements,
530 scm_u8vector_elements, etc): Made return value "const".
531 (scm_uniform_vector_writable_elements,
532 scm_u8vector_writable_elements, etc): New.
533 (scm_uniform_vector_release, scm_uniform_vector_release_elements):
534 Renamed former to latter. Added explicit call to
535 scm_remember_upto_here_1.
536 (scm_frame_uniform_vector_release,
537 scm_frame_uniform_vector_release_elements): Renamed former to latter.
538 (scm_uniform_vector_release_writable_elements,
539 scm_frame_uniform_vector_release_writable_elements): New. Takes
540 crown of longest identifier yet.
541 Changed all uses as required by the changes above.
542
277e8472
MV
543 * vectors.h, vectors.c (scm_c_vector_set_x): Make return type
544 void.
545 (scm_is_vector, scm_vector_p, scm_vector_length,
546 scm_c_vector_length, scm_vector_ref, scm_c_vector_ref,
547 scm_vector_set_x, scm_c_vector_set_x, scm_vector_to_list,
548 scm_vector_move_left_x, scm_vector_move_right_x,
549 scm_vector_fill_x): handle one-dimensional arrays.
32b26202
MV
550 (scm_vector_elements, scm_vector_release_elements,
551 scm_vector_frame_release_elements, scm_vector_writable_elements,
552 scm_vector_release_writable_elements,
553 scm_vector_frame_release_writable_elements): New.
554 (scm_list_to_vector, scm_vector_to_list, scm_vector_fill,
555 scm_vector_move_left_x, scm_vector_move_right_x): Use them.
277e8472
MV
556
557 * ramap.c (scm_ramapc, scm_raeql): Use
558 scm_c_generalized_vector_length instead of
559 scm_uniform_vector_length.
560 (scm_ramap, rafe): Use scm_c_vector_ref instead of SCM_VELTS. use
561 scm_c_generalized_vector_ref instead of scm_uniform_vector_ref.
562
49c51610
MV
5632004-12-23 Marius Vollmer <marius.vollmer@uni-dortmund.de>
564
565 * continuations.h, continuations.c (scm_t_contregs): New 'offset'
566 member for relocating debug frames.
567 (scm_make_continuation): Set it.
568
569 * stacks.c (read_frame, read_frames, scm_make_stack,
570 scm_last_stack_frame, scm_stack_id): Use the new 'offset' member
571 of continuations instead of calculating the offset ourselves.
572 Relocate 'vect' member of scm_t_debug_frame.
573
3b2ee265
KR
5742004-12-16 Kevin Ryde <user42@zip.com.au>
575
576 * ramap.c (scm_array_map_x): Check for at least one source argument.
577
e120686a
KR
5782004-12-14 Kevin Ryde <user42@zip.com.au>
579
580 * srfi-13.c (string-any, string-every): Use a scheme wrapper around
581 the C code so for the final call to the predicate procedure is a tail
582 call, per SRFI-13 spec.
583
680b5237
KR
5842004-12-10 Kevin Ryde <user42@zip.com.au>
585
586 * eq.c (scm_eq_p, scm_eqv_p, scm_equal_p): Update docstrings from
587 recent revision to the reference manual.
588
589 * numbers.c (scm_modulo): Amend fixme comment about negative divisor
590 with "%", C99 says it's well-defined.
591
592 * socket.c (scm_from_ipv6): Just use mpz_import. Don't bother trying
593 to fit scm_from_ulong_long, since that uses mpz_import anyway. Don't
594 bother trying to fit scm_from_ulong, not really worth the trouble if
595 addresses are more than 4 bytes usually.
596
446d320c
KR
5972004-11-30 Kevin Ryde <user42@zip.com.au>
598
599 * gc_os_dep.c (NetBSD): Test __m68k__ and __arm__ as well as m68k and
600 arm32. Reported by Greg Troxel.
601
f2654760
MV
6022004-11-14 mvo <mvo@zagadka.de>
603
604 * unif.c, unif.h (scm_i_cvref): Made non-static for ramap.c.
605
606 * Makefile.am (INCLUDES): It is "@LTDLINCL@", not "@LTDLINC@".
607
d550e35f
MV
6082004-11-12 Marius Vollmer <marius.vollmer@uni-dortmund.de>
609
610 Enclosed arrays are now their own smob. This has been done to
611 make the code more explicit about them and to prepare for the time
f2654760
MV
612 when generalized vectors include arbitrary one-dimensional
613 arrays. (Uptonow, enclosed arrays have been recognized by their
614 use of an array as their storage 'vector'. When all generalized
615 vectors are allowed as storage, including one-dimensional arrays,
616 this will no longer work.)
d550e35f
MV
617
618 * unif.h, unif.c: (scm_tc16_enclosed_array, SCM_ENCLOSED_ARRAYP):
619 New.
620 (exactly_one_third, singp): Removed.
621 (scm_array_p, scm_array_dimensions, scm_shared_array_root,
622 scm_shared_array_offset, scm_shared_array_increments): Handle
623 enclosed arrays explicitely.
624 (scm_array_rank): Likewise. Also, do not return zero for
625 non-arrays, signal an error instead since arrays with rank zero do
626 exist.
627 (scm_i_make_ra): New, for specifying the tag of the new array.
628 (scm_make_enclosed_array): Use it.
629 (scm_make_ra): Reimplemented in terms of scm_i_make_ra.
630 (scm_make_shared_array): Use scm_c_generalized_vector_length
631 instead of scm_uniform_vector_length.
632 (scm_array_in_bounds_p): Rewritten to be much cleaner.
633 (scm_i_cvref): New, doing the job of scm_cvref.
634 (scm_cvref): Use scm_i_cvref.
635 (scm_array_ref): Do not accept non-arrays when no indices are
636 given. Use scm_i_cvref to do the actual access.
637 ("uniform-array-set1"): Do not register.
638 (scm_array_set_x, scm_uniform_array_read_x,
639 scm_uniform_array_write): Handle enclosed arrays explicitly.
640 (ra2l): Use scm_i_cvref instead of scm_uniform_vector_ref to also
641 handle enclosed arrays.
642 (scm_array_to_list): Handle enclosed arrays explicitly.
643 (rapr1): Removed.
644 (scm_i_print_array_dimension): Use scm_i_cvref to also handle
645 enclosed arrays.
646 (scm_i_print_enclosed_array): New.
647 (tag_proto_table, tag_creator_table): Renamed former to latter.
648 Added "a" and "b" for strings and bitvectors, resp.
649 (scm_i_tag_to_prototype, scm_i_tag_to_creator): Renamed former to
650 latter. Tag "a" is in the table now, no need to handle it as a
651 legacy tag.
652 (scm_raprin1): Just call scm_iprin1.
653 (scm_array_creator, scm_array_prototype): Handle enclosed arrays
654 explicitly.
655 (scm_init_unif): Initialize scm_tc16_enclosed_array smob.
656 Use scm_i_print_array as printer for scm_tc16_array.
657
2ed34885
MV
6582004-11-10 Marius Vollmer <mvo@zagadka.de>
659
823086c1
MV
660 * ramap.c (cind): Changed second arg to be pointer to long instead
661 of uniform vector.
662 (scm_ramapc): Allocate index vector with scm_malloc and not as
d550e35f 663 uniform vector. Wrap it in a frame so that it gets properly freed.
823086c1
MV
664 (scm_array_index_map_x): Likewise.
665
666 * unif.c: Changed all uses of scm_array_prototype to
667 scm_array_creator. (scm_i_get_old_prototype): Signal error when no
668 prototype is known.
669 (scm_uniform_array_read_x, scm_uniform_array_write): Reimplemented
670 in terms of scm_uniform_vector_read_x and
671 scm_uniform_vector_write, respectively. Strings and
672 bitvector support has been dropped.
673
2ed34885
MV
674 * srfi-4.h, srfi-4.c: Do not include <libguile.h>, include the
675 needed files directly. Include config.h, <unistd.h> and <io.h>
676 when available.
677 (scm_uniform_vector_read_x, scm_uniform_vector_write): New.
678
2c72f253
MV
6792004-11-09 Marius Vollmer <mvo@zagadka.de>
680
681 * gh_data.c (gh_uniform_vector_length): Properly use
682 scm_c_uniform_vector_length instead of scm_uniform_vector_length.
683
3cc0a296
MV
6842004-11-09 Marius Vollmer <marius.vollmer@uni-dortmund.de>
685
686 * srfi-4.h (scm_c_uniform_vector_ref, scm_c_uniform_vector_set_x):
687 New.
688 (scm_i_uniform_vector_creator): Removed.
689 (scm_i_generalized_vector_creator): New.
690 (scm_uniform_vector_length, scm_uniform_element_size): Do not
691 handle generalized vectors, only uniform numeric vectors.
692 (alloc_uvec): Do length check here...
693 (make_uvec): ...but not here.
694 (coerce_to_uvec): Use new generalized vector functions to handle
695 all kinds of vectors in one go.
696
697 * tags.h (scm_tc7_bvect): Renamed to scm_tc7_unused7, renaming the
698 remaining scm_tc7_unused tags to get a neatly ordered list.
699
700 * eq.c, evalext.c, gc-card.c, gc-mark.c, objects.c, print.c: Do no
701 longer handle scm_tc7_bvect bitvectors.
702
703 * ramap.c: Use the new generalized vector functions to handle all
704 vector like things.
705
706 * vectors.h, vectors.c (scm_is_vector, scm_c_vector_length,
707 scm_c_vector_ref, scm_c_vector_set_x, scm_generalized_vector_p,
708 scm_generalized_vector_length, scm_generalized_vector_ref,
709 scm_generalized_vector_set_x, scm_generalized_vector_to_list,
710 scm_is_generalized_vector, scm_c_generalized_vector_length,
711 scm_c_generalized_vector_ref, scm_c_generalized_vector_set_x):
712 New.
713
714 * unif.h, unif.c (scm_bitvector_p, scm_bitvector,
715 scm_make_bitvector, scm_bitvector_length, scm_bitvector_ref,
716 scm_bitvector_set_x, scm_list_to_bitvector, scm_bitvector_to_list,
717 scm_bitvector_fill_x, scm_is_bitvector, scm_c_make_bitvector,
718 scm_c_bitvector_length, scm_c_bitvector_ref,
719 scm_c_bitvector_set_x, scm_bitvector_elements,
720 scm_bitvector_release, scm_frame_bitvector_release,
721 scm_tc16_bitvector, bitvector_free, bitvector_print,
722 bitvector_equalp, count_ones, find_first_one): New.
723 (scm_bit_count, scm_bit_position, scm_bit_set_star_x,
724 scm_bit_count_star, scm_bit_invert_x, scm_istr2bve): Rewritten
725 using the new C API for bitvectors and maybe count_ones or
726 find_first_one, as appropriate.
727 (SCM_I_MAX_LENGTH, SCM_BITVECTOR_P, SCM_BITVECTOR_BASE,
728 SCM_SET_BITVECTOR_BASE, SCM_BITVECTOR_MAX_LENGTH,
729 SCM_BITVECTOR_LENGTH, SCM_MAKE_BITVECTOR_TAG,
730 SCM_SET_BITVECTOR_LENGTH): Removed. Replaced all uses with the
731 new functions from above.
732 (scm_i_proc_make_vector, scm_i_proc_make_string,
733 scm_i_proc_make_bitvector): Made non-static for use in
734 scm_i_generalized_vector_creator.
735 (scm_make_u1vector): Removed, replaced by scm_make_bitvector.
736 (scm_make_uve): Validate that the created object is a generalized
737 vector.
738 (scm_i_legacy_tag): Removed.
739 (scm_i_print_array): Do it here.
740 (scm_raprin1): Only print enclosed arrays.
741
742 * Makefile.am (DOT_DOC_FILES): Added srfi-4.doc.
743
c24d026b
MV
7442004-11-04 Marius Vollmer <marius.vollmer@uni-dortmund.de>
745
1f2328fe
MV
746 * srfi-4.c (make_uvec): Use SCM_I_SIZE_MAX instead of SIZE_MAX for
747 added portability.
748
749 * chars.c (scm_charnames, scm_charnums): Added "sp" as an alias
750 for "space". Thanks to Bruce Korb!
751
c24d026b
MV
752 * rw.c (scm_read_string_x_partial): Bugfix, apply offset to dest
753 only after dest has been set. Thanks to Hyper Division!
754
755 * gh_data.c (gh_uniform_vector_length): Use
756 scm_uniform_vector_length instead of SCM_UVECTOR_LENGTH.
757
d4ea47c8
MV
7582004-11-03 Marius Vollmer <mvo@zagadka.de>
759
760 * unif.h (SCM_UVECTOR_BASE, SCM_SET_UVECTOR_BASE,
761 SCM_UVECTOR_MAXLENGTH, SCM_UVECTOR_LENGTH, SCM_MAKE_UVECTOR_TAG,
762 SCM_SET_UVECTOR_LENGTH): Removed.
763
236288e2
MV
7642004-11-02 Marius Vollmer <mvo@zagadka.de>
765
766