1
Fork 0
mirror of https://git.savannah.gnu.org/git/guile.git synced 2025-05-02 04:40:29 +02:00
Commit graph

247 commits

Author SHA1 Message Date
Marius Vollmer
4549ba4ac6 The SRFI-19 implementation was completely broken. Already the
reference implementation did not handle DST and time zones properly
and relied on non-R5RS-isms like passing reals to `quotient'.  For
Guile, some additional fixes were needed because of the incomplete
numeric tower implementation.  See also srfi-19.test.

* srfi-19.scm (date-zone-offset): Fixed typo in export clause.
(add-duration): Renamed from priv:add-duration.
(priv:time-normalize!): Handle fractional nanoseconds; remove
duplicate definition.  (priv:current-time-tai): Fixed typo.  (time=?,
time<=?): Fixed typos.  (time-tai->time-utc, time-utc->time-tai,
time-utc->time-monotonic): Use make-time-unnormalized instead of
make-time when uninitialized time fields are used.
(set-date-nanosecond!, set-date-second!, set-date-minute!,
set-date-hour!, set-date-day!, set-date-month!, set-date-year!,
set-date-zone-offset!): Define.  (priv:local-tz-offset): Take an extra
argument in order to handle DST effects.  (time-utc->date,
time-tai->date, time-monotonic->date): Handle the changed signature of
priv:local-tz-offset. Don't pass non-integer arguments to quotient
(non-R5RS, not supported by Guile).  (date->time-utc): Ensure that
seconds in a date structure are always exact integers.  Handle DST
properly.  (current-date, julian-day->date,
modified-julian-day->date): Handle the changed signature of
priv:local-tz-offset.  (julian-day->time-utc): Reverted earlier
inexact->exact hack; make-time now handles inexact arguments.
(priv:locale-print-time-zone): At least print the numerical time zone.
(priv:integer-reader): Fixed named let iteration.
(priv:read-directives): Use set-date-month! instead of
priv:set-date-month! etc.  (string->date): Handle DST properly.
2001-06-18 18:30:58 +00:00
Marius Vollmer
0f002b27a3 *** empty log message *** 2001-06-14 18:26:43 +00:00
Marius Vollmer
3d968b4e8b Prevent `export' from re-exporting core bindings. 2001-06-14 18:23:28 +00:00
Dirk Herrmann
e81d98ec2d * Introduce SCM_UNUSED and mark unused function parameters.
* Introduce SCM_DEBUG_PAIR_ACCESSES.
* Extend the possibilities of SCM_DEBUG_CELL_ACCESSES.
2001-06-07 21:12:19 +00:00
Martin Grabmüller
563058efbe * srfi-1.scm (fold, fold-pair): Fixed a buggy call to apply.
(delete-duplicates): Now the first occurrence of an element is
	retained, as required.
	(member, assoc): Fixed wrong order of equality predicate
	application.
