in reply to *** japhy's qw is GODLIKE ***
in thread Is Perl less compact than Ruby? (Kind of competition)

I don't get it. Where are the Ln: labels being inserted? At the beginning of each line, right? So then, where are the newlines in $_?

_____________________________________________________
Jeff[japhy]Pinyan: Perl, regex, and perl hacker, who'd like a (from-home) job
s++=END;++y(;-P)}y js++=;shajsj<++y(p-q)}?print:??;

Replies are listed 'Best First'.
Re: Re: *** japhy's qw is GODLIKE ***
by locked_user mtve (Deacon) on Feb 20, 2002 at 21:27 UTC

    At the beginning of each line, right?

    Yes.

    So then, where are the newlines in $_?

    They are remains because of s/^/blahblah/mg

    Structure of ETA source (feeded on input) remains the same, it's only enlarging in width. Clear now? I'm ready to explain more carefully.

      The structure does not remain the same. Any characters out of the ordinary are removed.

      _____________________________________________________
      Jeff[japhy]Pinyan: Perl, regex, and perl hacker, who'd like a (from-home) job
      s++=END;++y(;-P)}y js++=;shajsj<++y(p-q)}?print:??;

        In short, ETA language recognizes and uses only 8 operators "htaoinse" (case insensitive), any other charasters are ignored.

        Two operators controls program flow. 'a' pushes on stack number of next line (of original source!). 't' is conditional jump, it pops from stack two values and if second value is true then control flow goes to line with number of first value.

        For example: ETA snippet "note at" first pushes "22" on stack ('n' goes to number mode, 'o' means '3' in number mode, 't' means 1, 'ot' means 31 in base 7 which is equal to decimal 22, 'e' exits number mode), then 'a' pushes number of next line (i.e. "2" if it's first line of source), then 't' makes jump to line "2" because 22 is true. In this case any other operators on current line are unreachable.

        More detailed explanation is on author's page.

        Our new algorithm is basically compiling ETA to Perl, and source grew from straight imperative to verily perlish obscurity.

        Thank you very much for improvements!