Changeset 5139 in project for lexmod/lexmod.scm


Ignore:
Timestamp:
07/17/07 18:02:56 (13 years ago)
Author:
Kon Lovett
Message:

Added structures like functionality.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • lexmod/lexmod.scm

    r2659 r5139  
    55;;; lexmod distribution.
    66
     7#;
    78(define-syntax lexmod
    89  (syntax-rules (export)
     
    2223                            '?name
    2324                            x))))))))
     25
     26(define-syntax lexmod
     27  (syntax-rules (export)
     28    ((_ ?name (export ?exported ...) ?defn ...)
     29     (let ((*defined* (make-hash-table eq?)))
     30       ?defn ...
     31       (lexmod:expand-exports *defined* ?exported ...)
     32       (lambda (x)
     33         (cond ((symbol? x)
     34                (hash-table-ref *defined* x
     35                  (lambda () (error '?name "unknown name in lexmod" x))))
     36               ((eq? x lexmod:get-defined-tag) *defined*)
     37               ((eq? x lexmod:get-modname-tag) '?name)
     38               (else (error '?name "invalid lexmod argument" x))))))))
    2439
    2540;;; Commented out is the hack to surround each subform in a LET.
     
    199214       ...
    200215       new))))
     216
     217(define-syntax define-interface
     218  (syntax-rules ()
     219    ((_ ?name ?symbol ...)
     220     (define ?name (interface ?symbol ...)))))
    201221
    202222(define-syntax lexmod:syntax-gentemps
Note: See TracChangeset for help on using the changeset viewer.