Re: A5: hypotheticals outside regexen

2002-06-06 Thread Damian Conway
Page 13 tells use about Clet decls. But it also says that the topic must be a regex. Whilst it explains that this isn't really a problem, I'm not sure that it justifies it. So perhaps someone can clarify why this (hypothetical) code in not a reasonable generalization: Because Perl code

Re: A5: hypotheticals outside regexen

2002-06-06 Thread Damian Conway
You have Ino idea how often that would have been useful. It's a great exception safety mechanism... like C++'s resource aquisition is initialization thingy, but without having to write a class for every variable. Have you already forgotten KEEP and UNDO (that we introduced in A4/E4):

Re: A5: a few simple questions

2002-06-06 Thread Damian Conway
David Whipp wrote: First, a slight clarification: if I say: m:w/ %foo := [ (\w+) = (\w+) [ , (\w+) ]* ] / does this give me a hash of arrays? (i.e. is the rhs of a hash processed as a scalar context) That's an error. The grouping bound to a hypothetical hash has to have either

Re: A5: making a production out of REs

2002-06-06 Thread Damian Conway
Rich Morin wrote: I'd like to be able to use REs to generate lists of strings. For example, it might be nice to create a loop such as: for $i (sort(p:p5|[0-9A-F]{2}|)) { # p operator for production? and have $i walk from '00' through 'FF'. Or whatever. You mean: $ch =

Re: 6PAN (was: Half measures all round)

2002-06-06 Thread Josh Wilmes
For the record, you will hear no disagreement from me. I recognize that this is a HARD problem. Nonetheless, I think it's an important one, and solving it (even imperfectly, by only supporting well-defined platforms) would be a major coup. --Josh At 23:31 on 06/05/2002 BST, Nicholas Clark

Re: A5: making a production out of REs

2002-06-06 Thread Rich Morin
At 6:10 PM +1000 6/6/02, Damian Conway wrote: Rich sez: But make Damian use es, rather than egs for the eigenstate (is :-) operator. s/is/it/, above (blush). That is, the superposition _could_ be in any of several states, but the eigenstate tells us what it really is. No,

Re: A5: a few simple questions

2002-06-06 Thread John Siracusa
On 6/6/02 2:43 AM, Damian Conway wrote: rule wordlist { (\w+) [ , (\w+) ]* } No semicolon at the end of that line? I've already forgotten the new rules for that type of thing... :) -John

Re: A5: a few simple questions

2002-06-06 Thread Allison Randal
On Thu, Jun 06, 2002 at 10:38:39AM -0400, John Siracusa wrote: On 6/6/02 2:43 AM, Damian Conway wrote: rule wordlist { (\w+) [ , (\w+) ]* } No semicolon at the end of that line? I've already forgotten the new rules for that type of thing... :) No, because rules are basically methods,

A5: Is this right?

2002-06-06 Thread Brent Dax
#Preliminary Perl6::Regex # This does not have any actions, but otherwise I think is correct. # Let me know if it's right or not. use 6; grammar Perl6::Regex { rule metachar { [{(\[\])}:*+?\\|]} rule ws { [[\h\v]|\#\N*]*} rule atom

Re: A5: Is this right?

2002-06-06 Thread Buddha Buck
At 11:31 AM 06-06-2002 -0700, Brent Dax wrote: #Preliminary Perl6::Regex # This does not have any actions, but otherwise I think is correct. # Let me know if it's right or not. I'm not a regex guru, but... use 6; grammar Perl6::Regex { rule metachar { [{(\[\])}:*+?\\|]

Re: A5: Is this right?

2002-06-06 Thread Larry Wall
On Thu, 6 Jun 2002, Buddha Buck wrote: At 11:31 AM 06-06-2002 -0700, Brent Dax wrote: I had gotten the impression that a literal string separated by whitespace was an atom, so rule foofoobar { foo 1,2 bar } would match 'foobar' or 'foofoobar'. If so, I think !metachar needs to be

Apoc5 comments/questions

2002-06-06 Thread Jonathan Scott Duff
Whew! I've carefully (well, I tried to be careful :-) read through Apocalypse 5 twice now and it still makes my head hurt (but in a good way). What follows is some notes that I jotted down and am tired of looking at. Please correct any misconceptions and feel free to add where I've omitted.

Re: A5: a few simple questions

2002-06-06 Thread Piers Cawley
Allison Randal [EMAIL PROTECTED] writes: On Thu, Jun 06, 2002 at 10:38:39AM -0400, John Siracusa wrote: On 6/6/02 2:43 AM, Damian Conway wrote: rule wordlist { (\w+) [ , (\w+) ]* } No semicolon at the end of that line? I've already forgotten the new rules for that type of thing... :)

Re: A5: a few simple questions

2002-06-06 Thread Allison Randal
On Thu, Jun 06, 2002 at 08:21:25PM +0100, Piers Cawley wrote: Allison Randal [EMAIL PROTECTED] writes: No, because rules are basically methods, just like grammars are basically classes. You would only need a semi-colon if you were defining an anonymous Crule (similar to an anonymous

RFC261 in Perl 5 and where it needs Perl 6 support

2002-06-06 Thread Aaron Sherman
Larry discounted RFC261 in A5, but I think there's some good in it. The biggest problem is not that it's hard to do in Perl6, but that 80-90% of it is ALREADY done in Perl5! Once you peel away that portion of the RFC, you get to Perl5's limitations and what Perl6 might do to support these

Re: A5: Is this right?

2002-06-06 Thread Damian Conway
Brent Dax wrote: grammar Perl6::Regex { rule metachar { [{(\[\])}:*+?\\|]} rule ws { [[\h\v]|\#\N*]*} Or just: rule ws { [\s|\#\N*]* } rule atom { ws (!metachar | \\ . | group) ws }

Re: A5: Is this right?

2002-06-06 Thread Larry Wall
On Fri, 7 Jun 2002, Damian Conway wrote: Brent Dax wrote: grammar Perl6::Regex { rule metachar { [{(\[\])}:*+?\\|]} rule ws { [[\h\v]|\#\N*]*} Or just: rule ws { [\s|\#\N*]* } Just as

Apoc 5 questions/comments

2002-06-06 Thread Dave Storrs
Well, A5 definitely has my head spinning. The new features seem amazingly powerful...it almost feels like we're going to have two equally powerful, equally complex languages living side-by-side: one of them is called Perl and the other one is called Regexes. Although they may talk to one