File tree Expand file tree Collapse file tree 1 file changed +5
-12
lines changed Expand file tree Collapse file tree 1 file changed +5
-12
lines changed Original file line number Diff line number Diff line change @@ -398,32 +398,25 @@ module Exfiltrator
398398
399399const environment = Dict {Symbol, Any} ()
400400
401- add_variable! (name:: Symbol , value) = environment[name] = value
402-
403- function add_variables! (d:: Dict )
401+ function copy_variables! (d:: Dict )
402+ foreach (k -> delete! (environment, k), keys (environment))
404403 for (k, v) in d
405- add_variable! (k, v)
404+ environment[k] = v
406405 end
407406end
408407
409- function reset! ()
410- foreach (k -> delete! (environment, k), keys (environment))
411- end
412-
413408macro exfiltrate ()
414409 v = gensym (:vars )
415410 quote
416- reset! ()
417411 $ (v) = $ (esc ((Expr (:locals ))))
418- add_variables ! ($ (v))
412+ copy_variables ! ($ (v))
419413 end
420414end
421415
422- export @exfiltrate
423-
424416end
425417```
426418
419+ Test it to
427420``` julia
428421using Main. Exfiltrator: @exfiltrate
429422let
You can’t perform that action at this time.
0 commit comments