2001-06-07 17:54:40 +00:00
Martin Grabmüller
e9680547d3 * README: Update.
* srfi-1.scm: New file.
2001-06-07 04:27:37 +00:00
Marius Vollmer
f480396be5 *** empty log message *** 2001-06-03 23:34:08 +00:00
Martin Grabmüller
dd22a80ac6 * srfi-14.scm, srfi-13.scm: Use `load-extension' for loading the
shared library.
2001-05-31 18:22:54 +00:00
Michael Livshin
998c3141ac * Makefile.am (MKDEP): copied from libguile/Makefile.am, just in
case.
(CLEANFILES): added *.x (and removed from DISTCLEANFILES)
2001-05-31 12:47:24 +00:00
Michael Livshin
6b0d28a380 * srfi-19.scm: removed a stray open parenthesis. (thanks to
Matthias Köppe for the report).
2001-05-28 14:36:00 +00:00
Michael Livshin
1be6b49ccb * validate.h
(SCM_NUM2{SIZE,PTRDIFF,SHORT,USHORT,BITS,UBITS,INT,UINT}[_DEF]):
new macros.

* unif.h: type renaming:
scm_array -> scm_array_t
scm_array_dim -> scm_array_dim_t
the old names are deprecated, all in-Guile uses changed.

* tags.h (scm_ubits_t): new typedef, representing unsigned
scm_bits_t.

* stacks.h: type renaming:
scm_info_frame -> scm_info_frame_t
scm_stack -> scm_stack_t
the old names are deprecated, all in-Guile uses changed.

* srcprop.h: type renaming:
scm_srcprops -> scm_srcprops_t
scm_srcprops_chunk -> scm_srcprops_chunk_t
the old names are deprecated, all in-Guile uses changed.

* gsubr.c, procs.c, print.c, ports.c, read.c, rdelim.c, ramap.c,
rw.c, smob.c, sort.c, srcprop.c, stacks.c, strings.c, strop.c,
strorder.c, strports.c, struct.c, symbols.c, unif.c, values.c,
vectors.c, vports.c, weaks.c:
various int/size_t -> size_t/scm_bits_t changes.

* random.h: type renaming:
scm_rstate -> scm_rstate_t
scm_rng -> scm_rng_t
scm_i_rstate -> scm_i_rstate_t
the old names are deprecated, all in-Guile uses changed.

* procs.h: type renaming:
scm_subr_entry -> scm_subr_entry_t
the old name is deprecated, all in-Guile uses changed.

* options.h (scm_option_t.val): unsigned long -> scm_bits_t.
type renaming:
scm_option -> scm_option_t
the old name is deprecated, all in-Guile uses changed.

* objects.c: various long -> scm_bits_t changes.
(scm_i_make_class_object): flags: unsigned long -> scm_ubits_t

* numbers.h (SCM_FIXNUM_BIT): deprecated, renamed to
SCM_I_FIXNUM_BIT.

* num2integral.i.c: new file, multiply included by numbers.c, used
to "templatize" the various integral <-> num conversion routines.

* numbers.c (scm_mkbig, scm_big2num, scm_adjbig, scm_normbig,
scm_copybig, scm_2ulong2big, scm_dbl2big, scm_big2dbl):
deprecated.
(scm_i_mkbig, scm_i_big2inum, scm_i_adjbig, scm_i_normbig,
scm_i_copybig, scm_i_short2big, scm_i_ushort2big, scm_i_int2big,
scm_i_uint2big, scm_i_long2big, scm_i_ulong2big, scm_i_bits2big,
scm_i_ubits2big, scm_i_size2big, scm_i_ptrdiff2big,
scm_i_long_long2big, scm_i_ulong_long2big, scm_i_dbl2big,
scm_i_big2dbl, scm_short2num, scm_ushort2num, scm_int2num,
scm_uint2num, scm_bits2num, scm_ubits2num, scm_size2num,
scm_ptrdiff2num, scm_num2short, scm_num2ushort, scm_num2int,
scm_num2uint, scm_num2bits, scm_num2ubits, scm_num2ptrdiff,
scm_num2size): new functions.

* modules.c (scm_module_reverse_lookup): i, n: int -> scm_bits_t.x

* load.c: change int -> size_t in various places (where the
variable is used to store a string length).
(search-path): call scm_done_free, not scm_done_malloc.

* list.c (scm_ilength): return a scm_bits_t, not long.
some other {int,long} -> scm_bits_t changes.

* hashtab.c: various [u]int -> scm_bits_t changes.
scm_ihashx_closure -> scm_ihashx_closure_t (and made a typedef).
(scm_ihashx): n: uint -> scm_bits_t
use scm_bits2num instead of scm_ulong2num.

* gsubr.c: various int -> scm_bits_t changes.

* gh_data.c (gh_scm2double): no loss of precision any more.

* gh.h (gh_str2scm): len: int -> size_t
(gh_{get,set}_substr): start: int -> scm_bits_t,
len: int -> size_t
(gh_<num>2scm): n: int -> scm_bits_t
(gh_*vector_length): return scm_[u]size_t, not unsigned long.
(gh_length): return scm_bits_t, not unsigned long.

* fports.h: type renaming:
scm_fport -> scm_fport_t
the old name is deprecated, all in-Guile uses changed.

* fports.c (fport_fill_input): count: int -> scm_bits_t
(fport_flush): init_size, remaining, count: int -> scm_bits_t

* debug.h (scm_lookup_cstr, scm_lookup_soft, scm_evstr): removed
those prototypes, as the functions they prototype don't exist.

* fports.c (default_buffer_size): int -> size_t
(scm_fport_buffer_add): read_size, write_size: int -> scm_bits_t
default_size: int -> size_t
(scm_setvbuf): csize: int -> scm_bits_t

* fluids.c (n_fluids): int -> scm_bits_t
(grow_fluids): old_length, i: int -> scm_bits_t
(next_fluid_num, scm_fluid_ref, scm_fluid_set_x): n: int ->
scm_bits_t
(scm_c_with_fluids): flen, vlen: int -> scm_bits_t

* filesys.c (s_scm_open_fdes): changed calls to SCM_NUM2LONG to
the new and shiny SCM_NUM2INT.

* extensions.c: extension -> extension_t (and made a typedef).

* eval.h (SCM_IFRAME): cast to scm_bits_t, not int.  just so
there are no nasty surprises if/when the various deeply magic tag
bits move somewhere else.

* eval.c: changed the locals used to store results of SCM_IFRAME,
scm_ilength and such to be of type scm_bits_t (and not int/long).
(iqq): depth, edepth: int -> scm_bits_t
(scm_eval_stack): int -> scm_bits_t
(SCM_CEVAL): various vars are not scm_bits_t instead of int.
(check_map_args, scm_map, scm_for_each): len: long -> scm_bits_t
i: int -> scm_bits_t

* environments.c: changed the many calls to scm_ulong2num to
scm_ubits2num.
(import_environment_fold): proc_as_ul: ulong -> scm_ubits_t

* dynwind.c (scm_dowinds): delta: long -> scm_bits_t

* debug.h: type renaming:
scm_debug_info -> scm_debug_info_t
scm_debug_frame -> scm_debug_frame_t
the old names are deprecated, all in-Guile uses changed.
(scm_debug_eframe_size): int -> scm_bits_t

* debug.c (scm_init_debug): use scm_c_define instead of the
deprecated scm_define.

* continuations.h: type renaming:
scm_contregs -> scm_contregs_t
the old name is deprecated, all in-Guile uses changed.
(scm_contregs_t.num_stack_items): size_t -> scm_bits_t
(scm_contregs_t.num_stack_items): ulong -> scm_ubits_t

* continuations.c (scm_make_continuation): change the type of
stack_size form long to scm_bits_t.

* ports.h: type renaming:
scm_port_rw_active -> scm_port_rw_active_t (and made a typedef)
scm_port -> scm_port_t
scm_ptob_descriptor -> scm_ptob_descriptor_t
the old names are deprecated, all in-Guile uses changed.
(scm_port_t.entry): int -> scm_bits_t.
(scm_port_t.line_number): int -> long.
(scm_port_t.putback_buf_size): int -> size_t.

* __scm.h (long_long, ulong_long): deprecated (they pollute the
global namespace and have little value besides that).
(SCM_BITS_LENGTH): new, is the bit size of scm_bits_t (i.e. of an
SCM handle).
(ifdef spaghetti): include sys/types.h and sys/stdtypes.h, if they
exist (for size_t & ptrdiff_t)
(scm_sizet): deprecated.

* Makefile.am (noinst_HEADERS): add num2integral.i.c
2001-05-24 00:50:51 +00:00
Rob Browning
60a54e2fca *** empty log message *** 2001-05-23 17:00:53 +00:00
Rob Browning
5e1fb41f97 * srfi-19.scm (:optional): renamed to optional to avoid reader
keywords conflict.  Time passes... Removed :optional altogether
and just handle optional args directly.  Thanks to Matthias Koeppe
for the report of this and the two bits below.
(priv:decode-julian-day-number): add inexact->exact for truncate
result.
(time-utc->date): add inexact->exact and floor so quotient will
work.
2001-05-23 17:00:22 +00:00
Rob Browning
b9309d1665 * srfi-19.scm (:optional): renamed to optional to avoid reader
keywords conflict.  Thanks to Matthias Koeppe for the report.
2001-05-23 15:24:41 +00:00
Martin Grabmüller
1b2f40b9f1 * README: Update, document available SRFIs.
* srfi-19.scm, srfi-17.scm, srfi-16.scm, srfi-14.scm, srfi-13.scm,
	srfi-11.scm, srfi-10.scm, srfi-9.scm, srfi-8.scm, srfi-6.scm,
	srfi-2.scm: Use `cond-expand-provide' for providing features to
	`cond-expand'.
2001-05-23 05:04:55 +00:00
Rob Browning
d579d1652d *** empty log message *** 2001-05-22 23:26:36 +00:00
Marius Vollmer
2fc933fe89 *** empty log message *** 2001-05-20 00:36:40 +00:00
Marius Vollmer
5d98055804 (scm_c_init_srfi_14): Added "int" to declaration of
`initialized'.
2001-05-20 00:33:12 +00:00
Marius Vollmer
de208a7462 Fix typos. 2001-05-19 00:19:43 +00:00
Marius Vollmer
7c628196fd *** empty log message *** 2001-05-19 00:19:42 +00:00
Marius Vollmer
94451729e0 Avoid using module operations from C.
* srfi-13.c (scm_init_srfi_13_14): Removed.
* srfi-14.h, srfi-14.c (scm_c_init_srfi_14): New.  Contains
initializations needed by C clients of srfi-14.
(scm_init_srfi_13, scm_init_srfi_14): Call it.
* srfi-13.scm: Call "scm_init_srf_13" instead of
"scm_init_srfi_13_14".
* srfi-14.scm: Call "scm_init_srf_14" instead of
"scm_init_srfi_13_14".
2001-05-19 00:17:05 +00:00
Rob Browning
5a1920ded2 * srfi-19.scm (priv:integer-reader-exact): minor cleanups. 2001-05-17 04:54:59 +00:00
Martin Grabmüller
6851c8a446 * Makefile.am (srfi_DATA): Added srfi-16.scm.
* srfi-16.scm: New file.
2001-05-14 19:07:51 +00:00
Martin Grabmüller
163a7e0d02 * srfi-13.c (scm_string_delete): Logic was inversed for charset.
Fixed.
2001-05-10 13:53:28 +00:00
Martin Grabmüller
2abe254dac * srfi-13.c (scm_string_copyS): Fixed nasty bug. 2001-05-07 22:27:29 +00:00
Rob Browning
2b60bc955f *** empty log message *** 2001-05-06 03:33:46 +00:00
Rob Browning
a19422d7bf * Makefile.am (srfi_DATA): added srfi-19.scm. 2001-05-06 03:33:02 +00:00
Rob Browning
5bbfe8cbf1 * srfi-19.scm: New file - time/date SRFI. Thanks to Will Fitzgerald. 2001-05-06 03:31:19 +00:00
Martin Grabmüller
2d953700f6 * srfi-14.c, srfi-13.c: Added @bullet to various @itemize lists.
* srfi-10.scm: Typo fix.
2001-05-02 21:47:36 +00:00
Rob Browning
109c463fdd * srfi-11.scm (let-values): fix (a b c . d) case. Thanks Martin. 2001-05-02 21:15:57 +00:00
Martin Grabmüller
e1633bf39b * Makefile.am (srfi_DATA): Added srfi-10.scm and srfi-17.scm.
* srfi-10.scm: New file.

	* srfi-17.scm: New file, contributed by Matthias Koeppe.  Thanks a
	lot!
	Added `Commentary:' tag.

	* srfi-9.scm: Added `Commentary:' tag.
