mirror of
https://github.com/justinethier/cyclone.git
synced 2025-07-14 08:17:35 +02:00
WIP
This commit is contained in:
parent
709a13808d
commit
ff4e8bf3b9
4 changed files with 17 additions and 3 deletions
4
Makefile
4
Makefile
|
@ -24,6 +24,8 @@ SMODULES = \
|
|||
scheme/read \
|
||||
scheme/time \
|
||||
scheme/write \
|
||||
scheme/cyclone/ast \
|
||||
scheme/cyclone/optimize-cps \
|
||||
scheme/cyclone/cgen \
|
||||
scheme/cyclone/common \
|
||||
scheme/cyclone/libraries \
|
||||
|
@ -101,6 +103,8 @@ bootstrap: icyc
|
|||
cp scheme/cyclone/common.c $(BOOTSTRAP_DIR)/scheme/cyclone
|
||||
cp icyc.scm $(BOOTSTRAP_DIR)
|
||||
cp tests/unit-tests.scm $(BOOTSTRAP_DIR)
|
||||
cp scheme/cyclone/ast.c $(BOOTSTRAP_DIR)/scheme/cyclone
|
||||
cp scheme/cyclone/optimize-cps.c $(BOOTSTRAP_DIR)/scheme/cyclone
|
||||
cp scheme/cyclone/libraries.c $(BOOTSTRAP_DIR)/scheme/cyclone
|
||||
cp scheme/cyclone/macros.c $(BOOTSTRAP_DIR)/scheme/cyclone
|
||||
cp scheme/cyclone/pretty-print.c $(BOOTSTRAP_DIR)/scheme/cyclone
|
||||
|
|
|
@ -9,7 +9,9 @@
|
|||
|
||||
(define-library (ast)
|
||||
;(define-library (scheme cyclone ast)
|
||||
(import (scheme base))
|
||||
(import (scheme base)
|
||||
(scheme cyclone util)
|
||||
)
|
||||
(export
|
||||
ast:make-lambda
|
||||
ast:lambda?
|
||||
|
@ -20,10 +22,14 @@
|
|||
ast:se-lambda-body!
|
||||
)
|
||||
(begin
|
||||
(define *lambda-id* 0)
|
||||
(define-record-type <lambda-ast>
|
||||
(ast:make-lambda id args body)
|
||||
(ast:%make-lambda id args body)
|
||||
ast:lambda?
|
||||
(id ast:lambda-id)
|
||||
(args ast:lambda-args ast:set-lambda-args!)
|
||||
(body ast:lambda-body ast:se-lambda-body!))
|
||||
(define (ast:make-lambda args body)
|
||||
(set! *lambda-id* (+ 1 *lambda-id*))
|
||||
(ast:%make-lambda *lambda-id* args body))
|
||||
))
|
||||
|
|
|
@ -17,6 +17,9 @@
|
|||
(newline))
|
||||
|
||||
|
||||
(define l (ast:make-lambda 0 '() '((write 1) (write 2) (write 3))))
|
||||
(define l (ast:make-lambda '() '((write 1) (write 2) (write 3))))
|
||||
(write l)
|
||||
(newline)
|
||||
(set! l (ast:make-lambda '() '((write 1) (write 2) (write 3))))
|
||||
(write `(l is now ,l))
|
||||
(newline)
|
||||
|
|
|
@ -15,6 +15,7 @@
|
|||
(scheme file)
|
||||
(scheme read)
|
||||
(scheme write)
|
||||
(scheme cyclone ast)
|
||||
(scheme cyclone common)
|
||||
(scheme cyclone libraries)
|
||||
(scheme cyclone macros)
|
||||
|
|
Loading…
Add table
Reference in a new issue