Brent 'Dax' Royal-Gordon wrote:
Larry Wall <[EMAIL PROTECTED]> wrote:Hmm. maybe we just need a function that loads an entire file and returns a string of it, then feeds that to eval.
: C<do filename> I'll tackle at the same time as C<eval>. It's likely : staying in some form. I use it from time to time when I'm patching : together several automation scripts. (Remember that Perl gets used for : the quick and dirty as well as the big and elegant.)
But probably huffmanized to something longer like "evalfile".
eval :file("somefile.pl6"); eval :string('{$^x + ' ~ $y ~ '}');
eval :file("otherfile.pl"), :lang('perl5'); eval :string("lamda x: x + $y"), :lang('python');
Since as long as we're huffmanizing, eval STRING deserves to be longer than do STRING.
C<eval> taking code for other languages.... That's evil. I like it :-)
btw, has some syntax been created for "punt this over to Parrot, in language X"?
eval q:to:0 /EOB/ :lang('PIR'); ... EOB
eval $=DATA :lang('python');
eval loadfile 'foo.pl' :lang('ponie');
Making them strings eases the task of parsing. The constant heredoc and pod-block forms definitely seem like something that could be addressed at compile time.
-- Rod Adams