(AKA Perverse Perlish Notation)

See the specs for it (half-hearted documentation) at my web site -- note: Netscape seems to feel my CSS isn't worthy of being rendered, while MSIE and Mozilla find it just fine.

Expect a parser within a week. It's actually far easier to parse RPN than it is regular Perl, since nested things become flat (like the Earth):
$foo{bar}[ blat(\%foo) ] = { a => 'fool' };
is represented in RPN as:
foo$ bar {} foo%\ blat [] (a => 'fool') {} =; # or, if you feel better binding things a little closer... foo$ bar{} (foo%\ blat)[] (a => 'fool'){} =;
Oh, note that:
foo$ x$[] # $foo[$x]
is COMPLETELY different from:
foo$ x$[] = # $foo = [$x]
But the parser will know how to differentiate, due to syntax rules:
# what is: foo$ x$[] y$[] =; # is it... $foo[$x] = [$y]; # or... $foo = [$x][$y]; # it can't be the second (since that's a syntax error)


japhy -- Perl and Regex Hacker

Replies are listed 'Best First'.
Re: Reverse Perlish Notation
by extremely (Priest) on Feb 16, 2001 at 11:54 UTC
    on CSS and the STYLE tag (emphasis mine):
    type = content-type [CI]
    This attribute specifies the style sheet language of the element's contents and overrides the default style sheet language. The style sheet language is specified as a content type (e.g., "text/css"). Authors must supply a value for this attribute; there is no default value for this attribute.

    Regardless of my earlier comments to coming soon... I think this is tre' sexy. Heck, I even used a faux french word about it. Sure it is evil but it is the really fascinating kind of evil. Just don't name it Lingua::RPN::Perligata because that would be almost as hard to remember as Lingua::Romana::Perligata. Though your effort is at least recognizably perlish.

    Actually, putting together the other post that just amused me, B::Deparse question with this one, I think you should write a B::Deparse::RPN so that we can insta-convert code to your new variant. =)

    When I get votes, you get a big ole ++!

    --
    $you = new YOU;
    honk() if $you->love(perl)

Re (tilly) 1: Reverse Perlish Notation
by tilly (Archbishop) on Feb 16, 2001 at 08:04 UTC
    And it is, of course, called reverse Polish because nobody wants to remember how to say Jan Lucasiewicz. :-)

    Does anyone know how the plans are coming in Perl 6 for having multiple front-ends for Perl, with the ability for different modules to be parsed and associated with the right one? I have heard that RPN is actually rather similar to Japanese. Of course we have the inflected lingua::Romana::Perligata (inflected languages include German, Russian, and according to co-worker several of the Indian languages), and of course the traditional positional Perl. Having them cooperate could be a very interesting experiment indeed. :-)