Changeset 39373 in project


Ignore:
Timestamp:
11/24/20 03:36:27 (8 weeks ago)
Author:
Kon Lovett
Message:

C5.3 changes (record-printer & current-milliseconds)

Location:
release/5/srfi-19/trunk
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • release/5/srfi-19/trunk/srfi-19-literals.scm

    r38291 r39373  
    99  time-literal-form
    1010  read-date-literal
    11   write-date-literal
    12   ;DEPERECATED
    13   date-record-printer-format
    14   time-record-printer-format)
     11  write-date-literal)
    1512
    1613(import scheme)
    1714(import (chicken base))
     15(import utf8)
    1816(import (chicken type))
    1917(import (chicken module))
     18(import (only (chicken condition) handle-exceptions))
     19(import (only (chicken io) read-token))
     20(import (only (chicken read-syntax) define-reader-ctor))
     21(import (only (chicken format) format))
     22(import (only (chicken read-syntax) define-reader-ctor))
     23(import (only (chicken read-syntax) set-sharp-read-syntax!))
     24(import (only utf8-srfi-13 string-index))
    2025(import srfi-19-tm)
    2126(import srfi-19-core)
     27(import srfi-19-io)
     28
    2229
    2330(include "srfi-19-common")
     
    4451;;
    4552
    46 (import (only (chicken format) format))
    47 (import (only (chicken read-syntax) define-reader-ctor))
    48 (import (only (chicken read-syntax) set-sharp-read-syntax!))
    49 
    5053(define (bracket-date-literals)
    5154  ;default output form
    52   (##sys#register-record-printer *date-tag*
    53     (lambda (dat out) (date-record-formatter dat out))) )
     55  (cond-expand
     56    (chicken-5.3
     57      (set! (record-printer *date-tag*)
     58        (lambda (dat out) (date-record-formatter dat out))) )
     59    (else
     60      (##sys#register-record-printer *date-tag*
     61        (lambda (dat out) (date-record-formatter dat out))) ) ) )
    5462
    5563(define (srfi-10-date-literals)
    5664  ;srfi-10 output form
    57   (##sys#register-record-printer *date-tag*
    58     (lambda (dat out) (date-record-formatter dat out)))
     65  (cond-expand
     66    (chicken-5.3
     67      (set! (record-printer *date-tag*)
     68        (lambda (dat out) (date-record-formatter dat out))) )
     69    (else
     70      (##sys#register-record-printer *date-tag*
     71        (lambda (dat out) (date-record-formatter dat out))) ) )
    5972  ;srfi-10 input handler
    6073  (define-reader-ctor 'srfi-19-date
     
    6477(define (date-literals)
    6578  ;human legible output form
    66   (##sys#register-record-printer *date-tag*
    67     (lambda (dat out) (write-date-literal dat out)))
     79  (cond-expand
     80    (chicken-5.3
     81      (set! (record-printer *date-tag*)
     82        (lambda (dat out) (write-date-literal dat out))) )
     83    (else
     84      (##sys#register-record-printer *date-tag*
     85        (lambda (dat out) (write-date-literal dat out))) ) )
    6886  ;human legible input handler
    6987  (set-sharp-read-syntax! #\@ (cut read-date-literal <>)) )
     
    112130;; IN THE SOFTWARE.
    113131
    114 (import (only (chicken condition) handle-exceptions))
    115 (import (only (chicken io) read-token))
    116 (import (only srfi-13 string-index))
    117 (import srfi-19-io)
    118 
    119132;; Constants
    120133
     
    158171
    159172;;; Time Literal Syntax
    160 
    161 (import (only (chicken read-syntax) define-reader-ctor))
    162 (import (only (chicken format) format))
    163173
    164174(define-constant TIME-FORMAT-BRACKET "#<srfi-19#time ~S ~S ~S>")
     
    188198(define (bracket-time-literals)
    189199  ;default output form
    190   (##sys#register-record-printer *time-tag*
    191     (lambda (tim out) (time-record-formatter tim out))) )
     200  (cond-expand
     201    (chicken-5.3
     202      (set! (record-printer *time-tag*)
     203        (lambda (tim out) (time-record-formatter tim out))) )
     204    (else
     205      (##sys#register-record-printer *time-tag*
     206        (lambda (tim out) (time-record-formatter tim out))) ) ) )
    192207
    193208(define (srfi-10-time-literals)
    194209  ;srfi-10 output form
    195   (##sys#register-record-printer *time-tag*
    196     (lambda (tim out) (time-record-formatter tim out)))
     210  (cond-expand
     211    (chicken-5.3
     212      (set! (record-printer *time-tag*)
     213        (lambda (tim out) (time-record-formatter tim out))) )
     214    (else
     215      (##sys#register-record-printer *time-tag*
     216        (lambda (tim out) (time-record-formatter tim out))) ) )
    197217  ;srfi-10 input handler
    198218  (define-reader-ctor 'srfi-19-time
     
    203223(define (time-literals)
    204224  ;human legible output form
    205   (##sys#register-record-printer *time-tag*
    206     (lambda (tim out) (write-time-literal tim out)))
     225  (cond-expand
     226    (chicken-5.3
     227      (set! (record-printer *time-tag*)
     228        (lambda (tim out) (write-time-literal tim out))) )
     229    (else
     230      (##sys#register-record-printer *time-tag*
     231        (lambda (tim out) (write-time-literal tim out))) ) )
    207232  ;human legible input handler
    208233  (set-sharp-read-syntax! #\# (cut read-time-literal <>)) )
     
    221246    (tm:time-second tim)) )
    222247
    223 ;;;
    224 
    225 (: date-record-printer-format (deprecated date-literal-form))
    226 (: time-record-printer-format (deprecated time-literal-form))
    227 
    228 (define date-record-printer-format date-literal-form)
    229 (define time-record-printer-format time-literal-form)
    230 
    231248) ;module srfi-19-literals
  • release/5/srfi-19/trunk/srfi-19.egg

    r39035 r39373  
    44 (version "4.4.3")
    55 (category data)
    6  (author "Will Fitzgerald (for Chicken by [[kon lovett]])")
     6 (author "Will Fitzgerald (for CHICKEN by [[kon lovett]])")
    77 (license "BSD")
    8  (dependencies srfi-1 srfi-13 srfi-18 srfi-69 miscmacros
    9   (locale "0.8.1")
    10   (srfi-29 "3.0.0")
    11   (record-variants "1.1")
    12   (check-errors "3.1.1"))
     8 (dependencies
     9  srfi-1 utf8 srfi-18 srfi-29 srfi-69
     10  miscmacros locale record-variants check-errors)
    1311  (test-dependencies test format)
    1412 (components
Note: See TracChangeset for help on using the changeset viewer.