Rakudo 'ng' branch is now 'master'

2010-02-14 Thread Patrick R. Michaud
I've just completed the rename of the 'ng' branch to become the new 'master' branch. The old 'master' branch is now called 'alpha'. If you have an existing checkout (clone) of the Rakudo repository, it's probably a good idea to get a new fresh clone rather than trying to pull updates from the exi

Re: S5 updated

2004-09-24 Thread Patrick R. Michaud
On Fri, Sep 24, 2004 at 11:36:43AM -0500, Rod Adams wrote: > Output would be a step by step graph of the internal logic used to match > / not match the string. I'd break the RE up into the same pieces the > Engine does, then show how that subrule matched char a, then char b, but > failed to matc

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») = (\

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-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 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: Common error with | and ^$ in regexps

2005-02-07 Thread Patrick R. Michaud
On Mon, Feb 07, 2005 at 01:21:00PM +0100, Juerd wrote: > Nicholas Clark skribis 2005-02-07 12:10 (+): > > Will the relative precedence of grouping versus anchors for beginning and > > end of line remain the same in Perl6 rules? > > There currently is no such thing as precedence in regexes. Cha

Re: Fwd: Junctive puzzles.

2005-02-10 Thread Patrick R. Michaud
On Thu, Feb 10, 2005 at 10:42:34AM +, Thomas Yandell wrote: > Is the following comment correct? > > my $x = any(2,3,4,5) and any(4,5,6,7); # $x now contains any(4,5) Short answer: I don't think so. Long answer: I tend to get very lost when dealing with junctions, so I can be completely wro

Re: Fwd: Junctive puzzles.

2005-02-11 Thread Patrick R. Michaud
On Thu, Feb 10, 2005 at 12:02:01PM -0600, Rod Adams wrote: > Patrick R. Michaud wrote: > > >Even if you fixed the =/and precedence with parens, to read > > > > my $x = (any(2,3,4,5) and any(4,5,6,7)); > > > >then I think the result is still that $x contai

Re: Fwd: Junctive puzzles.

2005-02-11 Thread Patrick R. Michaud
On Thu, Feb 10, 2005 at 12:02:01PM -0600, Rod Adams wrote: > [...] > If this is the case, then this entire discussion collapses into how to > best convert arrays into junctions and junctions into arrays. Perl's > existing abilities to edit arrays should be more than sufficient for > editing junc

Re: Fun with junctions (was Sets vs Junctions)

2005-02-12 Thread Patrick R. Michaud
On Sat, Feb 12, 2005 at 04:44:04PM +1100, Damian Conway wrote: > Patrick R. Michaud wrote: > > >>$x = $Value | 'Default'; > >>instead of : > >>$x = $Value || 'Default'; > > > > > >Hmm, this is an interesting point. I'll

Re: Fun with junctions (was Sets vs Junctions)

2005-02-12 Thread Patrick R. Michaud
On Sat, Feb 12, 2005 at 01:02:45PM +0800, Autrijus Tang wrote: > On Fri, Feb 11, 2005 at 02:12:51PM -0600, Patrick R. Michaud wrote: > > I briefly grepped through the apocalypses/synopses and couldn't > > find the answer -- how do I tell a scalar context to expect a > &g

Re: Junctive collapsing?

2005-02-12 Thread Patrick R. Michaud
On Sat, Feb 12, 2005 at 12:09:37PM +0800, Autrijus Tang wrote: > [...] > - one() checks its operands for duplicates; if found, it collapses > itself into an empty one() junction, thus failing all tests. > Is this somewhat saner? :-) Depends on when it's checking its operands for duplicat

Re: Junctive collapsing?

2005-02-12 Thread Patrick R. Michaud
On Sun, Feb 13, 2005 at 01:01:15AM +0800, Autrijus Tang wrote: > On Sat, Feb 12, 2005 at 10:55:05AM -0600, Patrick R. Michaud wrote: > > On Sat, Feb 12, 2005 at 12:09:37PM +0800, Autrijus Tang wrote: > > > [...] > > > - one() checks its operands for duplica

Re: Fun with junctions (was Sets vs Junctions)

2005-02-12 Thread Patrick R. Michaud
On Sat, Feb 12, 2005 at 12:41:19AM -0600, Rod Adams wrote: > >I've given here. For example, a junction can have a value like: > > $x = ($a & $b) ^ ($c & $d) > >which is true only if $a and $b are true or $c and $d are true but not > >both. > > That's why I allowed for virtual sets, defined by a

Re: Fun with junctions (was Sets vs Junctions)

2005-02-12 Thread Patrick R. Michaud
On Sat, Feb 12, 2005 at 03:49:02AM -0600, Jonathan Scott Duff wrote: > On Sat, Feb 12, 2005 at 01:03:26AM -0600, Rod Adams wrote: > > I also find the following incredibly disturbing: > > > > >perl6 -e "$x = 'cat'|'dog'; say $x;" > > dog > > cat > > Would that happen though? What's the signature

