Skip to content

Commit

Permalink
fixed bug in arg-names, fixed bug in des-arg
Browse files Browse the repository at this point in the history
  • Loading branch information
stefano committed Sep 2, 2009
1 parent 7c4d669 commit b7b5ca4
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions compiler/comp.arc
Expand Up @@ -314,7 +314,7 @@
(def arg-names (args)
; consider destructuring too
; don't count optionals (o ...) 'o symbol and init expression
(if (isa args 'sym)
(if (and args (isa args 'sym))
(list args)
(flat (map [if (is-opt _) (cadr _) _] (makeproper args)))))

Expand Down Expand Up @@ -418,7 +418,7 @@
(mk-arg name p-name expr 'dest))

(def assign-str (pos gs)
(string pos "(" gs ")"))
(string "'" pos "'(" gs ")"))

(def des-arg (a gs pos)
(if
Expand Down Expand Up @@ -496,6 +496,8 @@
dest (if has-val
(do
(compile-expr cs val nil)
(prn ".local pmc " (arg-p-name a))
(prn (arg-p-name a) " = " (c-pop cs))
(emit-arg-dest a))
(err "Wrong number of arg passed"))
rest (if has-val
Expand Down

0 comments on commit b7b5ca4

Please sign in to comment.