2001-05-02 13:13:35 +00:00
Rob Browning
a0f979acdb *** empty log message *** 2001-04-27 21:10:57 +00:00
Rob Browning
53aef014da * srfi-13.h
(scm_reverse_string_concatenate): renamed to
	scm_string_concatentate_reverse.
	(scm_reverse_string_concatenate_shared): renamed to
	scm_string_concatenate_reverse_shared.
2001-04-27 21:10:46 +00:00
Gary Houston
485efc12b7 * srfi-13.c (scm_init_srfi_13), srfi-14.c (scm_init_srfi_14):
add "srfi/" to lines including .x files so they can be found
	when build_dir != src_dir.
2001-04-27 18:16:09 +00:00
Martin Grabmüller
a6fd89a497 * Makefile.am (srfi_DATA): Added srfi-9.scm.
* srfi-9.scm: New file.  Exports `define-record-type'.
2001-04-27 05:47:58 +00:00
Rob Browning
95f1d86163 * Makefile.am (srfi_DATA): added srfi-6.scm.
(srfi_DATA): added srfi-11.scm.
	(srfi_DATA): added srfi-8.scm.
	(srfi_DATA): added srfi-2.scm.
2001-04-26 20:24:38 +00:00
Rob Browning
b9c6d7a5dc *** empty log message *** 2001-04-26 20:24:15 +00:00
Rob Browning
818b6dda19 * srfi-8.scm: new file - exports receive. 2001-04-26 20:23:39 +00:00
Rob Browning
cc790d32f7 * srfi-6.scm: new file - guile already has srfi-6 procedures
loaded by default, so this is a dummy file right now.
2001-04-26 20:23:19 +00:00
Rob Browning
3bd84b2d52 * srfi-2.scm: new file - just use/export (ice-9 and-let-star) 2001-04-26 20:22:58 +00:00
Rob Browning
69dab98bdb * srfi-11.scm: new file - exports let-values and let*-values. 2001-04-26 20:22:28 +00:00
Martin Grabmüller
8dddb4bc9f Changed two procedure names to match final SRFI document. Thanks
to Rob Browning for spotting this.

	* srfi-13.scm (string-concatenate-reverse),
	(string-concatenate-reverse/shared): Rename from
	reverse-string-concatenate[/shared].

	* srfi-13.c (scm_string_concatenate_reverse_shared): Renamed from
	scm_reverse_string_concatenate_shared.
	(scm_string_concatenate_reverse): Renamed from
	scm_reverse_string_concatenate.
2001-04-26 19:54:48 +00:00
Martin Grabmüller
1f7a1dc98c * configure.in: Don't treat srfi directory specially, just create
the Makefile there (thanks to Neil Jerram for the patch).

	* configure.in, autogen.sh: Removed.
2001-04-25 14:35:34 +00:00
Martin Grabmüller
653c729127 * srfi-13.c (scm_string_replace): Take sizeof (char) into account
when using memmove().

	* srfi-14.h: Added prototypes for all exported procedures..

	* srfi-13.c: Include srfi-13.h

	* srfi-13.h: New file containing the prototypes.

	* Makefile.am: Removed guile-srfi.texi and info_TEXINFOS variable.
	(libguile_srfi_srfi_13_14_la_SOURCES): Added srfi-14.h, so it gets
	distributed.
	(libguile_srfi_srfi_13_14_la_SOURCES): Added srfi-13.h.
2001-04-25 14:28:11 +00:00
Neil Jerram
30f3282076 * Makefile.am: Fixed "srf-14.x" typo. 2001-04-24 22:15:58 +00:00
Martin Grabmüller
fafb71de8c * guile-srfi.texi: Removed, because merged with the GRM.
* guile-srfi.texi: The docs are now up to date with the
	implementation and have new introductory material.
2001-04-24 19:38:13 +00:00
Martin Grabmüller
ca003b26ce Integrated the guile-srfi package into the Guile distribution. 2001-04-23 20:21:01 +00:00