Re: Fun with junctions (was Sets vs Junctions)

2005-02-12 Thread Patrick R. Michaud
On Sat, Feb 12, 2005 at 01:18:53PM -0600, Rod Adams wrote: > >>My issue is less that lists and sets are radically different. It is much > >>more a matter of Junctions and Scalars are radically different. Getting > >>me to accept that a Scalar holds several different values at once is a > >>hard sel

Re: Fun with junctions (was Sets vs Junctions)

2005-02-11 Thread Patrick R. Michaud
Woops! I just realized I factored something wrongly...!? On Fri, Feb 11, 2005 at 01:22:51PM -0600, Patrick R. Michaud wrote: > # return true if $x is a factor of $y > sub is_factor (Scalar $x, Scalar $y) { $y % $x == 0 } > [...] > # a (somewhat inefficient?) is_prime t

Fun with junctions (was Sets vs Junctions)

2005-02-11 Thread Patrick R. Michaud
On Fri, Feb 11, 2005 at 12:54:39AM -0600, Rod Adams wrote: > Damian writes: > >Junctions have an associated boolean predicate that's preserved across > >operations on the junction. Junctions also implicitly distribute > >across operations, and rejunctify the results. > > My brain is having trouble

Re: Junctive collapsing?

2005-02-11 Thread Patrick R. Michaud
On Sat, Feb 12, 2005 at 03:28:15AM +0800, Autrijus Tang wrote: > On Fri, Feb 11, 2005 at 09:42:06AM +, Thomas Yandell wrote: > > Is there another operator that takes the intersection of two > > junctions, such that any(2,3,4,5) *some op* any(4,5,6,7) would result > > in any(4,5)? > > Yes. In

Fun with junctions (was Sets vs Junctions)

2005-02-11 Thread Patrick R. Michaud
Rod Adams wrote: > I would argue that this sort of relational comparison is of limited > usefulness. Well, except junctions hold more information than the simple comparisons I've given here. For example, a junction can have a value like: $x = ($a & $b) ^ ($c & $d) which is true only if $a

Re: Fun with junctions (was Sets vs Junctions)

2005-02-13 Thread Patrick R. Michaud
On Sat, Feb 12, 2005 at 03:54:57PM -0600, Rod Adams wrote: > >>But, to extract those alternative values from an object, you do > >>something special to it, like call a method. Whenever you evaluate the > >>object as a scalar, you get a single value back. Quite probably a > >>reference to somethi

Re: Fun with junctions (was Sets vs Junctions)

2005-02-13 Thread Patrick R. Michaud
On Sat, Feb 12, 2005 at 05:24:04PM -0600, Jonathan Scott Duff wrote: > > >Because of this, I'd suggest that autothreading of user-defined routines > > >not be the default, but rather enabled via a pragma of some sort (or, of > > >course, via an "autothreaded" trait). For the built-in routines this

Re: Fun with junctions (was Sets vs Junctions)

2005-02-15 Thread Patrick R. Michaud
On Tue, Feb 15, 2005 at 03:07:53PM -0600, Rod Adams wrote: > I see it this way: > When perl sees a function call, and one of the arguments is a junction, > there are three basic options: > 1) If the junction is wrapped up in some larger container, like a slurpy > list, pass it on as is. > 2) If t

Re: Fun with junctions (was Sets vs Junctions)

2005-02-15 Thread Patrick R. Michaud
On Tue, Feb 15, 2005 at 05:49:44PM -0600, Rod Adams wrote: > >As you've written things above, C is autothreaded (your option #3), > >and we'll see two C output lines if $DEBUG is set. > > The case of Damian's response in a prior message: > [...] > Could easily be achieved with a single layer of

Re: Junction Values

2005-02-15 Thread Patrick R. Michaud
On Wed, Feb 16, 2005 at 12:17:35PM +1100, Damian Conway wrote: > Rod Adams wrote: > >On a slightly different topic, do the following equivalences work: > >[...] > >none($a, $a) == undef > True. Scott already caught (and Damian acknowledged) this one, it's false if $a == undef. > >none($a,$a,$b)

Re: Fun with junctions (was Sets vs Junctions)

2005-02-15 Thread Patrick R. Michaud
On Tue, Feb 15, 2005 at 07:20:53PM -0600, Jonathan Scott Duff wrote: > > Patrick R. Michaud wrote: > > >OTOH, what happens with...? > > > > > > sub nofun($x is rw) { > > > $x += 2; > > > } > > > > > > $y = 3 | 4; &

Re: Containers vs Objects.

2005-02-15 Thread Patrick R. Michaud
On Wed, Feb 16, 2005 at 01:13:53PM +1100, Damian Conway wrote: > Larry wrote: > >0 < $x < 10 > >after all--the problem with rewriting that as > >0 < $x and $x < 10 > >is that it should only work as long as the two values of $x remain > >entangled so that the always refer to the same abstrac

Re: Junction Values

