summaryrefslogtreecommitdiff
path: root/module/srfi/srfi-19.scm
Commit message (Collapse)AuthorAgeFilesLines
* SRFI-19: Rename 'tai-epoch-in-jd' to 'utc-epoch-in-jd'.Mark H Weaver2019-06-181-11/+11
| | | | | * module/srfi/srfi-19.scm: Rename 'tai-epoch-in-jd' to 'utc-epoch-in-jd', to reflect its actual meaning and usage.
* Support ~N in SRFI-19 string->dateDaniel Llorens2018-12-111-0/+22
| | | | | | | | * module/srfi/srfi-19.scm (fractional-integer-reader, make-fractional-integer-reader): From reference implementation. (reader-directives): Handle #\N, from reference implementation. * test-suite/tests/srfi-19: Add tests for string->date ~N. * doc/ref/srfi-modules.texi (string->date): Add line for ~N.
* SRFI-19: Minor refactor of leap second table lookups.Mark H Weaver2018-10-241-28/+22
| | | | | | | | | * module/srfi/srfi-19.scm (leap-second-delta): Replace with ... (utc->tai): ... this. (leap-second-neg-delta): Replace with ... (tai->utc): ... this. (current-time-tai, priv:time-tai->time-utc!, priv:time-utc->time-tai!) (time-tai->julian-day, time-monotonic->julian-day): Adapt accordingly.
* SRFI-19: time-utc->date: Support non-integer nanoseconds values.Mark H Weaver2018-10-241-1/+1
| | | | | * module/srfi/srfi-19.scm (time-utc->date): Use 'floor-remainder' instead of 'modulo'.
* SRFI-19: Check for incompatible types in time comparisons.Mark H Weaver2018-10-211-7/+12
| | | | | | | | | | | | Fixes <https://bugs.gnu.org/26163>. Reported by Zefram <zefram@fysh.org>. * module/srfi/srfi-19.scm (time-compare-check): New procedure. (time=?): Use 'time-compare-check' to check the arguments and raise an error in case of mismatched types. Previously, mismatched types would cause time=? to return #f. (time>?, time<?, time>=?, time<=?, time-difference!): Use 'time-compare-check' to check the arguments.
* SRFI-19: Fix normalization of seconds and nanoseconds in time records.Mark H Weaver2018-10-211-18/+16
| | | | | | | | Fixes <https://bugs.gnu.org/26162>. Reported by Zefram <zefram@fysh.org>. * module/srfi/srfi-19.scm (time-normalize!): Rewrite. * test-suite/tests/srfi-19.test: Add tests.
* SRFI-19: Fix handling of negative years and negative julian days.Mark H Weaver2018-10-201-27/+38
| | | | | | | | | | | | | | | | | | | | | | | Fixes <https://bugs.gnu.org/21906>. Mitigates <https://bugs.gnu.org/21903> and <https://bugs.gnu.org/21904>. Reported by: Zefram <zefram@fysh.org>. * module/srfi/srfi-19.scm (encode-julian-day-number) (decode-julian-day-number, date-week-number): Use 'floor-quotient' instead of 'quotient', and 'floor' instead of 'truncate', where appropriate. (time-utc->date): Ensure that the 'nanoseconds' field of the returned date is non-negative. (leap-year): Handle negative years properly, and reformulate the computation. (week-day): Handle negative years properly. Use 'floor-quotient' instead of 'quotient' where appropriate. (directives): In the handler for '~Y' format escapes, improve the handling of years outside of the range 0-9999. (read-directives): Add a FIXME comment to fix the '~Y' reader to handle years outside of the range 0-9999. * test-suite/tests/srfi-19.test: Import (srfi srfi-1). Use Guile's modern keyword notation in the 'define-module' form. Add more tests.
* SRFI-19: Fix TAI->UTC conversions, leap second handling, etc.Mark H Weaver2018-10-201-87/+58
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Fixes <https://bugs.gnu.org/21911>. Fixes <https://bugs.gnu.org/22034>. Fixes <https://bugs.gnu.org/21902>. Partially fixes <https://bugs.gnu.org/21904>. Reported by Zefram <zefram@fysh.org>. * doc/ref/srfi-modules.texi (SRFI-19 Introduction): Fix the definitions of Julian Day and Modified Julian Day. Give the correct full names of UTC and TAI. * module/srfi/srfi-19.scm: Import (srfi srfi-1). Use modern Guile keyword syntax in the 'define-module' form. (leap-second-neg-delta): New procedure, derived from a similar procedure in the latest upstream SRFI-19 reference implementation. (priv:time-tai->time-utc!, time-tai->julian-day) (time-monotonic->julian-day): Use 'leap-second-neg-delta'. (local-tz-offset): Fix comment. (leap-second?): Remove. (tai-before-leap-second?): New procedure, derived from upstream SRFI-19. (time-utc->date): Use 'define*' to handle the optional argument. Remove the leap second handling, following upstream SRFI-19. (time-tai->date): Rewrite in terms of 'time-utc->date'. Add special leap second handling, following upstream SRFI-19. (time-monotonic->date): Rewrite in terms of 'time-tai->date'. (date->time-tai, date->time-monotonic): Add special leap second handling, following upstream SRFI-19. (directives): In the entry for the "~Y" escape in 'date->string', pad the year field to 4 characters, following upstream SRFI-19. * test-suite/tests/srfi-19.test: Add tests.
* Fix typos, indentation and error reporting in SRFI-19.Mark H Weaver2018-10-161-91/+99
| | | | | * module/srfi/srfi-19.scm: Fix typos in comments, indentation, and pass the correct 'caller' name to 'time-error' in several places.
* Update SRFI-19 leap second table.Mark H Weaver2018-10-161-1/+2
| | | | | * module/srfi/srfi-19.scm (leap-second-table): Update to include the leap second on 1 January 2017.
* srfi-19: Remove unused procedure.Ludovic Courtès2018-07-241-19/+1
| | | | * module/srfi/srfi-19.scm (date->broken-down-time): Remove.
* SRFI-19: Swap seconds and nanoseconds in 'current-time-monotonic'.Ludovic Courtès2017-04-221-2/+2
| | | | | | * module/srfi/srfi-19.scm (current-time-monotonic): Swap the 2nd and 3rd arguments. Fixes a regression introduced in commit b11e2922c36c4105797c269c7e616535b702698a.
* Fix date->string ~f operator to not emit leading zerosAndy Wingo2017-04-191-18/+8
| | | | | | * module/srfi/srfi-19.scm (directives): Format ~f without leading zeroes. Fixes https://bugs.gnu.org/26260. * test-suite/tests/srfi-19.test ("SRFI date/time library"): Add test.
* Fixed bug: ~N mishandles small nanoseconds valueAndrew Moss2017-04-191-1/+1
| | | | | | | | | Fixes <http://bugs.gnu.org/26261>. Reported by Zefram <zefram@fysh.org>. * module/srfi/srfi-19.scm ("define directives"): N padding increased from 7 to 9 * test-suite/tests/srfi-19.test ("date->string"): New test.
* SRFI-19 current-time-monotonic returns time of right typeAndy Wingo2017-04-191-3/+6
| | | | | * module/srfi/srfi-19.scm (current-time-monotonic): Actually return a time with the correct type. Fixes #26329.
* SRFI-19: Update the table of leap seconds.Mark H Weaver2016-05-221-3/+4
| | | | | * module/srfi/srfi-19.scm (leap-second-table): Update to include the most recent leap second.
* SRFI-19: Update the table of leap seconds.Mark H Weaver2014-03-031-3/+6
| | | | | * module/srfi/srfi-19.scm (leap-second-table): Update to include the two most recent leap seconds.
* ISO 8601 time format specifies zero padding for hours, not blank padding.Ian Price2012-08-271-4/+4
| | | | | * doc/ref/srfi-modules.texi ("SRFI-19 Date to string"): Fix iso 8601 format strings. * module/srfi/srfi-19.scm (directives): Fix iso 8601 format strings.
* srfi-19 refactorAndy Wingo2011-08-041-263/+259
| | | | | | | | * module/srfi/srfi-19.scm (priv:locale-number-separator, priv:locale-am) (priv:locale-am): Inline definitions. Strip priv: prefix from module vars, as it's unnecessary, except for in a couple cases.
* recommend #:replaceAndy Wingo2010-07-171-1/+1
| | | | | | * doc/ref/api-modules.texi (Creating Guile Modules): Update text to recommend #:replace. * module/srfi/srfi-19.scm (current-time): #:replace.
* Fix SRFI-19 exports.Ludovic Courtès2010-01-111-11/+6
| | | | | | * module/srfi/srfi-19.scm: Export `time-monotonic->julian-day' and `time-monotonic->modified-julian-day'. Remove obscure `current-time' hack. Use `(define-module :export ...)' instead of `(export ...)'.
* Remove unused top-level variables.Ludovic Courtès2010-01-111-3/+0
| | | | | | | | | | | | | | | | | | | | | | | * module/ice-9/runq.scm (fork-strips): Remove. * module/language/assembly.scm (*block-alignment*): Remove. * module/language/assembly/disassemble.scm (disassemble-objects, simplify): Remove. * module/srfi/srfi-18.scm (mutex-owners): Remove. * module/srfi/srfi-19.scm (leap-year?): Remove. * module/system/base/compile.scm (dsu-sort): Remove. * module/texinfo.scm (ascii->char): Remove. * module/texinfo/html.scm (ignored?): Remove. * module/texinfo/indexing.scm (def-name): Remove. * module/texinfo/plain-text.scm (ignore): Remove.
* Fix typos leading to wrong argument counts.Ludovic Courtès2009-11-071-1/+1
| | | | | | | | | | | * module/ice-9/channel.scm (eval): Fix number of arguments to `guile:eval'. * module/oop/goops/save.scm (write-readably): Fix number of arguments to `write-array'. * module/srfi/srfi-19.scm (priv:char->int): Fix number of arguments to `priv:time-error'.
* Fix typos leading to unbound variable references.Ludovic Courtès2009-10-221-12/+21
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | * module/ice-9/session.scm (help): Fix unbound reference to `env'. * module/system/vm/program.scm (program-property): Fix typo. * module/system/vm/frame.scm: Add missing `#:use-module (system vm objcode)'. * module/system/repl/command.scm (guile:load): New. (load): Use either `primitive-load' or `load'. * module/srfi/srfi-18.scm (thread-sleep!): Fix typo. * module/srfi/srfi-19.scm: Use `(ice-9 rdelim)'. (date->broken-down-time, priv:year-day, priv:char->int): Fix typo. (time-*->time-*, time-*->time-*!): Fix reference to unbound variable `caller'. * module/oop/goops.scm (bound-check-get): Fix typo. * module/language/glil/compile-assembly.scm (glil->assembly): Fix typo. * module/language/glil.scm (parse-glil): Fix typo. * module/language/ecmascript/base.scm (object->value/string, object->value/number, ->number): Fix typos. * module/language/assembly/disassemble.scm (disassemble-free-vars): Fix typo.
* Remove unused variables in ice-9/goops/srfi/scripts.Ludovic Courtès2009-09-211-3/+1
| | | | | | | | | | | | | | | | | | | | * module/ice-9/boot-9.scm (scm-style-repl)[-abort]: Remove. * module/oop/goops.scm (class)[slot-defs]: Remove. (compute-slot-accessors)[name]: Remove. (compute-get-n-set)[env]: Remove. * module/oop/goops/active-slot.scm (compute-get-n-set)[env, name]: Remove. * module/oop/goops/dispatch.scm (cache-try-hash!)[max-misses]: Remove. * module/oop/goops/save.scm (make-mapper)[dims]: Remove. * module/scripts/autofrisk.scm (>>checks)[prog]: Remove. * module/srfi/srfi-19.scm (priv:read-directives)[ireaderf, eireader4]: Remove.
* Complete changing license to LGPLv3+Neil Jerram2009-06-171-1/+1
| | | | (Still guile-readline to do, but that will all be GPLv3+.)
* fix mismerge on srfi-19.scmAndy Wingo2009-01-121-2/+2
| | | | | * module/srfi/srfi-19.scm (priv:locale-abbr-weekday->index): Whoops, fix broken manual merge on srfi-19.scm.
* Merge commit 'origin/master' into vmAndy Wingo2009-01-121-1/+1
| | | | | | | | Conflicts: .gitignore guile-tools.in srfi/srfi-19.scm
* avoid delivering 0 values to 1-valued continuations in srfi-19Andy Wingo2008-11-011-16/+11
| | | | | | | | | | | | * module/srfi/srfi-19.scm: Some parts of this code used a strange idiom, `(values)', to indicate that a procedure did nothing. However, quoth R5RS: Except for continuations created by the `call-with-values' procedure, all continuations take exactly one value. Indeed the VM indicated this error. I reworked the code to avoid these cases.
* move scm srfi files to module/srfi, and compile them.Andy Wingo2008-11-011-0/+1491
* .gitignore: Add gdb-pre-inst-guile. * configure.in: Add module/srfi/Makefile. * module/Makefile.am: Add srfi/. * module/srfi/: SRFI scheme files moved here, and compiled. * srfi/Makefile.am: Remove the bits about the scheme files.