3 ms·
Maybe I don't understand the meaning of "blocks" in Perl 6 (if they work this way, I definitely don't understand them). I've never worked in Perl 6, except a co
by SwellJoe 10y ago
Maybe I don't understand the meaning of "blocks" in Perl 6 (if they work this way, I definitely don't understand them). I've never worked in Perl 6, except a couple of tutorials, so that's entirely possible. I mean, I know Perl 6 has the ability to fundamentally change the language within the language itself.
- shakna 10y agoThe only thing blocks have to do with this, is that Perl6 has to internally track state so that closed over values go out of scope when their parent block ends. End of story. Maybe I can try explaining again. Eval is unsafe as it reads input values in terms of the current state of a program. It's environment is implicitly given, and includes the entirety of the Perl6 language, as well as anything user-created. But, what if the programmer was allowed to supply that context? Rather than a blacklist against certain bad things, this is a whitelist where you supply every single thing that eval is allowed to use. Other languages already have this. Scheme example that works: (eval '(+ 1 2) (let (null-environment) '(+ . +))) Scheme eval that fails: (eval '(+ 1 2) (null-environment)) Perl6's flexibility is less unsafe when you don't provide anything flexible.