Skip to content

Commit

Permalink
fix to generator lowering
Browse files Browse the repository at this point in the history
make sure it introduces new variables
  • Loading branch information
JeffBezanson committed May 28, 2016
1 parent 3369596 commit 59bc754
Showing 1 changed file with 6 additions and 2 deletions.
8 changes: 6 additions & 2 deletions src/julia-syntax.scm
Original file line number Diff line number Diff line change
Expand Up @@ -1998,8 +1998,12 @@
(car vars)
(gensy)))
(splat (cond ((eq? argname (car vars)) '())
((length= vars 1) `((= ,(car vars) ,argname)))
(else `((= (tuple ,@vars) ,argname))))))
((length= vars 1)
`(,@(map (lambda (v) `(local ,v)) (lhs-vars (car vars)))
(= ,(car vars) ,argname)))
(else
`(,@(map (lambda (v) `(local ,v)) (lhs-vars `(tuple ,@vars)))
(= (tuple ,@vars) ,argname))))))
(expand-forms
`(call (top Generator) (-> ,argname (block ,@splat ,expr))
,(if (length= ranges 1)
Expand Down

0 comments on commit 59bc754

Please sign in to comment.