2005-02-15 Thread Patrick R. Michaud
On Wed, Feb 16, 2005 at 02:53:15PM +1100, Damian Conway wrote: > Patrick R. Michaud wrote: > > >>>none(none($a,$b),none($c,$d)) == none($a,$b,$c,$d) > >> > >>True. > > > > > >H... > > > > -> none(none($a,$b) == none($

Re: Containers vs Objects.

2005-02-16 Thread Patrick R. Michaud
On Wed, Feb 16, 2005 at 12:14:10AM -0600, Rod Adams wrote: > So in terms of frequency of use in the English Language, I'd rank things > in the following order: > 1) Scalars > 2) Sets > 3) Arrays > 4) Hashes Perhaps. However, it's fairly easy to use an Array or Hash to represent a Set, so perhaps

Re: Junction Values

2005-02-16 Thread Patrick R. Michaud
On Wed, Feb 16, 2005 at 01:06:22PM +, Nigel Sandever wrote: > > Any chance that you could provide one or two simple but realistic examples of > using Junctions and their operators? I'll give it a shot, but keep in mind that I'm somewhat new to this also. :-) First, junctions are an easy w

Re: Junction Values

2005-02-16 Thread Patrick R. Michaud
On Wed, Feb 16, 2005 at 06:04:37PM +, Nigel Sandever wrote: > On Wed, 16 Feb 2005 09:18:42 -0600, [EMAIL PROTECTED] (Patrick R. Michaud) > wrote: > > And for fun, try writing the equivalent of > >if $x == one($a, $b, $c, $d) { ... } > > without a junction. (Ok

Re: Boolean literals

2005-02-16 Thread Patrick R. Michaud
On Tue, Feb 15, 2005 at 11:03:09PM -0800, Larry Wall wrote: > On Wed, Feb 16, 2005 at 02:29:36PM +0800, Autrijus Tang wrote: > : Just a quick question. The prettyprinter of Pugs (the thing that > : handles the ".perl" method) currently prints out boolean true and > : false as #t and #f, which is o

Re: =>'s LHS

2005-02-19 Thread Patrick R. Michaud
On Sat, Feb 19, 2005 at 09:10:05PM +0100, Juerd wrote: > Is =>'s LHS still automatically quoted? What are the rules? S02 says that => still autoquotes any bare identifier to its immediate left, even keywords and macros. Pm

Re: Junction Values

2005-02-19 Thread Patrick R. Michaud
On Sat, Feb 19, 2005 at 02:40:00PM -0600, Rod Adams wrote: > Damian Conway wrote: > > >Of course, literal junctions *will* autothread in all circumstances: > > > >is_prime(any(6,7,8)) > >is_prime(6|7|8) > > I had not caught the difference between: > >use junctions; >$x = 6|7|8; >

Re: Junction Values

2005-02-19 Thread Patrick R. Michaud
On Sat, Feb 19, 2005 at 02:40:00PM -0600, Rod Adams wrote: > I addressed earlier concept of how does perl know when there are side > effects, particularly with the execution path can weave to parts written > in pure-parrot. Patrick responded by implying > that there was no such side effect prote

Re: Junction Values

2005-02-19 Thread Patrick R. Michaud
> However, I also realize that I might have stepped on some toes of the > course of this long discussion. Which was never my intention, and I'll > apologize to any who feel I've slighted them in the process. Personally, I've found the thread to be incredibly useful in (1) understanding Junction

Re: Set sigils (was: Re: Junction Values)

2005-02-20 Thread Patrick R. Michaud
On Sat, Feb 19, 2005 at 01:43:57PM -0800, Ashley Winters wrote: > Instead of primary sigils, what about secondary sigils on an array to > mark it as an unordered set? > > @|foo = any > @&foo = all > @^foo = one # can arrays be curried arguments? hmm > @!foo = none > > After all, why should scal

Re: Junction Values

2005-02-20 Thread Patrick R. Michaud
On Sun, Feb 20, 2005 at 10:46:15PM +0100, Eirik Berg Hanssen wrote: > Eirik Berg Hanssen <[EMAIL PROTECTED]> writes: > > Rod Adams <[EMAIL PROTECTED]> writes: > >>$re1 = /^ <-[x]>* x <-[x]>* $/; # match a string with exactly one 'x' > >>$re2 = /^ <-[y]>* y <-[y]>* $/; # ditto 'y' > >>$

Re: scoping functions as list operators?

2005-02-24 Thread Patrick R. Michaud
On Fri, Feb 25, 2005 at 12:54:20AM -0500, Uri Guttman wrote: > > "RA" == Rod Adams <[EMAIL PROTECTED]> writes: > > RA> Uri Guttman wrote: > >> that fixes Stéphane's problem with my yall proposal. and yall solves the > >> unary my problem. :) > >> > RA> Stop misusing "y'all" before t

Re: Rule Parameters

2005-03-02 Thread Patrick R. Michaud
On Tue, Mar 01, 2005 at 09:32:28PM -0800, Larry Wall wrote: > On Tue, Mar 01, 2005 at 11:06:17PM -0600, Rod Adams wrote: > : Since the line between rules and subs is already blurring significantly, > : I want to blur it a little more. I want to write rules which can take > : parameters. > > No p

Re: Rule Parameters

2005-03-02 Thread Patrick R. Michaud
> : Does get handled as )> or as > : , q)>, in which case it's really qw//? > > The former. It's a single string, which you can parse however you like. > Though I suppose we could extend the colon to a colon modifier: > > > > That's getting a little weird though, considering that in most

