Skip to content

Commit c3af49c

Browse files
author
Dave Moon
committed
Update the entry for let in vars-introduced-by-patterns
to use hygienic-symbol? instead of symbol?. env-for-expansion needs to use difference rather than diff to remove the globals, because hygienic-symbols are not interned, thus must be compared with equal? rather than eq?.
1 parent 850746a commit c3af49c

File tree

1 file changed

+11
-10
lines changed

1 file changed

+11
-10
lines changed

src/julia-syntax.scm

+11-10
Original file line numberDiff line numberDiff line change
@@ -1254,15 +1254,16 @@
12541254
(if (null? binds)
12551255
(cons 'varlist vars)
12561256
(cond
1257-
((or (symbol? (car binds)) (decl? (car binds)))
1257+
((or (hygienic-symbol? (car binds))
1258+
(decl? (car binds)))
12581259
;; just symbol -> add local
12591260
(loop (cdr binds)
12601261
(cons (decl-var (car binds)) vars)))
12611262
((and (length= (car binds) 3)
12621263
(eq? (caar binds) '=))
12631264
;; some kind of assignment
12641265
(cond
1265-
((or (symbol? (cadar binds))
1266+
((or (hygienic-symbol? (cadar binds))
12661267
(decl? (cadar binds)))
12671268
;; a=b -> add argument
12681269
(loop (cdr binds)
@@ -3328,14 +3329,14 @@ So far only the second case can actually occur.
33283329

33293330
(define (env-for-expansion e)
33303331
(let ((globals (find-declared-vars-in-expansion e 'global)))
3331-
(let ((v (diff (delete-duplicates
3332-
(append! (find-declared-vars-in-expansion e 'local)
3333-
(find-assigned-vars-in-expansion e)
3334-
(map (lambda (x)
3335-
(if (hygienic-symbol? x) x
3336-
(car x)))
3337-
(vars-introduced-by e))))
3338-
globals)))
3332+
(let ((v (difference (delete-duplicates
3333+
(append! (find-declared-vars-in-expansion e 'local)
3334+
(find-assigned-vars-in-expansion e)
3335+
(map (lambda (x)
3336+
(if (hygienic-symbol? x) x
3337+
(car x)))
3338+
(vars-introduced-by e))))
3339+
globals)))
33393340
(append!
33403341
(pair-with-gensyms v)
33413342
(map (lambda (s) (cons s s))

0 commit comments

Comments
 (0)