On Fri, Sep 06, 2002 at 06:01:20PM -0700, Sean O'Rourke wrote: > On Sat, 7 Sep 2002, Steve Fink wrote: > > > - Add a -e (or --eval) flag to perl6. > > For those "quick" one-liners?
For running things under the debugger. It's easier to mess with @DB::ARGS than it is to play around with external files. And it ain't Perl until you can write one-liners! > > - Make sure P6C::IMCC::code() adds a newline after every line > > (I was getting two consecutive lines of code smashed together) > > This will probably make the output pretty ugly. I'd rather find the > culprit for the smashed-together lines, or only add a newline if there > isn't one already. The behavior before this patch seems inconsistent. It unconditionally appends a newline to the end of every line in the passed-in array except for the last one. Probably the better fix would be to leave the behavior as patched, but write it more clearly: $funcs{$curfunc}->{code} .= "$_\n" foreach (@_); and then make callers only stick on newlines when they really want blank lines. But I'm not sure how it's actually used in practice. --- I'm very impressed by P6C. This is the first time I've looked at it seriously (I'm trying to do the languages/regex integration), and it seems very well put together. Certainly better than I could do. The only complaint I have is that there's too much eval"" and AUTOLOADing going on to easily follow things in the debugger. Bug report: perl6 -e 'print 1 if /a/' calls P6C::IMCC::rule::val(), which does an rx_popindex immediately and runs out of stack. perl6 -e 'print 1 if "a" =~ /a/" never calls P6C::IMCC::rule::val(), and works correctly. (The =~ gets treated as a Binop and gets correct handling via do_smartmatch.)