Re: [pugs] array interpolation question

2005-03-05 Thread Patrick R. Michaud
On Sat, Mar 05, 2005 at 11:22:23AM -0500, Garrett Rooney wrote: > It looks like the current pugs array interpolation doesn't quite match > the description in S02. > [...] This a (hopefully friendly) note regarding cross posting between perl6-compiler (p6c) and perl6-language (p6l). We're still f

Re: The S29 Functions Project

2005-03-14 Thread Patrick R. Michaud
On Sun, Mar 13, 2005 at 06:03:20PM -0800, Larry Wall wrote: > : One thing I've already done is make a list of Perl 5 functions I cannot > : address until some future Apocalypse/Synopsis is generated on the topic. > : By far the bulk of this list falls on S16. Partly because IPC is a mess, > : an

Re: +<< or +

2005-04-02 Thread Patrick R. Michaud
On Sat, Apr 02, 2005 at 12:05:37PM +0200, Juerd wrote: > Bitshift, which one is it? > +<< > or > +< > > I believe only +< is possible, because +<< has to be +«, but S03 is > still inconsistent, and +<< comes up everywhere, including Brent's > perl6op.txt. > > Can there please be a definit

Re: S03 problem in Hyperoperators

2005-04-02 Thread Patrick R. Michaud
On Sat, Apr 02, 2005 at 11:41:18AM -0500, Aaron Sherman wrote: > At the beginning of the section on hyper operators, the following: > > The Unicode characters » (\x[BB]) and « (\x[BB]) > > should be: > > The Unicode characters » (\x[BB]) and « (\x[AB]) This is already fixed in t

Re: identity tests and comparing two references

2005-04-06 Thread Patrick R. Michaud
On Wed, Apr 06, 2005, Larry Wall wrote: > I think it's time to break out > the colon again and use something like: > > &infix:<+>:(Complex, Complex); > > or > > &foo:(Str,Int) > > for ordinary functions. If it gets really popular people might > even start writing: > > sub foo :(S

Re: [PATCH] apo/A05.pod: spelling error

2005-04-08 Thread Patrick R. Michaud
On Thu, Apr 07, 2005 at 11:13:42PM +0200, Steven Schubiger wrote: > Attached is a patch that fixes a minor spelling error > in apocalypse 5. Applied, thanks! Pm

Re: should we change [^a-z] to <-[a..z]> instead of <-[a-z]>?

2005-04-14 Thread Patrick R. Michaud
On Thu, Apr 14, 2005 at 05:21:05PM -0700, Larry Wall wrote: > Given that we're trying to get rid of special > exceptions, and - in character classes is weird, and we already > use .. for ranges everywhere else, and nobody is going to put a > repeated character into a character class, I'm wondering

Re: <[]> ugly and hard to type

2005-04-15 Thread Patrick R. Michaud
On Fri, Apr 15, 2005 at 02:58:44PM +0200, Juerd wrote: > Am I the only one who thinks <[a-z]> is ugly and hard to type because of > the nested brackets? The same goes for <{...}>. The latter can't easily > be fixed, I think, but the former perhaps can. Part of the thinking behind this is that the

Re: should we change [^a-z] to <-[a..z]> instead of <-[a-z]>?

2005-04-15 Thread Patrick R. Michaud
On Fri, Apr 15, 2005 at 01:01:58PM -, Rafael Garcia-Suarez wrote: > Aaron Sherman wrote in perl.perl6.language : > > > > A silly question: is there a canonical character set from which we > > extract these ranges? Are we hard-coding Unicode here, or is there some > > way for the user to specify

Re: Truely temporary variables

2005-04-15 Thread Patrick R. Michaud
On Fri, Apr 15, 2005 at 09:17:13AM -0700, Larry Wall wrote: > On Fri, Apr 15, 2005 at 06:04:32PM +0200, Juerd wrote: > : No, Ucfirst it can't be, I think. And ALLCAPS is ugly. @ is taken (and > : ugly). Suggestions? > > Maybe we could define an "ok" operator that suppresses only the > *first* warn

Re: S03 Precedence for junctions

2005-04-17 Thread Patrick R. Michaud
On Sun, Apr 17, 2005 at 07:29:33AM -0700, Larry Wall wrote: > On Sun, Apr 17, 2005 at 08:56:46PM +1000, Brad Bowman wrote: > : > : Hi all, > : > : S03 gives infix + a higher precedence than junctive > : operators in the listed table, but that seems to contradict > : the examples under "Junctive o

