* unif.h, unif.c (scm_array_creator): New.
[bpt/guile.git] / libguile / ChangeLog
CommitLineData
5e9c05a1
MV
12004-10-29 Marius Vollmer <marius.vollmer@uni-dortmund.de>
2
3 * unif.h, unif.c (scm_make_u1vector): New, but only temporary.
4 (make_uve): Removed.
5 (scm_i_proc_make_vector, scm_i_proc_make_string,
6 scm_i_proc_make_u1vector): New.
7 (scm_init_unif): Initialize them.
8 (scm_i_convert_old_prototype): New.
9 (scm_make_uve): Use it to get the creator procedure. Removed all
10 old code that created old-style uniform vectors.
11 (scm_array_p): Handle generic vectors.
12 (scm_dimensions_to_uniform_array): Do not fill new array with
13 prototype when that is a procedure.
14 (scm_list_to_uniform_array): Also accept a list of lower bounds as
15 the NDIM argument.
16 (scm_i_print_array): Print rank for shared or non-zero-origin
17 vectors.
18 (tag_proto_table, scm_i_tag_to_prototype, scm_i_read_array): New.
19 (scm_raprin1): Do not call scm_i_array_print for enclosed arrays,
20 which I do not understand yet.
21 (scm_array_prototype): Explicitely handle generic vectors.
22
23 * numbers.c, number.h (scm_i_print_complex, icmplx2str): New.
24 (iflo2str): Use icmplx2str for complex numbers.
25
26 * srfi-4.c, srfi-4.h (scm_i_read_homogenous_vector,
27 scm_i_uniform_vector_prototype): Removed.
28 (scm_i_uniform_vector_creator): New.
29 (SCM_UVEC_C32, scm_c32vector, scm_make_c32vector, etc,
30 SCM_UVEC_C64, scm_c64vector, scm_make_c64vector, etc): New.
31 Updated all tables and generic functions to support them.
32 (scm_i_proc_make_u8vector, scm_i_proc_make_s8vector, etc): New.
33 (scm_init_srfi_4): Initialize them.
34
35 * srfi-4.i.c (scm_take_u8vector, etc): use uvec_sizes instead of
36 sizeof(CTYPE) as explained in the comment.
37
38 * read.c (scm_lreadr): Call scm_i_read_array for all characters
39 followinf '#' that can start an array. Explicitely disambiguate
40 'i' and 'e' between introducing numbers and uniform vectors. Do
41 not call scm_i_read_homogenous_vector, since that is also handled
42 by scm_i_read_array now.
43
f984af07
MV
442004-10-27 Marius Vollmer <marius.vollmer@uni-dortmund.de>
45
46 First cut at integrating uniform vectors from srfi-4 with the rest
47 of Guile. This change replaces scm_tc7_byvect with a s8 uniform
48 vector. The plan is to gradually replace one type after the other
49 until none is left and then to consider general cleanups and
50 optimizations.
51
52 * srfi-4.h, srfi-4.i.c (scm_u8vector_elements, etc): New.
53
54 * srfi-4.h, srfi-4.c (scm_uniform_vector_p,
55 scm_uniform_vector_ref, scm_uniform_vector_set_x,
56 scm_uniform_vector_to_list, scm_is_uniform_vector,
57 scm_c_uniform_vector_lengths, scm_c_uniform_vector_size,
58 scm_uniform_vector_elements, scm_uniform_vector_element_size,
59 scm_uniform_vector_release): New.
60 (scm_i_uniform_vector_prototype, scm_i_uniform_vector_tag): New.
61 (scm_uniform_element_size, scm_uniform_vector_length): Moved here
62 from unif.h, unif.c and extended to handle both the old and new
63 uniform vectors.
64
65 * tags.h (scm_tc7_byvect): Commented out.
66
67 * unif.h, unif.c (scm_uniform_vector_ref, scm_array_ref): Renamed
68 the former to the latter.
69 (scm_uniform_vector_length, scm_uniform_element_size): Moved to
70 srfi-4.h, srfi-4.c.
71 (scm_make_uve): Call scm_make_s8vector for #\nul prototype.
72 (scm_array_p, scm_array_rank, scm_array_dimensions,
73 scm_transpose_array, scm_enclose_array, scm_array_ref, scm_cvref,
74 scm_array_set_x, scm_array_contents, scm_uniform_array_read_x,
75 scm_array_to_list, scm_array_prototype): Handle srfi-4 uniform
76 vectors. Removed code for scm_tc7_byvect.
77 (scm_dimensions_to_uniform_array): Fill array with 0 when
78 prototype is #\nul.
79 (scm_i_print_array_dimension, scm_i_legacy_tag,
80 scm_i_print_array): New.
81 (scm_raprin1): Call scm_i_print_array for arrays. Removed code
82 for scm_tc7_byvect.
83
84 * ramap.c (scm_ra_matchp, scm_array_fill_int, racp,
85 scm_array_index_map_x, raeql_1, scm_array_equal_p): Handle srfi-4
86 uniform vectors. Removed code for scm_tc7_byvect
87
88 * print.c (iprin1): Removed code for scm_tc7_byvect.
89 * objects.c (scm_class_of): Likewise.
90 * gc-mark.c (scm_gc_mark_dependencies): Likewise.
91 * gc-card.c (scm_i_sweep_card): Likewise.
92 * evalext.c (scm_self_evaluating_p): Likewise.
93 * eq.c (scm_equal_p): Likewise.
94
95 * gh_data.c (gh_chars2byvect): Reimplemented with
96 scm_make_s8vector.
97 (gh_scm2chars): Handle s8vectors, removed code for scm_tc7_byvect.
98
99 * srfi-4.c (take_uvec): New.
100 (alloc_uvec): Use it.
101 * srfi-4.h, srfi-4.i.c (scm_take_u8vector, etc): New.
102
103 * random.c (vector_scale, vector_scale_x): Renamed former to the
104 latter, since it modifies its argument.
105 (vector_scale_x, vector_sum_squares, scm_random_normal_vector_x):
106 Do not use scm_universal_vector_length for non-uniform vectors.
107 Use scm_f64vector_elements to access innards of uniform vectors.
108
109 * convert.i.c: Convert srfi-4 style uniform vectors when
110 requested.
111 * convert.c (scm_c_scm2chars, scm_c_chars2scm,
112 scm_c_chars2byvect): Use a s8vector instead of a scm_tc7_byvect.
113
79d52182
MV
1142004-10-26 Marius Vollmer <marius.vollmer@uni-dortmund.de>
115
116 * numbers.h, numbers.c (scm_i_print_double): New.
117
118 * srfi-4.c, srfi-4.h, srfi-4.i.c: New files, initially from
119 ../srfi/ but heavily modified.
120 * Makefile.am: Add them in all the right places.
121 * init.c (scm_init_guile_1): Call scm_init_srfi_4.
122 * read.c (scm_lreadr): Call scm_i_read_homogenous_vector for '#f',
123 '#u', and '#s'.
124
125 * read.h, read.c (scm_i_input_error): Renamed from scm_input_error
126 and made non-static. Changed all uses.
127
6191ccec
MV
1282004-10-22 Marius Vollmer <marius.vollmer@uni-dortmund.de>
129
e64e80b0
MV
130 * variable.c, threads.c, struct.c, stackchk.c, smob.c, root.c,
131 print.c, ports.c, mallocs.c, hooks.c, hashtab.c, fports.c,
132 guardians.c, filesys.c, coop-pthreads.c, continuations.c: Use
133 scm_uintprint to print unsigned integers, raw heap words, and
134 adresses, using a cast to scm_t_bits to turn pointers into
135 integers.
136
137 * unif.c: Include "libguile/print.h".
138
c90ac3a8
MV
139 * numbers.h, numbers.c (SCM_T_INTBUFLEN): Increased to cover
140 scm_t_intmax values.
141 (scm_uint2str): New, for scm_t_uintmax.
142 (scm_iint2str): Argument type changed to scm_t_intmax,
143 reimplemented in terms of scm_uint2str.
144
145 * print.c, print.h (scm_uintprint): New, for printing
146 scm_t_uintmax values.
147 (scm_intprint): Argument type changed to scm_t_intmax.
148
77c2594f
MV
149 * sort.c (quicksort, scm_merge, scm_merge_list_x,
150 scm_merge_list_step, scm_merge_vector_step): Inserted SCM_TICKs at
151 strategic places so that the loops can be interrupted.
152
6191ccec
MV
153 * Makefile.am (INCLUDES): Use @LTDLINC@ instead of
154 "-I$(top_srcdir)/libguile-ltdl".
155 (libguile_la_LIBADD): Use @LIBLTDL@ instead of
156 "../libguile-ltdl/libguile-ltdl.a".
157
158 * guile.c, dynl.c: Switched to using libltdl directly. Replaced
159 all references to scm_lt_* with just lt_*. Include <ltdl.h>
160 instead of <libguile-ltdl.h>.
161
77600f3e
MV
1622004-10-20 Marius Vollmer <mvo@zagadka.de>
163
164 * sort.c (quicksort): Copy pivot out of the array while
165 constructing the partitions; it could get overwritten otherwise.
166 Because of the ultimate insertion sort, this bug did not cause
167 quicksort to fail, it just put all the burdon on the insertion
168 sort and was thus very slow. Thanks to Rolan Orre for reporting
169 the slowness!
170
5000379b
MV
1712004-10-19 Marius Vollmer <marius.vollmer@uni-dortmund.de>
172
192cd792
MV
173 * numbers.c (scm_i_range_error): New.
174 * conv-integer.i.c, conv-uinteger.i.c: Use it instead of
175 scm_out_of_range.
176
177 * sort.c (scm_restricted_vector_sort_x): Validate startpos <=
6191ccec 178 endpos. State inclusiveness/exclusiveness of bounds in docstring.
192cd792
MV
179
180 * unif.c (scm_array_p): When no prototype is given, explicitely
181 test for allowable types, do not simply return true. Thanks to
182 Roland Orre for reporting this!
183
5000379b
MV
184 * private-gc.h (SCM_DEFAULT_MAX_SEGMENT_SIZE): Increase to 20 Mib.
185
186 * gc-segment.c (scm_i_get_new_heap_segment): Limit size of new
187 segment to scm_max_segment_size.
188
497eb0b7
HWN
1892004-10-08 Han-Wen Nienhuys <hanwen@xs4all.nl>
190
191 * inline.h (scm_double_cell): abort if GC running.
192 (scm_cell): idem.
193
aef0bdb4
MV
1942004-10-04 Marius Vollmer <marius.vollmer@uni-dortmund.de>
195
196 * error.c (scm_wrong_type_arg): Do not talk about "argument" for
197 pos == 0.
198
199 Keywords no longer store a 'dash symbol'. Instead, they store a
200 symbol with their real name.
201
202 * keywords.h, keywords.c, deprecated.h, deprecated.c
203 (SCM_KEYWORDP, SCM_KEYWORDSYM): Deprecated and implemented in
204 terms of scm_is_keyword and scm_keyword_dash_symbol.
205
206 * keywords.h, keywords.c, discouraged.h, discouraged.c
207 (scm_make_keyword_from_dash_symbol, scm_keyword_dash_symbol,
208 scm_c_make_keyword): Discouraged.
209
210 * keywords.h, keywords.c (scm_symbol_to_keyword,
211 scm_keyword_to_symbol): Implemented in C.
212 (scm_is_keyword, scm_from_locale_keyword,
213 scm_from_locale_keywordn): New.
214
215 * goops.c: Replaced SCM_KEYWORDP with scm_is_keyword.
216
217 * snarf.h (SCM_KEYWORD, SCM_GLOBAL_KEYWORD): Use
218 scm_from_locale_keyword instead of scm_c_make_keyword.
219
220 * keywords.c (scm_symbol_to_keyword): Use SCM_ASSERT_TYPE for a
221 better error message.
222
223 * deprecated.c: Include discouraged.h and keywords.h.
224
225 * read.c (scm_lreadr): Simply do (symbol->keyword (read)) after
226 reading '#:' or ':'. See NEWS for consequences.
227
818deb11
MV
2282004-09-29 Marius Vollmer <marius.vollmer@uni-dortmund.de>
229
43c25626
MV
230 * read.c (scm_lreadr): Revert change from 2004-09-22: string
231 literals are now read-write again (until SCM_STRING_CHARS is
232 removed).
233
234 * strings.c (SCM_STRING_CHARS): Explicitely reject read-only
235 strings with an error message that blames SCM_STRING_CHARS.
236
237 * options.c (change_option_setting): Use scm_car instead of
238 explicit type check plus SCM_CAR.
239
240 * print.h, print.c (SCM_PRINT_HIGHLIGHT_PREFIX,
241 SCM_PRINT_HIGHLIGHT_SUFFIX): New printer options.
242 (scm_iprin1): Use them instead of the previoulsy hardcoded
243 strings.
244 (scm_init_print): Initialize them.
245
246 * backtrace.c (display_frame_expr): Do not remove control
247 characters from the final string. Print it directly using
248 scm_display.
249
818deb11
MV
250 * ramap.c (scm_array_equal_p): Include scm_tc7_svect in switch.
251 Thanks to Roland Orre!
252
d748089e
KR
2532004-09-29 Kevin Ryde <user42@zip.com.au>
254
255 * regex-posix.c (scm_regexp_exec): Correction to last change, should
256 be whole original string in match struct, not offsetted substring.
257
0ff7e3ff
HWN
2582004-09-24 Han-Wen Nienhuys <hanwen@xs4all.nl>
259
260 * gc.c (scm_gc_unprotect_object): abort if called during GC.
261
ad7de4b8
MV
2622004-09-24 Marius Vollmer <mvo@zagadka.de>
263
2edf319f
MV
264 * Makefile.am (EXTRA_DIST): Added gettext.h.
265
d180337b
MV
266 * smob.c, smob.h (scm_assert_smob_type): New.
267
05d7cf89 268 * Makefile.am (guile_CFLAGS, guile_LDFLAGS, libguile_la_CFLAGS):
ad7de4b8
MV
269 Include GUILE_CFLAGS.
270 (libguile_la_LIBADD): Removed THREAD_LIBS_LOCAL, which is unused
271 now.
272 (libpath.h): Put GUILE_CFLAGS in the build-info.
273
c9fedf8a
MV
2742004-09-23 Marius Vollmer <mvo@zagadka.de>
275
276 * print.h (scm_print_state): Added highlight_objects.
277 * print.c (make_print_state, scm_free_print_state): Initialize it
278 to SCM_EOL.
279 (scm_iprin1): Wrap output in '{...}' when object is contained in
280 highlight_objects.
281
282 * backtrace.h, backtrace.c (scm_display_backtrace_with_highlights,
283 scm_backtrace_with_highlights): New. Set highlight_objects of
284 printstate.
285
286 * error.c (scm_error_scm): Document new meaning of data/rest
287 argument for out-of-range and wrong-type-arg errors.
288 (scm_out_of_range, scm_out_of_range_pos, scm_wrong_type_arg,
289 scm_wrong_type_arg_msg): Pass bad_value in rest argument of
290 exception so that it gets highlighted in the backtrace.
291 Don't talk about "argument" when not giving a position.
292
293 * throw.c (handler_message): The rest argument is the fourth
294 argument, not everything after the third. Call
295 scm_display_backtrace_with_highlights, passing the rest argument
296 when appropriate.
297
d5ac9b2a
MV
2982004-09-22 Marius Vollmer <mvo@zagadka.de>
299
300 From Jan Nieuwenhuizen <janneke@gnu.org> and Bruno Haible
301 <bruno@clisp.org>:
302
303 * i18n.c: Handle --disable-nls (thanks Bruno).
304
305 * posix.c (scm_init_posix): Add LC_PAPER, LC_NAME, LC_ADDRESS,
306 LC_TELEPHONE, LC_MEASUREMENT, LC_IDENTIFICATION.
307
308 * i18n.c (scm_i_to_lc_category): New name and export. Support all
309 LC categories.
05d7cf89 310 * posix.c (scm_setlocale): Use it.
d5ac9b2a
MV
311
312 * i18n.h, i18n.c (scm_textdomain, scm_bindtextdomain,
313 scm_bind_textdomain_codeset): Make wrappers similar to C function
314 they wrap.
315
316 * i18n.h: New file.
317 * i18n.c: New file.
318 * gettext.h: New file, taken from GNU gettext.
319 * init.c: Include libguile/i18n.h.
320 (scm_init_guile_1): Add call to scm_init_i18n().
321 * Makefile.am (libguile_la_SOURCES): Add i18n.c.
322 (DOT_X_FILES): Add i18n.x.
323 (DOT_DOC_FILES): Add i18n.doc.
324 (libguile_la_LDFLAGS): Add @LTLIBINTL@.
325 (modinclude_HEADERS): Add i18n.h.
326
d2e53ed6
MV
3272004-09-22 Marius Vollmer <mvo@zagadka.de>
328
2cdfe016
MV
329 * gh_list.c: Replaced SCM_CAR, etc with scm_car, etc.
330
d2e53ed6
MV
331 * discouraged.h, tags.h (SCM_CONSP, SCM_NCONSP): Moved to
332 discouraged.h. Replaced all uses with scm_is_pair.
333 (SCM_I_CONSP): New name for SCM_CONSP.
334
335 * pairs.h, pairs.c (scm_is_pair, scm_is_null, scm_car, scm_cdr,
336 scm_i_chase_pairs, SCM_I_A_PAT, SCM_I_D_PAT, etc, scm_caar,
337 scm_cadr, etc): New.
338 (SCM_NULLP, SCM_NNULLP): Moved to discouraged.h. Replaced all
339 uses with scm_is_null.
5dd82006 340
d2e53ed6
MV
341 * eval.c (scm_eval, scm_apply, call_cxr_1): Use scm_i_chase_pairs
342 instead of explicit code.
5dd82006 343
5dfdf243
MV
3442004-09-22 Marius Vollmer <mvo@zagadka.de>
345
b50c53e5
MV
346 * srfi-13.c (scm_string_contains, scm_string_contains_ci):
347 Reworded logic a bit so that #f is returned immediately when s1 is
348 too short to contain s2.
349
5dfdf243 350 * regex-posix.c (scm_regexp_exec): Convert string to
05d7cf89 351 zero-terminated locale string before matching against it.
5dfdf243
MV
352
353 * strings.h, strings.c (scm_substring_read_only,
354 scm_c_substring_read_only, scm_i_substring_read_only): New.
355 (RO_STRING_TAG, IS_RO_STRING): New.
356 (scm_i_string_writable_chars): Bail on read-only strings.
357
358 * read.c (scm_lreadr): use scm_c_substring_read_only for string
359 literals, thus making them read-only as specified by R5RS.
360
22ab5ba3
MV
3612004-09-22 Marius Vollmer <mvo@zagadka.de>
362
363 * eq.c (scm_equal_p): Allow smobs with different flags to be equal
364 by testing for smobs before insisting on equal SCM_CELL_TYPES.
365
2663421c
MV
3662004-09-21 Marius Vollmer <mvo@zagadka.de>
367
0d83cb90
MV
368 * numbers.h, numbers.c: Include <gmp.h> in numbers.h, not in
369 numbers.c.
370 (scm_to_mpz, scm_from_mpz): New.
371