mirror of
https://github.com/justinethier/cyclone.git
synced 2025-07-07 05:06:36 +02:00
Issue #3 - Allow compiling a pure varargs lambda
This commit is contained in:
parent
4b7707e898
commit
17ce827d8e
1 changed files with 17 additions and 12 deletions
|
@ -982,18 +982,23 @@
|
||||||
|
|
||||||
; c-compile-formals : list[symbol] -> string
|
; c-compile-formals : list[symbol] -> string
|
||||||
(define (c-compile-formals formals type)
|
(define (c-compile-formals formals type)
|
||||||
(if (not (pair? formals))
|
(cond
|
||||||
""
|
((and (not (pair? formals))
|
||||||
(string-append
|
(equal? type 'args:varargs))
|
||||||
"object "
|
(string-append "object " (mangle formals) "_raw, ..."))
|
||||||
(mangle (car formals))
|
((not (pair? formals))
|
||||||
(cond
|
"")
|
||||||
((pair? (cdr formals))
|
(else
|
||||||
(string-append ", " (c-compile-formals (cdr formals) type)))
|
(string-append
|
||||||
((not (equal? 'args:fixed type))
|
"object "
|
||||||
(string-append ", object " (mangle (cdr formals)) "_raw, ..."))
|
(mangle (car formals))
|
||||||
(else
|
(cond
|
||||||
"")))))
|
((pair? (cdr formals))
|
||||||
|
(string-append ", " (c-compile-formals (cdr formals) type)))
|
||||||
|
((not (equal? 'args:fixed type))
|
||||||
|
(string-append ", object " (mangle (cdr formals)) "_raw, ..."))
|
||||||
|
(else
|
||||||
|
""))))))
|
||||||
|
|
||||||
; c-compile-lambda : lamda-exp (string -> void) -> (string -> string)
|
; c-compile-lambda : lamda-exp (string -> void) -> (string -> string)
|
||||||
(define (c-compile-lambda exp trace)
|
(define (c-compile-lambda exp trace)
|
||||||
|
|
Loading…
Add table
Reference in a new issue