proc args to conform with the srfi. (Thanks to Alex Shinn.)
* srfi-13.c (string-map): Swapped order of string and proc args to
conform with the srfi. (Thanks to Alex Shinn.)
internal definitions.
(list-tabulate, iota): check for bad arguments that otherwise
give weird output.
(filter): check for proper list, to avoid infinite recursion on
a circular list.
accounting for the (char-set-union cs2...) in the spec. i.e.,
(char-set-diff+intersection a) -> copy-of-a, empty-set
and the following are equivalent:
(char-set-diff+intersection a (char-set #\a) (char-set #\b))
(char-set-diff+intersection a (char-set #\a #\b))
(scm_char_set_xor_x): disabled the side-effecting code, since it
gives inconsistent results to scm_char_set_xor for the case
(char-set-xor! a a a).
(scm_char_set_diff_plus_intersection_x): added cs2 argument, since
two arguments are compulsory in final spec. also similar changes
as for scm_char_set_diff_plus_intersection.
* srfi-14.h (scm_char_set_diff_plus_intersection_x): added cs2.
they occur in exactly one argument, but were included if they
occured an odd number of times >= 3, e.g, in (char-set-xor a a a)
where a is (char-set #\a). fix it with a "mask" array.
side. Bit sets were handled wrong because I couldn't tell bit
counts from byte counts. Also, the bit array should be 256 / 8
bytes long. Thank you, Gary!
Removed unnecessary protoype for scm_char_set_copy.
* srfi-14.c (scm_char_set_ref, scm_char_set_cursor_next,
scm_end_of_char_set_p): reject negative cursor values.
(scm_list_to_char_set, scm_list_to_char_set_x): when reporting
type error in list component, omit the position (was always 1).
calculating based on garbage.
(scm_char_set_eq, scm_char_set_leq): fix argument number in error
reporting: wasn't incremented due to macro coding.
(scm_char_set): report argument number in error reporting: was
hard coded to 1. remove a couple of local variables.
return #t instead of giving wrong-number-of-arguments . take a
single "rest" argument. use memcmp instead of a loop to compare
the values.
srfi-14.h: update the declaration.
delete!, assoc): don't export until the new bindings have been
created. otherwise "export" thinks they are being re-exported and
a deprecation warning is produced.
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.
(delete-duplicates): Now the first occurrence of an element is
retained, as required.
(member, assoc): Fixed wrong order of equality predicate
application.