Changeset 37234 in project


Ignore:
Timestamp:
02/13/19 18:18:23 (17 months ago)
Author:
Kon Lovett
Message:

remove unused "generic" flonum-integer handling, reflow

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

Legend:

Unmodified
Added
Removed
  • release/4/srfi-19/trunk/srfi-19-common.scm

    r34327 r37234  
    2929(define-constant MN/YR 12)  ;months per year
    3030
    31 ;;
     31;; misc-utils
    3232
    3333(define-inline (->boolean obj) (and obj #t))
     34
     35;; fx-utils
    3436
    3537(define-inline (fxabs x) (if (fx< x 0) (fxneg x) x))
    3638
    3739(define-inline (fxzero? x) (fx= 0 x))
    38 
    39 ;; For storage savings since some aritmetic routines do not
    40 ;; return fixnums when possible.
    41 
    42 ;; ##sys#integer?
    43 ;; returns #t for integer fixnum or flonum
    44 
    45 ;; *double->number
    46 ;; returns a fixnum for the flonum x iff x isa integer in fixnum-range
    47 ;; otherwise the flonum x
    48 
    49 ;; When domain is integer and range is fixnum
    50 ;; Number MUST be a fixnum or flonum
    51 
    52 (define-inline (*double->number n)
    53   (assert (flonum? n) "not a flonum" n)
    54   (##core#inline "C_double_to_number" n) )
    55 
    56 (define-inline (gennum->fixnum x)
    57   ;(if (or (> x 1073741823) (< x -1073741824)) (print "*** Beyond 31 bits: " x " : " (flonum? x)))
    58   (if (fixnum? x) x (*double->number x)) )
    59 
    60 ;; When domain is integer and range is flonum-integer
    61 ;; Conversion attemped only when number is a fixnum or flonum-integer
    62 ;; Others returned
    63 
    64 (define-inline (genint->fixnum x)
    65   (if (##sys#integer? x) (gennum->fixnum x) x) )
  • release/4/srfi-19/trunk/srfi-19-date.scm

    r35736 r37234  
    159159  (er-macro-transformer
    160160    (lambda (frm r cmp)
    161       (let ((_date-adjuster-set! (r 'date-adjuster-set!))
    162             (_begin (r 'begin)) )
     161      (let (
     162        (_date-adjuster-set! (r 'date-adjuster-set!))
     163        (_begin (r 'begin)) )
    163164        `(,_begin
    164165          ,@(let loop ((args (cdr frm)) (ls '()))
    165166              (if (null? args)
    166167                ls
    167                 (let ((?key (car args))
    168                       (?syns (cadr args))
    169                       (?hdlr (caddr args)) )
    170                   (loop
    171                     (cdddr args)
    172                     (cons
    173                       `(,_date-adjuster-set! ',?key ',?syns ,?hdlr)
    174                       ls) ) ) ) ) ) ) ) ) )
     168                (let (
     169                  (?key (car args))
     170                  (?syns (cadr args))
     171                  (?hdlr (caddr args))
     172                  (?rest (cdddr args)) )
     173                  (loop ?rest (cons `(,_date-adjuster-set! ',?key ',?syns ,?hdlr) ls) ) ) ) ) ) ) ) ) )
     174
     175#;
     176(define-syntax date-adjuster-create
     177  (syntax-rules ()
     178    ((date-adjuster-create "aux" (?key ?syns ?hdlr) ...)
     179      (begin
     180        (date-adjuster-set! ?key ?syns ?hdlr)
     181        (date-adjuster-create ...) ) )
     182    ((date-adjuster-create ?key ?syns ?hdlr ...)
     183      (date-adjuster-create "aux" (?key ?syns ?hdlr) ...) ) ) )
    175184
    176185;;
Note: See TracChangeset for help on using the changeset viewer.