mirror of
https://github.com/justinethier/cyclone.git
synced 2025-05-23 20:15: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
|
||||
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?
|
||||
(define (prim:arg-count? exp)
|
||||
(and (prim? exp)
|
||||
|
@ -845,7 +850,10 @@
|
|||
(car (c:allocs c-fun))
|
||||
(if (prim/c-var-assign fun)
|
||||
;; 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*) ");"))))
|
||||
;; Args stay with body
|
||||
|
|
Loading…
Add table
Reference in a new issue