Compare commits
1 Commits
4c53946f1f
...
65964f2aa0
| Author | SHA1 | Date | |
|---|---|---|---|
| 65964f2aa0 |
10
Makefile
10
Makefile
@@ -1,10 +1,9 @@
|
||||
CHICKEN_C = csc
|
||||
CSC_FLAGS += -K prefix -static
|
||||
CSC_FLAGS += -K prefix
|
||||
|
||||
# Order matters, since module check correctness on compilation
|
||||
# Order matters
|
||||
MODULES = utils macros reader module-system semen sex-fmt-c fmt-c-writer sexc
|
||||
OBJ = $(MODULES:%=%.o)
|
||||
IMPORTS = $(MODULES:%=%.import.scm)
|
||||
|
||||
sexc: $(OBJ) main.o
|
||||
$(CHICKEN_C) $(CSC_FLAGS) $^ -o $@
|
||||
@@ -12,14 +11,9 @@ sexc: $(OBJ) main.o
|
||||
main.o: main.scm
|
||||
$(CHICKEN_C) $(CSC_FLAGS) $< -c -o $@
|
||||
|
||||
module-system.o: module-system.scm reader.import.scm
|
||||
$(CHICKEN_C) $(CSC_FLAGS) module-system.scm -e -c -J -o module-system.o -unit module-system -uses macros -uses utils
|
||||
|
||||
%.import.scm: %.o %.scm
|
||||
%.o: %.scm
|
||||
$(CHICKEN_C) $(CSC_FLAGS) $< -e -c -J -o $@ -unit $(@:%.o=%)
|
||||
|
||||
|
||||
sex-tests: $(OBJ) tests/*.scm
|
||||
cd ./tests && $(CHICKEN_C) $(CSC_FLAGS) run.scm -c -o sex-tests.o
|
||||
$(CHICKEN_C) $(CSC_FLAGS) $(OBJ) ./tests/sex-tests.o -o sex-tests
|
||||
|
||||
20
semen.scm
20
semen.scm
@@ -147,23 +147,23 @@
|
||||
expanded
|
||||
fn-walker
|
||||
(begin
|
||||
(set! (hash-table-ref env :fn-name) (sex-fn-name expanded))
|
||||
(set! (hash-table-ref env :lambda-counter) 0)
|
||||
(set! (hash-table-ref env :lambda-aux-code) (list))
|
||||
(set! (hash-table-ref env #:fn-name) (sex-fn-name expanded))
|
||||
(set! (hash-table-ref env #:lambda-counter) 0)
|
||||
(set! (hash-table-ref env #:lambda-aux-code) (list))
|
||||
env))))
|
||||
|
||||
(cons processed
|
||||
(append (hash-table-ref env :lambda-aux-code) acc))))
|
||||
(append (hash-table-ref env #:lambda-aux-code) acc))))
|
||||
|
||||
(define (fn-walker form env)
|
||||
(if (eq? 'lambda (car form))
|
||||
(let ((lambda-name (make-lambda-name (hash-table-ref env :fn-name)
|
||||
(hash-table-ref env :lambda-counter))))
|
||||
(set! (hash-table-ref env :lambda-aux-code)
|
||||
(let ((lambda-name (make-lambda-name (hash-table-ref env #:fn-name)
|
||||
(hash-table-ref env #:lambda-counter))))
|
||||
(set! (hash-table-ref env #:lambda-aux-code)
|
||||
(append (make-aux-lambda-struct lambda-name form)
|
||||
(hash-table-ref env :lambda-aux-code)))
|
||||
(set! (hash-table-ref env :lambda-counter)
|
||||
(+ (hash-table-ref env :lambda-counter) 1))
|
||||
(hash-table-ref env #:lambda-aux-code)))
|
||||
(set! (hash-table-ref env #:lambda-counter)
|
||||
(+ (hash-table-ref env #:lambda-counter) 1))
|
||||
lambda-name)
|
||||
form))
|
||||
|
||||
|
||||
Reference in New Issue
Block a user