Re: S05 question

2004-12-10 Thread John Macdonald
On Thu, Dec 09, 2004 at 11:18:34AM -0800, Larry Wall wrote: > On Wed, Dec 08, 2004 at 08:24:20PM -0800, Ashley Winters wrote: > : I'm still going to prefer using :=, simply as a good programming > : practice. My mind sees a big difference between building a parse-tree > : object and just grepping f

Re: S05 question

2004-12-09 Thread Larry Wall
On Wed, Dec 08, 2004 at 08:24:20PM -0800, Ashley Winters wrote: : I'm still going to prefer using :=, simply as a good programming : practice. My mind sees a big difference between building a parse-tree : object and just grepping for some word I want in a string. Within a : rule{} block, there is n

Re: S05 question

2004-12-09 Thread Patrick R. Michaud
On Wed, Dec 08, 2004 at 08:24:20PM -0800, Ashley Winters wrote: > > I was working on the (possibly misguided) assumption that there's a > cost to capturing, and that perhaps agressive capturing isn't worth > having "on" in a one-liner. Some deep part of my mind remembers $` > being bad, I think. I

Re: S05 question

2004-12-09 Thread Patrick R. Michaud
On Thu, Dec 09, 2004 at 10:52:54AM +, Matthew Walton wrote: > Of course, it then begs the question about > > > > if we're thinking of parallels with qw//-like constructs, which I > certainly am. I'm not quite sure what that would do, as it collides > slightly with the existing rule m

Re: S05 question

2004-12-09 Thread Matthew Walton
Larry Wall wrote: I'm still thinking about what «...» might mean, if anything. Bonus points for interpolative and/or word-splitty. I'm perhaps not being entirely serious, but if you want something word-splitty and interpolative, how about this (which may cause unwanted physiological side effects

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: 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

Re: S05 question

2004-12-07 Thread Larry Wall
On Tue, Dec 07, 2004 at 12:11:18PM -0700, Patrick R. Michaud wrote: : I'm reviewing the updated S05 (2 Dec 2004) and ran across this : in the "Hypothetical Variables" section: : : # Pairs of repeated captures can be bound to hashes: : : / % := [ () = (\N+) ]* / : : Actually, I see th

S05 question

2004-12-07 Thread Patrick R. Michaud
I'm reviewing the updated S05 (2 Dec 2004) and ran across this in the "Hypothetical Variables" section: # Pairs of repeated captures can be bound to hashes: / % := [ () = (\N+) ]* / Actually, I see three captures there, so should this instead read...? / % := [ («ident») = (\