Skip to content

Commit

Permalink
fix the second macro issue in #4873
Browse files Browse the repository at this point in the history
unfortunately I botched the fix for #4771, which led to this problem
  • Loading branch information
JeffBezanson committed Nov 30, 2013
1 parent 534c8b3 commit cfbb91b
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 5 deletions.
10 changes: 5 additions & 5 deletions src/julia-syntax.scm
Original file line number Diff line number Diff line change
Expand Up @@ -3034,13 +3034,13 @@ So far only the second case can actually occur.
((= function)
(if (and (pair? (cadr e)) (eq? (caadr e) 'call))
;; in (kw x 1) inside an arglist, the x isn't actually a kwarg
`(,(car e) (call ,(resolve-expansion-vars- (cadadr e) env m inarg)
`(,(car e) (call ,(resolve-expansion-vars-with-new-env (cadadr e) env m inarg)
,@(map (lambda (x)
(resolve-expansion-vars- x env m #t))
(resolve-expansion-vars-with-new-env x env m #t))
(cddr (cadr e))))
,(resolve-expansion-vars- (caddr e) env m inarg))
,(resolve-expansion-vars-with-new-env (caddr e) env m inarg))
`(,(car e) ,@(map (lambda (x)
(resolve-expansion-vars- x env m inarg))
(resolve-expansion-vars-with-new-env x env m inarg))
(cdr e)))))

((kw)
Expand Down Expand Up @@ -3089,7 +3089,7 @@ So far only the second case can actually occur.
'()
(case (car e)
((escape) '())
((= function ->)
((= function)
(append! (filter
symbol?
(if (and (pair? (cadr e)) (eq? (car (cadr e)) 'tuple))
Expand Down
7 changes: 7 additions & 0 deletions test/core.jl
Original file line number Diff line number Diff line change
Expand Up @@ -1158,3 +1158,10 @@ let
@test test3(1) == 1
@test_throws test3(2)
end

# issue #4873
macro myassert4873(ex)
:($ex ? nothing : error("Assertion failed: ", $(string(ex))))
end
x4873 = 1
@myassert4873 (x -> x)(x4873) == 1

0 comments on commit cfbb91b

Please sign in to comment.