forked from alex-eg/sex
support cpp define
This commit is contained in:
@@ -7,15 +7,17 @@
|
|||||||
|
|
||||||
(chicken-load "list.seh")
|
(chicken-load "list.seh")
|
||||||
|
|
||||||
(define (imports-test a b c)
|
(chicken-define (imports-test a b c)
|
||||||
(fold + 0 (list 1 2 3 a b c)))
|
(fold + 0 (list 1 2 3 a b c)))
|
||||||
|
|
||||||
(struct foo
|
(struct foo
|
||||||
((float a)
|
((float a-field)
|
||||||
(int b)
|
(int b)
|
||||||
((const char *) c)
|
((const char *) c)
|
||||||
((fn bool ((bool val))) not)))
|
((fn bool ((bool val))) not)))
|
||||||
|
|
||||||
|
(var foo f #((= .a-field 1.2)))
|
||||||
|
|
||||||
,(list-T '(int))
|
,(list-T '(int))
|
||||||
,(make-list-T '(int) #f)
|
,(make-list-T '(int) #f)
|
||||||
,(add-value-list-T '(int) #f)
|
,(add-value-list-T '(int) #f)
|
||||||
|
|||||||
3
sexc.scm
3
sexc.scm
@@ -32,6 +32,7 @@
|
|||||||
((prototype) '%prototype)
|
((prototype) '%prototype)
|
||||||
((var) '%var)
|
((var) '%var)
|
||||||
((begin) '%begin)
|
((begin) '%begin)
|
||||||
|
((define) '%define)
|
||||||
((pointer) '%pointer)
|
((pointer) '%pointer)
|
||||||
((array) '%array)
|
((array) '%array)
|
||||||
((@) 'vector-ref)
|
((@) 'vector-ref)
|
||||||
@@ -140,7 +141,7 @@
|
|||||||
|
|
||||||
(define (process-form form acc)
|
(define (process-form form acc)
|
||||||
(case (car form)
|
(case (car form)
|
||||||
((chicken-define) (eval form) acc)
|
((chicken-define) (eval (cons 'define (cdr form))) acc)
|
||||||
((template) (eval form) acc)
|
((template) (eval form) acc)
|
||||||
((chicken-load)
|
((chicken-load)
|
||||||
(load (cadr form)) acc)
|
(load (cadr form)) acc)
|
||||||
|
|||||||
Reference in New Issue
Block a user