Changeset 14879 in project


Ignore:
Timestamp:
06/03/09 22:32:55 (10 years ago)
Author:
Jim Ursetto
Message:

srfi-37: use define-record-type; add test.scm

File:
1 edited

Legend:

Unmodified
Added
Removed
  • release/4/srfi-37/srfi-37.scm

    r14499 r14879  
    1717  (import scheme chicken data-structures)
    1818
    19 
    20 (define (option names req opt pro)
    21   (##sys#make-structure 'option names req opt pro) )
    22 
    23 (define (option-names opt)
    24   (##sys#check-structure opt 'option 'option-names)
    25   (##sys#slot opt 1) )
    26 
    27 (define (option-required-arg? opt)
    28   (##sys#check-structure opt 'option 'option-required-arg?)
    29   (##sys#slot opt 2) )
    30 
    31 (define (option-optional-arg? opt)
    32   (##sys#check-structure opt 'option 'option-optional-arg?)
    33   (##sys#slot opt 3) )
    34 
    35 (define (option-processor opt)
    36   (##sys#check-structure opt 'option 'option-processor)
    37   (##sys#slot opt 4) )
    38 
    39 (define (option? x) (##sys#structure? x 'option))
     19(define-record-type srfi-37:option
     20  (option names required-arg? optional-arg? processor)
     21  option?
     22  (names option-names)
     23  (required-arg? option-required-arg?)
     24  (optional-arg? option-optional-arg?)
     25  (processor option-processor))
    4026
    4127(define args-fold
Note: See TracChangeset for help on using the changeset viewer.