Re: S05 question

2004-12-08 Thread Alexey Trofimenko
On Wed, 8 Dec 2004 16:07:43 -0700, Luke Palmer <[EMAIL PROTECTED]> wrote: Ashley Winters writes: In a one-liner, I'd rather just use: $datetime ~~ /$year := (\d+) -? $month := (\d+) -? ./ I'm starting to think that this '$year := ' syntax is an obfuscator. We couldn't refer to that capture wi

Re: S05 question

2004-12-08 Thread Ashley Winters
On Wed, 8 Dec 2004 16:07:43 -0700, Luke Palmer <[EMAIL PROTECTED]> wrote: > Ashley Winters writes: > > For a grammar, that works perfectly! > > Yep. > > > In a one-liner, I'd rather just use: > > > > $datetime ~~ /$year := (\d+) -? $month := (\d+) -? ./ > > Then go ahead and use that. If yo

Re: S05 question

2004-12-08 Thread Larry Wall
On Wed, Dec 08, 2004 at 11:09:30AM -0700, Patrick R. Michaud wrote: : On Wed, Dec 08, 2004 at 08:19:17AM -0800, Larry Wall wrote: : > And people would have to get used to seeing ? as non-capturing assertions: : > : > : > : > : > : > This has a rather Ruby-esque "I am a bool

Re: S05 question

2004-12-08 Thread Larry Wall
On Wed, Dec 08, 2004 at 11:50:51AM -0700, Luke Palmer wrote: : > Now suppose that we extend that "I am a boolean" feeling to : > : > : > : > which might take the place of the confusing <(...)>, and make consistent : > the notion that we always use {...} to invoke "real" code. : : Hmm... I'

Re: Is object representation "per class" or "per object"?

2004-12-08 Thread Larry Wall
On Tue, Dec 07, 2004 at 12:32:50PM -0500, Abhijit Mahabal wrote: : According to S12, it is possible to supply the object layout to bless(), : like so: : : $object = $class.bless(:CREATE[:repr] :k1($v1) :k2($v2)) : : But in the section "Introspection", "layout" is a class trait. Does this : mean

Re: S05 question

2004-12-08 Thread Juerd
Warning: excessive nitpicking ahead. Ashley Winters skribis 2004-12-08 10:51 (-0800): > rule year { \d<4> } \d**{4} Or, well, \d**{2,4} > rule month { \d<2> } \d**{2} > rule date { -? -? } rule week { \d**{2} } rule yday { \d**{3} } rule date {

Re: S05 question

2004-12-08 Thread Luke Palmer
Ashley Winters writes: > I'm thinking capturing rules should be default in rules, where they're > downright useful. Your hour/minute/second comment brings up parsing > ISO time: > > grammar ISO8601::DateTime { > rule year { \d<4> } > rule month { \d<2> } > rule day { \d<2> } > rule

Re: S05 question

2004-12-08 Thread Ashley Winters
On Wed, 8 Dec 2004 08:19:17 -0800, Larry Wall <[EMAIL PROTECTED]> wrote: > / $ := [ () = (\N+) ]* / You know, to be honest I don't know that I want rules in one-liners to capture by default. I certainly want them to capture in rules, though. > And people would have to get used to seeing ? as

Re: S05 question

2004-12-08 Thread Luke Palmer
Larry Wall writes: > If we're going to stick with the notion that captures and > something else doesn't, I'm beginning to think that the other thing > isn't Âfoo for a couple of reasons. I just sat down to say the exact same thing. I'm glad you beat me to it. > And people would have to get use

Re: S05 question

2004-12-08 Thread Patrick R. Michaud
On Wed, Dec 08, 2004 at 08:19:17AM -0800, Larry Wall wrote: > And people would have to get used to seeing ? as non-capturing assertions: > > > > > > This has a rather Ruby-esque "I am a boolean" feeling to it. I think > I like it. It's pretty easy to type, at least on my

Re: S05 question

2004-12-08 Thread Austin Hastings
Larry Wall wrote: Another problem we've run into is naming if there are multiple assertions of the same name. If the capture name is just the alpha part of the assertion, then we could allow an optional number, and still recognize it as a "ws": Except I can well imagine people wanting number

Re: S05 question

2004-12-08 Thread Larry Wall
On Tue, Dec 07, 2004 at 10:36:53PM -0800, Larry Wall wrote: : But somehow I expect that when someone writes () they probably : usually meant («foo»). If we're going to stick with the notion that captures and something else doesn't, I'm beginning to think that the other thing isn't «foo» for a cou