Re: [PATCH] apo/A06.pod: spelling error(s)

2005-04-17 Thread Patrick R. Michaud
On Sun, Apr 17, 2005 at 02:52:27PM +0200, Steven Philip Schubiger wrote: > A spelling mistake and a word, that supposedly has been forgotten. > > Steven Applied, thanks! Pm > --- apo/A06.pod Sun Apr 17 14:34:16 2005 > +++ apo/A06.pod Sun Apr 17 14:42:37 2005 > @@ -

Re: identity tests and comparing two references [PATCH for S06 and A06]

2005-04-17 Thread Patrick R. Michaud
On Tue, Apr 12, 2005 at 06:22:13PM +0200, Thomas Sandlaß wrote: > > I've edited the above syntax into S06 and A06. The two patches > are attached but I don't know if you are the right one to sent > them to. Whom should I sent such patches? I just saw you applying > other patches as well. Applied,

Re: Closure/block/sub multiplier /// Win32 module for Perl6

2005-04-20 Thread Patrick R. Michaud
On Wed, Apr 20, 2005 at 12:00:22PM -0700, Larry Wall wrote: > : Although admittedly, I only encountered this when playing with a > : non-readonly undef ;) (This is something I can recommend to anyone: > : redefining true, false and undef leads to very spectacular code, where > : anything's possible

Re: [PATCH] Re: apo/A06.pod: spelling error(s)?

2005-04-20 Thread Patrick R. Michaud
On Wed, Apr 20, 2005 at 08:13:20PM +0200, Steven Philip Schubiger wrote: > On 20 Apr, Luke Palmer wrote: > : Steven Philip Schubiger writes: > :> In > :> macro circumfix:(*...*) () is parsed(/.*?/ { "" } > :> > :> is the second enclosing part of the "parsed" parentheses omitted > :> by intenti

Re: Malfunction Junction, what's your function?

2005-04-27 Thread Patrick R. Michaud
On Wed, Apr 27, 2005 at 08:46:53AM -0400, Joshua Gatcomb wrote: > The problem is that in the regex version I use capturing parens to > identify the character matched. For the purposes of the problem I > don't need to rely on the first character matched I just need to know > 1. > > Without doing a

Re: Malfunction Junction, what's your function?

2005-04-27 Thread Patrick R. Michaud
On Wed, Apr 27, 2005 at 06:29:46PM +0200, Thomas Sandlaß wrote: > Patrick R. Michaud wrote: > >>my $matches = any( @x_chars ) eq any( @y_chars ); > >>my $match = $matches.pick; > > > >Perhaps the easiest way to explain the difficulty here is to note that

Re: Malfunction Junction, what's your function?

2005-04-27 Thread Patrick R. Michaud
On Wed, Apr 27, 2005 at 10:30:35AM -0600, Paul Seamons wrote: > Minor note. > > Would you want this: > >sub &infix:(Str $a, Str $b) { return ($a eq $b) ? $a : ''; } > to be [corrected]: >sub &infix:(Str $a, Str $b) >{ return ($a eq $b) ?? $a but bool::true :: ''; } Perhaps, but I

Re: Coroutine Question

2005-05-04 Thread Patrick R. Michaud
On Wed, May 04, 2005 at 02:22:43PM -0400, John Macdonald wrote: > On Wed, May 04, 2005 at 10:43:22AM -0400, Aaron Sherman wrote: > > On Wed, 2005-05-04 at 10:07, Aaron Sherman wrote: > > > A coroutine is just a functional unit that can be re-started after a > > > previous return, so I would expect

Re: reduce metaoperator

2005-05-06 Thread Patrick R. Michaud
On Fri, May 06, 2005 at 12:23:49PM +1000, Stuart Cook wrote: > On 5/6/05, Stuart Cook <[EMAIL PROTECTED]> wrote: > > (snip) As long as each meta-operator > > explicitly knows what type of regular operator it accepts (and > > produces), there shouldn't be any problems with ambiguity. > > > > Havin

Re: available operator characters

2005-05-06 Thread Patrick R. Michaud
On Fri, May 06, 2005 at 06:24:00PM +0200, Juerd wrote: > To try and make it easier to pick (ASCII) operators, a simple table of > what's given away and what's available. Please let me know if there are > any mistakes. > > If anyone knows how to fill in the "???" parts, be my guest! > [...] > >

Re: Nested captures

2005-05-09 Thread Patrick R. Michaud
Here's some more commentary to draft zero of the capturing semantics (thanks, Damian!), based partially on PGE's current implementation. On Mon, May 09, 2005 at 10:51:53PM +1000, Damian Conway wrote: > [...] > =head2 Nested subpattern captures > [...] > There may also be shortcuts for accessing ne

Re: Nested captures

2005-05-09 Thread Patrick R. Michaud
On Mon, May 09, 2005 at 09:47:14AM -0600, Paul Seamons wrote: > > =item * > > > > Quantifiers (except C and C) cause a matched subrule or subpattern to > > return an array of C objects, instead of just a single object. > > What is the effect of the quantifiers C<**{0,1}> and C<**{0,1}?> ? Will th

Re: Nested captures

2005-05-09 Thread Patrick R. Michaud
On Mon, May 09, 2005 at 11:02:58AM -0500, Patrick R. Michaud wrote: > On Mon, May 09, 2005 at 09:47:14AM -0600, Paul Seamons wrote: > > > =item * > > > > > > Quantifiers (except C and C) cause a matched subrule or subpattern > > > to > > > return

Re: Nested captures

2005-05-09 Thread Patrick R. Michaud
On Mon, May 09, 2005 at 09:14:02AM -0700, Larry Wall wrote: > : m/ (don't) (ray) (me) (for) (solar tea), (d'oh!) > : | (every) (green) (BEM) (devours) (faces) > : /; > > This seems like a rather ugly syntax for what is essentially a label, > or a rule. I wonder if we can com

Re: Nested captures

2005-05-09 Thread Patrick R. Michaud
On Mon, May 09, 2005 at 11:34:10AM -0700, Larry Wall wrote: > On Mon, May 09, 2005 at 10:33:33AM -0500, Patrick R. Michaud wrote: > : After thinking on this a bit, I'm hoping we don't do this -- at least not > : initially. I'm not sure there's a lot of advantage of

Re: Nested captures

2005-05-09 Thread Patrick R. Michaud
On Mon, May 09, 2005 at 08:43:39PM +, [EMAIL PROTECTED] wrote: > Can I say $*1, $*2, etc, to get perl5 flattened peren counting captures? > We need something like that to make perl5->perl6 translation easier; > otherwise we'd have to parse perl5 RE instead of just slapping on a ":p5". > Unle

Re: Nested captures

2005-05-11 Thread Patrick R. Michaud
On Thu, May 12, 2005 at 12:06:57AM +0800, Autrijus Tang wrote: > On Wed, May 11, 2005 at 08:30:42AM -0700, Larry Wall wrote: > > On Wed, May 11, 2005 at 05:48:59PM +1000, Damian Conway wrote: > > : But that's only the opinion of one(@Larry), not of $Larry. > > > > Let's go 0-based and make $0 =:=

Re: Nested captures

2005-05-11 Thread Patrick R. Michaud
On Wed, May 11, 2005 at 06:37:53PM +0200, Juerd wrote: > Larry Wall skribis 2005-05-11 8:30 (-0700): > > It's already the case that p5-to-p6 is going to have a *wonderful* > > time translating $7 to $1[2][0]... > > Or maybe it just has to change "(" to "$1 := (", the second "(" to "$2 > := (", et

character classes in p6 rules

2005-05-11 Thread Patrick R. Michaud
I now have a basic implementation for enumerated character classes in the grammar engine (i.e., <[xyz]>, <-[xyz]>, <[x..z]>, and <-[x..z]>). I didn't see it specified anywhere, but are the \d, \D, \s, \S, etc. metacharacters still supposed to work inside of a enumerated character class, as they

C<::> in rules

2005-05-12 Thread Patrick R. Michaud
I have a couple of questions regarding C< :: > in perl 6 rules. First, a question of verification -- in $rule = rx :w / plane :: (\d+) | train :: (\w+) | auto :: (\S+) / ; "travel by plane jet train tgv today" ~~ $rule I think the match should fail outright, as opposed to matching "train

Re: C<::> in rules

2005-05-12 Thread Patrick R. Michaud
On Thu, May 12, 2005 at 12:53:46PM -0400, Aaron Sherman wrote: > My take, based on S05: > > > In other words, it acts as though one had written > > > > $rule = rx :w / plane ::: (\d+) | train ::: (\w+) | auto ::: (\S+) / ; > > > > and not > > > > $rule = rx :w /[ plane :: (\d+) | tr

Re: C<::> in rules

2005-05-12 Thread Patrick R. Michaud
On Thu, May 12, 2005 at 12:33:59PM -0500, Jonathan Scott Duff wrote: > > > > /[:w\bfoo bar]/# not exactly the same as above > > > > No, I think that's exactly the same. > > What does \b mean again? I assume it's no longer backspace? For as long as I can remember \b has meant "word boun

Re: C<::> in rules

2005-05-12 Thread Patrick R. Michaud
$rule = rx :w / plane ::: (\d+) | train ::: (\w+) | auto ::: (\S+) / ; $rule = rx :w /[ plane :: (\d+) | train :: (\w+) | auto :: (\S+) ]/ ; On Thu, May 12, 2005 at 02:29:24PM -0400, Aaron Sherman wrote: > On Thu, 2005-05-12 at 13:44, Patrick R. Michaud wrote: > > On Thu, May 12

Re: Numification of captured match

2005-05-12 Thread Patrick R. Michaud
On Fri, May 13, 2005 at 03:23:20AM +0800, Autrijus Tang wrote: > Is it really intended that we get into habit of writing this? > > if 'localhost:80' ~~ /^(.+)\:(\d+)$/ { > my $socket = connect(~$0, +$1); > } > > It looks... weird. :) And it would have to be if 'localhost:80'

Re: C<::> in rules

2005-05-12 Thread Patrick R. Michaud
On Thu, May 12, 2005 at 05:15:55PM -0400, Aaron Sherman wrote: > On Thu, 2005-05-12 at 15:41, Patrick R. Michaud wrote: > > False. In the first case the group is the whole rule. In the second > > case the group would not include the (implied) '.*?' at the start of >

Re: C<::> in rules

2005-05-12 Thread Patrick R. Michaud
On Thu, May 12, 2005 at 08:56:39PM -0700, Larry Wall wrote: > On Thu, May 12, 2005 at 09:33:37AM -0500, Patrick R. Michaud wrote: > : Also, A05 proposes incorrect alternatives to the above > : > : /[:w[]foo bar]/# null pattern illegal, use > : /[:w()foo bar]/

Re: Numification of captured match

2005-05-12 Thread Patrick R. Michaud
On Thu, May 12, 2005 at 08:10:42PM -0700, Larry Wall wrote: > On Thu, May 12, 2005 at 02:55:36PM -0500, Patrick R. Michaud wrote: > : On Fri, May 13, 2005 at 03:23:20AM +0800, Autrijus Tang wrote: > : > Is it really intended that we get into habit of writing this? > : > > : &

Re: C<::> in rules

2005-05-13 Thread Patrick R. Michaud
On Fri, May 13, 2005 at 03:36:50PM +, Luke Palmer wrote: > I'm basically saying that you should treat your: > $str ~~ /abc :: def | ghi :: jkl | mn :: op/; > As: > $rule = rx/abc :: def | ghi :: jkl | mn :: op/; > $str ~~ /^ .*? <$rule>/; > Which means that you fail the rule, your .

Re: C<::> in rules

2005-05-13 Thread Patrick R. Michaud
On Sat, May 14, 2005 at 04:26:44AM +, Luke Palmer wrote: > On 5/14/05, Larry Wall <[EMAIL PROTECTED]> wrote: > > I want ::: to break out of *that* dynamic scope (or the equivalent > > "matchrighthere" scope), but not ::. > > I'm not sure that's such a good idea. When you say: > > rule fo

Re: C<::> in rules

2005-05-14 Thread Patrick R. Michaud
On Fri, May 13, 2005 at 01:07:20PM -0700, Larry Wall wrote: > On Fri, May 13, 2005 at 11:54:47AM -0500, Patrick R. Michaud wrote: > : $r1 = rx / abc :: def | ghi :: jkl | mn :: op /; > : $r2 = rx / abc ::: def | ghi ::: jkl | mn ::: op /; > : $r3 = rx / [ abc :: def | ghi

Re: lazy context

2005-05-20 Thread Patrick R. Michaud
On Fri, May 20, 2005 at 05:15:24PM -0400, C. Scott Ananian wrote: > On Fri, 20 May 2005, Yuval Kogman wrote: > > >then it is not finalized into a real value. Here's how the range > >operator would be implemented: > > > > sub &infix:<..> ($from, $to where { $to < $from }){ reverse $to .. > >

Re: comprehensive list of perl6 rule tokens

2005-05-26 Thread Patrick R. Michaud
On Tue, May 24, 2005 at 08:25:03PM -0400, Jeff 'japhy' Pinyan wrote: > I have looked through the latest > revisions of Apo05 and Syn05 (from Dec 2004) and come up with the > following list: > > http://japhy.perlmonk.org/perl6/rules.txt I'll review the list below, but it's also worthwhile to r

Re: comprehensive list of perl6 rule tokens

2005-05-26 Thread Patrick R. Michaud
Rather than answer each message in this thread individually, I'll try to aggregate them here. Disclaimer: These are just my interpretations of how rules are defined; I'm not the one who decides how they *should* be defined. On Wed, May 25, 2005 at 10:55:59AM -0400, Jeff 'japhy' Pinyan wrote: >

Sets (was: Reductions, junctions, hashslices, and cribbage scoring)

2005-05-26 Thread Patrick R. Michaud
On Thu, May 26, 2005 at 11:03:15AM -0600, John Williams wrote: > > I proposed the following: > > > > # Fifteens > > $score += 2 * all( 15 == [EMAIL PROTECTED] any( 0 .. 4 ) } ); > > > > * Is this syntax legal? > > I think so. > > > * Does it do what I want it to do? > > Definitely not. First,

Re: comprehensive list of perl6 rule tokens

2005-05-26 Thread Patrick R. Michaud
On Thu, May 26, 2005 at 07:05:41PM -0400, Jeff 'japhy' Pinyan wrote: > >Here the leading tokens are actually "<$", "<::$", "<@", "<%", "<{", "<&", > >and "<(", and I suspect we have " >" > Per your second message, <[EMAIL PROTECTED]> would mean >, > right? I think so -- at least, it seems that w

Re: date and time formatting

2005-05-31 Thread Patrick R. Michaud
On Tue, May 31, 2005 at 09:23:11AM -0400, Nathan Gray wrote: > As I am interested in human-readable dates and times, and having found > no conclusive discussion on time formatting, I make my recommendation > for a syntax (to start discussion, and allow for date formatting to be > implemented in pug

Re: comprehensive list of perl6 rule tokens

2005-05-31 Thread Patrick R. Michaud
On Sun, May 29, 2005 at 12:52:25PM -0400, Jeff 'japhy' Pinyan wrote: > I'm curious if and "capture" anything. They don't start > with '?', so following the guidelines, it would appear they capture, but > that doesn't make sense. Should they be written as and , > or is the fact that they cap

Re: comprehensive list of perl6 rule tokens

2005-05-31 Thread Patrick R. Michaud
On Tue, May 31, 2005 at 01:20:57PM -0700, Larry Wall wrote: > On Thu, May 26, 2005 at 11:19:42AM -0500, Patrick R. Michaud wrote: > : Do we still have the <> syntax, or was that abandoned in > : favor of ? (I know there are still some remnants of <<...>> > : in

Re: comprehensive list of perl6 rule tokens

2005-05-31 Thread Patrick R. Michaud
On Thu, May 26, 2005 at 11:19:42AM -0500, Patrick R. Michaud wrote: > <$rule> N indirect rule > <::$rulename> N indirect symbolic rule > <@rules>N like '@rules' > <%rules>N

Re: Perl 6 Summary... p6rules

2005-05-31 Thread Patrick R. Michaud
On Tue, May 31, 2005 at 11:58:12PM -0400, Dino Morelli wrote: > Thank you for the summary, Matt > > I have a correction, though: > > > subrules tests > >Dino Morelli provided a patch adding tests for subrules to PGE. Warnock > >applies. > > > > > > This and my o

Re: comprehensive list of perl6 rule tokens

2005-06-01 Thread Patrick R. Michaud
On Thu, Jun 02, 2005 at 12:52:36AM -0400, Jeff 'japhy' Pinyan wrote: > Further woes, arguments, questions: > > In regards to <@array>, A5 says "A leading @ matches like a bare array..." > but this is an over-generalization. A leading '@' merely indicates the > rule is found in an array. <@arra

Re: comprehensive list of perl6 rule tokens

2005-06-02 Thread Patrick R. Michaud
On Thu, Jun 02, 2005 at 09:14:33AM +0200, "TSa (Thomas Sandlaß)" wrote: > Patrick R. Michaud wrote: > >Of course, there are other "implicit" parameters that are given > >to a rule -- the target string to be matched and an initial > >starting position. Bu

Re: comprehensive list of perl6 rule tokens

2005-06-02 Thread Patrick R. Michaud
On Thu, Jun 02, 2005 at 09:19:22PM +0200, "TSa (Thomas Sandlaß)" wrote: > >I think the state object ought to have some sort of base type -- > >is it Grammar? Rule? If we say it's a "Rule", then we're > >effectively saying that "applying a Rule to a target results > >in a Rule object containing

Re: using rules

2005-06-09 Thread Patrick R. Michaud
On Sun, Jun 05, 2005 at 05:11:55PM +0200, BÁRTHÁZI András wrote: > Thanks, it helped me! > > More questions. ;) It seems to me, that the following constructs not > yet(?) implemented in Pugs. Is it true? I'll note briefly here that questions regarding implementation (in Perl 6 or Pugs) generally

Re: State of Design Documents

2005-06-10 Thread Patrick R. Michaud
On Fri, Jun 10, 2005 at 12:51:15PM -0400, Joshua Gatcomb wrote: > I know that decisions are subject to change but having the current > state of decisions in a single location (Synopses) would be a great > benefit to all. I am a firm believer in not complaining unless you > have an idea about how t

Re: State of Design Documents

2005-06-13 Thread Patrick R. Michaud
On Fri, Jun 10, 2005 at 02:36:52PM -0400, Joshua Gatcomb wrote: > Ok, are there any guidelines for what should and should not be put > forward as a patch. I can see 3 key areas of concern: > > 1. Framework for unwritten Synopses (so we know what goes where) > 2. Heading placeholders for written

Re: State of Design Documents

2005-06-13 Thread Patrick R. Michaud
On Mon, Jun 13, 2005 at 02:22:59PM -0500, Patrick R. Michaud wrote: > On Fri, Jun 10, 2005 at 02:36:52PM -0400, Joshua Gatcomb wrote: > > Ok, are there any guidelines for what should and should not be put > > forward as a patch. > [...] > For anything that doesn't com

<    1   2   3   4   >