File tree Expand file tree Collapse file tree 2 files changed +9
-3
lines changed Expand file tree Collapse file tree 2 files changed +9
-3
lines changed Original file line number Diff line number Diff line change @@ -23,8 +23,5 @@ _animals = split(read(animals_file, String))
2323resize! (animals, length (_animals))
2424animals .= Symbol .(lowercase .(_animals))
2525
26- function __init__ ()
27- Random. shuffle! (animals)
28- end
2926
3027end # module
Original file line number Diff line number Diff line change @@ -190,6 +190,9 @@ function gensym_ids(ex)
190190 end
191191end
192192
193+ const l = ReentrantLock ()
194+ const shuffled = Ref {Bool} (false )
195+
193196"""
194197 alias_gensyms(expr)
195198
@@ -205,6 +208,12 @@ julia> MacroTools.alias_gensyms(:(\$x+\$y))
205208```
206209"""
207210function alias_gensyms (ex)
211+ lock (l) do
212+ if ! shuffled[]
213+ Random. shuffle! (animals)
214+ shuffled[] = true
215+ end
216+ end
208217 left = copy (animals)
209218 syms = Dict {Symbol, Symbol} ()
210219 prewalk (ex) do x
You can’t perform that action at this time.
0 commit comments