mirror of
https://github.com/justinethier/cyclone.git
synced 2025-05-24 12:35:05 +02:00
Fix for functions with cont and no args
This commit is contained in:
parent
2d68fde138
commit
4e69bfb758
1 changed files with 9 additions and 1 deletions
|
@ -674,6 +674,11 @@
|
||||||
symbol->string list->string substring string-append
|
symbol->string list->string substring string-append
|
||||||
make-vector list->vector Cyc-installation-dir))))
|
make-vector list->vector Cyc-installation-dir))))
|
||||||
|
|
||||||
|
;; Primitive functions that pass a continuation but have no other arguments
|
||||||
|
(define (prim:cont/no-args? exp)
|
||||||
|
(and (prim? exp)
|
||||||
|
(member exp '(command-line-arguments))))
|
||||||
|
|
||||||
;; Pass an integer arg count as the function's first parameter?
|
;; Pass an integer arg count as the function's first parameter?
|
||||||
(define (prim:arg-count? exp)
|
(define (prim:arg-count? exp)
|
||||||
(and (prim? exp)
|
(and (prim? exp)
|
||||||
|
@ -845,7 +850,10 @@
|
||||||
(car (c:allocs c-fun))
|
(car (c:allocs c-fun))
|
||||||
(if (prim/c-var-assign fun)
|
(if (prim/c-var-assign fun)
|
||||||
;; Add a comma if there were any args to the func added by comp-prim
|
;; Add a comma if there were any args to the func added by comp-prim
|
||||||
(if (str-ending? (car (c:allocs c-fun)) "(") "" ",")
|
(if (or (str-ending? (car (c:allocs c-fun)) "(")
|
||||||
|
(prim:cont/no-args? fun))
|
||||||
|
""
|
||||||
|
",")
|
||||||
",")
|
",")
|
||||||
(c:body c-args*) ");"))))
|
(c:body c-args*) ");"))))
|
||||||
;; Args stay with body
|
;; Args stay with body
|
||||||
|
|
Loading…
Add table
Reference in a new issue