Quick actions

cmd+k|ctrl+k

Navigation

Languages

SO: What is the best way to flush precompiled perl6 modules?

Snippet info

Language

Raku

Visibility

public

Author

raiph

Created

2019-08-17T11:14:46Z

Updated

2019-08-17T18:09:39Z

# Each click of Run button below starts with a completely fresh setup of directories, files, etc.
run 'echo', 'first run';        run 'perl6', 'main-path1.pl6';          # Run prog shown in 2nd tab
run 'echo', 'cp libs to path2'; run 'cp', '-r', '-p', 'path1', 'path2'; # Copy .precomp dir as well
run 'echo', 'run using path2';  run 'perl6', 'main-path2.pl6';          # Run prog shown in 3rd tab
run 'echo', 'edit path2/lib1';  spurt 'path2/lib1.pm6', 'unit module lib1; use lib2; our $value = $lib2::value;';
run 'echo', 'edit path2/lib2';  spurt 'path2/lib2.pm6', 'unit module lib2; our $value = 2;';
run 'echo', 'run path2 again';  run 'perl6', 'main-path2.pl6';
# As is, running this yields `1`, `1`, and `2` -- as expected.
# But commenting out 'edit lib1' line yields `1`, `1`, `1` -- the "edit" of lib2 has no effect.
# The 'edit lib1' line spurts exactly the same as the existing lib1 content.
INFO