Beefy Boxes and Bandwidth Generously Provided by pair Networks
Do you know where your variables are?
 
PerlMonks  

Re: Typo in Exegesis 5?

by Juerd (Abbot)
on Aug 24, 2002 at 10:39 UTC ( [id://192534]=note: print w/replies, xml ) Need Help??


in reply to Typo in Exegesis 5?

# Perl 5 @cmd = ('get','put','try','find','copy','fold','spindle','mutilate +'); $cmd = join '|', map { quotemeta $_ } @cmd; $str =~ / (?:$cmd) \( .*? \) /;
There should be an 'x' there.
$deleteline = rx/^^ \< <sp> (\N* \n) / $appendline = rx/^^ \> <sp> (\N* \n) /
...
The first character on that line must be either a '<' or a '>'. Note that we have to escape these characters since angle brackets are metacharacters in Perl 6.
I don't think > needs to be escaped when not used in <...>. I'd be surprised if rx/>/ were invalid.
$text =~ /<Diff.file>/; # Invoke through grammar
In Apocalypse 5, Larry uses ::, not . to separate grammar and rule names.
... $0/2002/08/22/exegesis5.html{hunk} ...
The O'Reilly CMS probably screwed this up.
# Perl 5 $str =~ m/ ^ m* (?:d?c{0,3}|c[dm]) (?:l?x{0,3}|x[lc]) (?:v?i{0,3}|i[vx +]) $ /ix; # Perl 6 $str =~ m:i/ ^ m* [d?c<0,3>|c<[dm]>] [l?x<0,3>|x<[lc]>] [v?i<0,3>|i<[v +x]>] $ /;
Those can't be completely equal, because the meaning of the $ metacharacter changed.

- Yes, I reinvent wheels.
- Spam: Visit eurotraQ.

Replies are listed 'Best First'.
Re: Re: Typo in Exegesis 5?
by theorbtwo (Prior) on Aug 24, 2002 at 13:09 UTC

    You do indeed seem right on most of those points, Jured, but there's a couple that bear a closer look. I'm sure > doesn't need to be escaped when not inside a <> construction (just like the HTML I'm writing now, which is rather interesting, in a cool meta- sort of way, but I'm going off on a tangent)... but in that case, I'd escape it anyway, for parallelism. As to the last point, the meaning of $ did indeed change, and he meant $$, not $, since that is a newline in the middle of the string.


    Confession: It does an Immortal Body good.

      As to the last point, the meaning of $ did indeed change, and he meant $$, not $, since that is a newline in the middle of the string.

      No, there is no /m in the Perl5 version. I think the correct translation is \n? $.

      - Yes, I reinvent wheels.
      - Spam: Visit eurotraQ.
      

Re: Re: Typo in Exegesis 5?
by erikharrison (Deacon) on Aug 24, 2002 at 22:20 UTC
    $text =~ /<Diff.file>/; # Invoke through grammar
    In Apocalypse 5, Larry uses ::, not . to separate grammar and rule names.

    This is a method call.

    Update: As Juerd rightly points out, there is a distinction between a grammer and a class, and their rules and methods. However, the same syntax is used to call a rule from a grammer, as a grammer can inherit from other grammer(s), delegate to other grammers, and possibly even autogenerate rules. In these cases, the rule needs to be treated as a method call.

    Cheers,
    Erik

    Light a man a fire, he's warm for a day. Catch a man on fire, and he's warm for the rest of his life. - Terry Pratchet

      This is a method call.

      file is a rule, not a method. (Diff is a grammar, not a class. -- There is a parallel, but Damian and Larry interpret it differently)

      - Yes, I reinvent wheels.
      - Spam: Visit eurotraQ.
      

Log In?
Username:
Password:

What's my password?
Create A New User
Domain Nodelet?
Node Status?
node history
Node Type: note [id://192534]
help
Chatterbox?
and the web crawler heard nothing...

How do I use this?Last hourOther CB clients
Other Users?
Others lurking in the Monastery: (2)
As of 2024-04-18 23:50 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found