Skip to content

Commit

Permalink
make comprehensions use (top +) instead of +
Browse files Browse the repository at this point in the history
  • Loading branch information
JeffBezanson committed May 23, 2013
1 parent 3f08cf3 commit 45fc4e0
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions src/julia-syntax.scm
Original file line number Diff line number Diff line change
Expand Up @@ -1556,7 +1556,7 @@
`(block (= ,oneresult ,expr)
(type_goto ,initlabl)
(call (top setindex!) ,result ,oneresult ,ri)
(+= ,ri 1))
(= ,ri (call (top +) ,ri 1)))
`(for ,(car ranges)
,(construct-loops (cdr ranges)))))

Expand Down Expand Up @@ -1596,7 +1596,7 @@
(define (construct-loops ranges rs)
(if (null? ranges)
`(block (call (top setindex!) ,result ,expr ,ri)
(+= ,ri 1))
(= ,ri (call (top +) ,ri 1)))
`(for (= ,(cadr (car ranges)) ,(car rs))
,(construct-loops (cdr ranges) (cdr rs)))))

Expand Down Expand Up @@ -1714,9 +1714,9 @@
(if (null? ranges)
(if (null? iters)
`(block (call (top setindex!) ,result ,expr ,ri)
(+= ,ri 1))
(= ,ri (call (top +) ,ri) 1))
`(block (call (top setindex!) ,result (ref ,expr ,@(reverse iters)) ,ri)
(+= ,ri 1)) )
(= ,ri (call (top +) ,ri 1))) )
(if (eq? (car ranges) `:)
(let ((i (gensy)))
`(for (= ,i (: 1 (call (top size) ,oneresult ,oneresult-dim)))
Expand Down

0 comments on commit 45fc4e0

Please sign in to comment.