Skip to content

Commit 6849d2f

Browse files
committed
fixed the hygiene
1 parent c3b89fe commit 6849d2f

File tree

1 file changed

+14
-1
lines changed

1 file changed

+14
-1
lines changed

docs/src/lecture_07/lecture.md

Lines changed: 14 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -411,9 +411,11 @@ function reset!()
411411
end
412412

413413
macro exfiltrate()
414+
v = gensym(:vars)
414415
quote
415416
reset!()
416-
add_variables!(Base.@locals)
417+
$(v) = $(esc((Expr(:locals))))
418+
add_variables!($(v))
417419
end
418420
end
419421

@@ -423,10 +425,21 @@ end
423425
```
424426

425427
```julia
428+
using Main.Exfiltrator: @exfiltrate
426429
let
427430
x,y,z = 1,"hello", (a = "1", b = "b")
428431
@exfiltrate
429432
end
433+
434+
Exfiltrator.environment
435+
436+
function inside_function()
437+
a,b,c = 1,2,3
438+
@exfiltrate
439+
end
440+
441+
inside_function()
442+
430443
Exfiltrator.environment
431444
```
432445

0 commit comments

Comments
 (0)