[perl6/specs] 48af14: Mention unspace disallowed in regex (except \#)

2015-01-12 Thread GitHub
-bits.pod Log Message: --- Mention unspace disallowed in regex (except \#) The current engine disallows unspace in regexex as too ambiguous. This is fine for actual whitespace, but is counterintuitive when people try to backslash the # character. So \# is now specifically allowed to match

[perl6/specs] 48af14: Mention unspace disallowed in regex (except \#)

2015-01-06 Thread GitHub
-bits.pod Log Message: --- Mention unspace disallowed in regex (except \#) The current engine disallows unspace in regexex as too ambiguous. This is fine for actual whitespace, but is counterintuitive when people try to backslash the # character. So \# is now specifically allowed to

[perl6/specs] 36aa88: [S32::Exception] Add X::Regex::SolitaryQuantifier

2014-11-11 Thread GitHub
-library/Exception.pod Log Message: --- [S32::Exception] Add X::Regex::SolitaryQuantifier

[perl6/specs] d5f520: remove autodeclaration fossil from regex

2012-02-25 Thread GitHub
-regex.pod Log Message: --- remove autodeclaration fossil from regex

[perl6/specs] c96afc: Regex vars declarative iff declared constant

2010-11-08 Thread noreply
Message: --- Regex vars declarative iff declared constant Making the LTM engine track whether a variable has changed is not friendly to most VMs. The spec was engaged in P5-Think of the there's-only-one-implementation-so-we-can-get-fancy kind. sorear++

Re: regex and

2010-08-10 Thread Eirik Berg Hanssen
On Tue, Aug 10, 2010 at 9:00 PM, wrote: > Once the & operator is in rakudo, though... I gather I /could/ do something > like the following > > ^ [ * & ] $ > > And this would in effect ensued that the sequence "abc" doesn't exist > anywhere across the match for > > > Is this correct? > Not

RE: regex and

2010-08-10 Thread philippe.beauchamp
Back to your original advice... > If you want to match an alphabetic string which does not include 'abc' > anywhere, you can write this as > > ^ [ ]* $ I presume this only works here because is one character... if instead of I used anything more complicated (for example) token name {

Re: regex and

2010-08-10 Thread Moritz Lenz
philippe.beauch...@bell.ca wrote: > On the & operator... are you saying that it would operate basically as > expected... > allowing sets of rules and'ed rather than or's with the | ? Yes, with the limitation that both parts separated by & have to match the same length of string, so that for exam

RE: regex and

2010-08-10 Thread philippe.beauchamp
he | ? --- Phil -Original Message- From: Moritz Lenz [mailto:mor...@faui2k3.org] Sent: August 10, 2010 2:09 PM To: Beauchamp, Philippe (6009210) Cc: perl6-language@perl.org Subject: Re: regex and Hi, philippe.beauch...@bell.c

Re: regex and

2010-08-10 Thread Moritz Lenz
ote that is a zero-width assertion, so your example regex matches at the start of a string, if it does not begin with 'abc'. Since you anchor it to the end of string too, it can only ever match the empty string. You can achieve the same with just ^$. If you want to match an alphabetic

regex and

2010-08-10 Thread philippe.beauchamp
Hi there... New to the list and getting to understand perl6 after a bit of a hiatis from the Perl world. I'm working my way through the new grammar syntax trying to implement some useful modules, and was wondering if there is a mechanism within the grammar constructs to allow two rules to appl

r31128 -[S05] posit that cursor lists may be returned to a regex with <.gather { take ... }>

2010-06-05 Thread pugs-commits
Author: lwall Date: 2010-06-05 21:02:35 +0200 (Sat, 05 Jun 2010) New Revision: 31128 Modified: docs/Perl6/Spec/S05-regex.pod Log: [S05] posit that cursor lists may be returned to a regex with <.gather { take ... }> Modified: docs/Perl6/Spec/S05-reg

Re: Regex interpolation

2010-03-29 Thread mark . a . biggar
Use <{...}>. as the string returned is reinterpreted as a regex, if it consists of the single quoted string then it's a literal, but you must include the single quotes in the result returned. E.g., <{ my $x = funct($a, $b, $c); "'$x'";}> Mark

Regex interpolation

2010-03-29 Thread Mark J. Reed
Is there not a way to run arbitrary code and interpolate the result as a literal string (instead of a Regex)? I assume that {...} is intended to be where you hook in semantics/actions mid-parse, but it seems a bit counter-intuitive that the same syntax interpolates in double-quote context but

Re: String to Regex

2010-01-04 Thread Jan Ingvoldstad
On Sun, Jan 3, 2010 at 8:30 PM, Moritz Lenz wrote: > > But since $input can contain closures, arbitrary code can be executed. > I'd like to propose a way to compile a string to a regex which doesn't > allow code execution. > So would I. I would also like it to be the

String to Regex

2010-01-04 Thread Moritz Lenz
Some Perl 5 programs take a regex (in string form) as input, and simply interpolate it into a regex. In Perl 6, you'd do that as my $re = rx/ <$input> /; But since $input can contain closures, arbitrary code can be executed. I'd like to propose a way to compile a string to a reg

S05 Regex - Unicode properties

2009-11-23 Thread Helmut Wollmersdorfer
IMHO some details of Unicode property support seem unspecified: 1) Assumption: *ALL* Unicode properties and all of their aliases should be supported. E.g. this will also include the derived properties 'Grapheme_Base' and 'Grapheme_Extent' (missing in Perl 5 - obviously a bug in 'unicore').

Re: S05 (regex) Q:

2009-08-10 Thread Larry Wall
en there, the language inside the parens is still inherited from the surrounding language braid, which is a lexically scoped concept. The current outermost language is called $~MAIN (see S02) while the current regex language is called $~Regex. It just has to look outward a bit further to see what

Re: S05 (regex) Q:

2009-08-08 Thread Patrick R. Michaud
On Sat, Aug 08, 2009 at 05:45:40PM -0400, Austin Hastings wrote: > [...] > Specifically, is > token { ... } > going to match the same pattern as > rule { ... } > ?? > > I ask because (I just did it, and) with rules encouraging the liberal > use of whitespace, and implicitly generating <

S05 (regex) Q:

2009-08-08 Thread Austin Hastings
S05 mentions the magic pattern in two locations, but I cannot find a specification of the interaction between and the ratcheting {rule/token} status. Specifically, is token { ... } going to match the same pattern as rule { ... } ?? I ask because (I just did it, and) with rules enco

Re: Regex - Accessing captured subrules could be problematic

2008-12-05 Thread Patrick R. Michaud
On Thu, Dec 04, 2008 at 07:00:55PM +0100, Moritz Lenz wrote: > GW wrote: > > I found something that could be problematic (haven't yet found out if it > > should be a special case) in Synopsis 5. More precisely it is under the > > chapter "Accessing captured subrule

Re: Regex - Accessing captured subrules could be problematic

2008-12-04 Thread Jonathan Scott Duff
On Wed, Dec 3, 2008 at 6:19 PM, GW <[EMAIL PROTECTED]> wrote: > Hi, > > I found something that could be problematic (haven't yet found out if it > should be a special case) in Synopsis 5. More precisely it is under the > chapter "Accessing captured subru

Re: Regex - Accessing captured subrules could be problematic

2008-12-04 Thread Moritz Lenz
Hello, GW wrote: > I found something that could be problematic (haven't yet found out if it > should be a special case) in Synopsis 5. More precisely it is under the > chapter "Accessing captured subrules" in the test case > t/regex/from_perl6_rules/capture.

Regex - Accessing captured subrules could be problematic

2008-12-04 Thread GW
Hi, I found something that could be problematic (haven't yet found out if it should be a special case) in Synopsis 5. More precisely it is under the chapter "Accessing captured subrules" in the test case t/regex/from_perl6_rules/capture.t lines 67–71: ok(eval(

Re: Should !~~ /regex/ set $/?

2008-09-06 Thread Nicholas Clark
On Sat, Sep 06, 2008 at 09:41:07AM -0700, Larry Wall wrote: > On Sat, Sep 06, 2008 at 11:44:05AM +0200, Moritz Lenz wrote: > : The subject says it all: should !~~ with a regex on the RHS set $/? > > For now I would assume that the meta operator rewrites > > $a !~~ $b >

Re: Should !~~ /regex/ set $/?

2008-09-06 Thread Larry Wall
On Sat, Sep 06, 2008 at 11:44:05AM +0200, Moritz Lenz wrote: : The subject says it all: should !~~ with a regex on the RHS set $/? For now I would assume that the meta operator rewrites $a !~~ $b to (not $a ~~ $b) so .ACCEPTS has no clue that it is dealing with a negated operator. In

Should !~~ /regex/ set $/?

2008-09-06 Thread Moritz Lenz
The subject says it all: should !~~ with a regex on the RHS set $/? Cheers, Moritz -- Moritz Lenz http://moritz.faui2k3.org/ | http://perl-6.de/

Re: Regex repetition controlled by characters

2008-09-05 Thread Patrick R. Michaud
On Sun, Aug 31, 2008 at 08:33:48AM -0600, Stephen Simmons wrote: > In S05, I found this regarding the generalized repetition specifier: > > ** '|'# repetition controlled by presence of character > > I tried it out with > > rule thislist { ** '|' }; > > and got (with Rakudo): > >

Re: [perl #58424] Named regex, token and rule don't work outside of a grammar

2008-09-01 Thread Moritz Lenz
Patrick R. Michaud wrote: > On Thu, Aug 28, 2008 at 08:32:41AM -0700, Carl Mäsak wrote: >> r30590: >> $ ./perl6 -e 'regex a { b }; "b" ~~ a' >> too few arguments passed (0) - 2 params expected >> [...] >> >> I've also added tes

Re: Regex repetition controlled by characters

2008-08-31 Thread Moritz Lenz
Stephen Simmons wrote: > In S05, I found this regarding the generalized repetition specifier: > > ** '|'# repetition controlled by presence of character > > I tried it out with > > rule thislist { ** '|' }; > > and got (with Rakudo): > > perl6regex parse error: Error in closure q

Regex repetition controlled by characters

2008-08-31 Thread Stephen Simmons
In S05, I found this regarding the generalized repetition specifier: ** '|'# repetition controlled by presence of character I tried it out with rule thislist { ** '|' }; and got (with Rakudo): perl6regex parse error: Error in closure quantifier at offset 28, found ''' Is this fe

Re: yada yada yada in regex

2008-06-08 Thread Daniel Ruoso
Sáb, 2008-06-07 às 16:01 +0200, Stéphane Payrard escreveu: > what is the equivalent convention for yadayadayada in regex. Cuz ... > is alread meaningful in regex. Should I use <...> or {...} ? > Should the first be predefined? If I understand correctly, {...} should already be p

yada yada yada in regex

2008-06-08 Thread Stéphane Payrard
what is the equivalent convention for yadayadayada in regex. Cuz ... is alread meaningful in regex. Should I use <...> or {...} ? Should the first be predefined? I want something that is a placeholder that parses but fails if someone pastes it. In other words the equivalent of a sub yad

Re: Regex syntax

2008-03-18 Thread Jon Lang
Moritz Lenz wrote: > I noticed that in larger grammars (like STD.pm and many PGE grammars in > the parrot repo) string literals are always quoted for clarity > > regex foo { > 'literal' > } > > Since I think this is a good idea, we could just as

Regex syntax

2008-03-13 Thread Moritz Lenz
I have two questions/suggestions regarding regex syntax: 1) The :ii modifier is influenced by :sigspace modifier. IMHO this is ugly, because the matching part and the replacement part of a regex should be as orthogonal as possible. Therefore I'd like a different syntax for :ii :sigspace,

Re: Major bullet biting on | vs || within regex

2007-01-16 Thread Larry Wall
On Tue, Jan 16, 2007 at 02:05:44PM -0600, Patrick R. Michaud wrote: : On Tue, Jan 16, 2007 at 10:41:03AM -0800, Larry Wall wrote: : > Note, in case you don't read synopsis checkins: the previous checkin : > majorly changes the semantics of | within regex to support required : >

Re: Major bullet biting on | vs || within regex

2007-01-16 Thread Patrick R. Michaud
On Tue, Jan 16, 2007 at 10:41:03AM -0800, Larry Wall wrote: > Note, in case you don't read synopsis checkins: the previous checkin > majorly changes the semantics of | within regex to support required > longest-token matching semantics rather than left-to-right matching. > This

Major bullet biting on | vs || within regex

2007-01-16 Thread Larry Wall
Note, in case you don't read synopsis checkins: the previous checkin majorly changes the semantics of | within regex to support required longest-token matching semantics rather than left-to-right matching. This is nearly on the same philosophical level as requiring the tail-recursion optimiz

Re: S5: perl5 regex flags

2006-10-07 Thread Jonathan Lang
Larry Wall wrote: On Sat, Oct 07, 2006 at 03:28:04PM -0700, Jonathan Lang wrote: : It's been indicated that several regex modifiers that are found in : Perl5 are gone. That's all well and good, unless you're using the : Perl5 modifier to port code to perl6. What happens if you

Re: S5: perl5 regex flags

2006-10-07 Thread Larry Wall
On Sat, Oct 07, 2006 at 03:28:04PM -0700, Jonathan Lang wrote: : It's been indicated that several regex modifiers that are found in : Perl5 are gone. That's all well and good, unless you're using the : Perl5 modifier to port code to perl6. What happens if you're trying : to

S5: perl5 regex flags

2006-10-07 Thread Jonathan Lang
It's been indicated that several regex modifiers that are found in Perl5 are gone. That's all well and good, unless you're using the Perl5 modifier to port code to perl6. What happens if you're trying to port in a regex that made use of one of the now-obsolete modifiers? Bea

Re: grammar: difference between rule, token and regex

2006-06-02 Thread Rene Hangstrup Møller
Patrick R. Michaud wrote: Jerry is correct that S05 is the place to look for information on this. But to summarize an answer to your question: Thank you very much for the swift and thorough answer. It answered all my questions. Your reply was very pedagogical and deserves to go into the man

Re: grammar: difference between rule, token and regex

2006-06-02 Thread Patrick R. Michaud
>the grammars in Parrot 0.4.4 for punie and APL use rule, token and regex > >elements. > > > >Can someone please clarify the difference between these three types, and > >when you should use one or the other? > > i'm forwarding this to p6l, as it's a lang

Re: grammar: difference between rule, token and regex

2006-06-02 Thread jerry gay
On 6/2/06, Rene Hangstrup Møller <[EMAIL PROTECTED]> wrote: Hi I am toying around with Parrot and the compiler tools. The documenation of Perl 6 grammars that I have been able to find only describe rule. But the grammars in Parrot 0.4.4 for punie and APL use rule, token and regex elements

Re: Implementation of :w in regexes and other regex questions

2006-02-14 Thread Patrick R. Michaud
On Tue, Feb 14, 2006 at 11:35:18AM -0800, David Romano wrote: > On 2/14/06, Luke Palmer <[EMAIL PROTECTED]> wrote: > > On 2/14/06, David Romano <[EMAIL PROTECTED]> wrote: > > > I don't want to just skip tags wholly, because they do > > > serve a purpose, but only in a particular context. (Can >

Re: Implementation of :w in regexes and other regex questions

2006-02-14 Thread David Romano
thought about the closure at the end. > > If that adverb were available, then I could have a rule that doesn't include > > two other rules: > > line:without(&&) { > > ^^ [.*] $$ > > } > > > > > > The rule above would match a

Re: Implementation of :w in regexes and other regex questions

2006-02-14 Thread Luke Palmer
uding your test at the end: rule text_no_date { (.*) { $1 !~ // } } Or if you just don't want one at the beginning: rule text_no_date { > .* } > > If that adverb were available, then I could have a rule that doesn't include > two other rule

Implementation of :w in regexes and other regex questions

2006-02-13 Thread David Romano
Hello everyone, This is my first post to the actual mailing list and not to Google Groups (yeah, took me a bit to figure out they're not the same). I have a few questions about the rules in Perl 6, and hopefully I'm not repeating stuff that's already been brought up before. (I searched through the

Re: Clarification for External Regex Variables?

2005-12-09 Thread Juerd
Brad Bowman skribis 2005-12-09 20:14 (+0100): > $str ~~ my m/ mv @files:=+ $dir:= / > Nah, that's ugly. It's mostly ugly because you're not used to it, I think. my m[mv @files:=+ $dir:=] ~~ $str; Looks nicer, though. Juerd -- http://convolution.nl/maak_juerd_blij.html http://convoluti

Re: Clarification for External Regex Variables?

2005-12-09 Thread Brad Bowman
On 08/12/05 17:12, Larry Wall wrote: > On Thu, Dec 08, 2005 at 11:14:16PM +0100, Brad Bowman wrote: > : it may be acceptable with a "my" in the regex or limiting the > : additions to declaring scope. > > I've gone around about that in my head lots of time, but there

Re: Clarification for External Regex Variables?

2005-12-08 Thread Larry Wall
On Thu, Dec 08, 2005 at 11:14:16PM +0100, Brad Bowman wrote: : Hello, : : I'd like to get clarification on the scoping of variables : bound in a regex. It's described in S05 as follows: : : External aliasing : : * Instead of using internal aliases like: : :

Clarification for External Regex Variables?

2005-12-08 Thread Brad Bowman
Hello, I'd like to get clarification on the scoping of variables bound in a regex. It's described in S05 as follows: External aliasing * Instead of using internal aliases like: m/ mv @:=+ $:= / the name of an ordinary variable can be used as an "exter

Re: regex matching from a position ?

2003-02-12 Thread Ph. Marek
> Phil, please see the perlfunc entry for "pos" and the perlre section > on \G. This is what you need. Thanks a lot! I know about pos but thought it was read-only. And \G is relatively new, isn't it? Certainly wasn't existing in '97 when I learned perl :-) And the "basics" are seldom read again

Re: regex matching from a position ?

2003-02-11 Thread Luke Palmer
> From: "Ph. Marek" <[EMAIL PROTECTED]> > Date: Wed, 12 Feb 2003 08:42:57 +0100 > > --Boundary-00=_BsfS+fOE40iabfr > Content-Type: text/plain; > charset="us-ascii" > Content-Transfer-Encoding: 7bit > Content-Disposition: inline > > Hello everybody, > > I've sometimes the task to analyse a stri

regex matching from a position ?

2003-02-11 Thread Ph. Marek
Hello everybody, I've sometimes the task to analyse a string starting from a given position, where this position changes after each iteration. (like index() does) As this is perl there are MTOWTDIIP but I'd like to know the fastest. So I used Benchmark.pm to find that out. (script attached)

Re: Paren madness (was Re: Regex query)

2002-10-01 Thread Thomas A. Boyer
David Whipp wrote: > $b = 7, 6, 5 > @b = 7, 6, 5 I understand that C's *interpretation* of the comma operator will be expunged from Perl 6. But unless comma's *precedence* is also changing, neither of those statements would build a list with three elements. It seems to me that $b = 7, 6,

Re: Regex query

2002-09-29 Thread Smylers
Luke Palmer wrote: > On 21 Sep 2002, Smylers wrote: > > > But because C<$num> _might_ be used as an array ref, the data has to > > be kept around, which is wasteful. > > The programmer should know whether it would or wouldn't, Oh, I wasn't doubting that. I was just concerned that if the 'typi

Re: Regex query

2002-09-29 Thread Smylers
Aaron Sherman wrote: > On Sat, 2002-09-21 at 06:38, Smylers wrote: > > > ... lists now use square brackets. > > I don't disagree that this is a good thing, but let's look at some > cases that might not look the way you had intended: Oh, I hadn't really intending anything. Starting from what

Re: Paren madness (was Re: Regex query)

2002-09-25 Thread Nicholas Clark
On Mon, Sep 23, 2002 at 11:54:06PM -0600, John Williams wrote: > After testing various cases of x, I came up with one that I cannot > explain. Can someone tell me what is happening here (in perl5)? > > $ perl -le 'print "@{[ $a = ('a','b') x 3 ]}"; print $a' > a bbb > bbb > > or in other words

Re: Paren madness (was Re: Regex query)

2002-09-25 Thread Aaron Sherman
On Tue, 2002-09-24 at 17:27, John Williams wrote: > If I understand our non-conclusions so far, we're waiting for Larry to > clarify: > > 1) how to create a 1-tuple/1-item list? > > 2) how to interpret the flattened list context? e.g. given this: > > > $x = (1,2,3); > > @y = (

Re: Paren madness (was Re: Regex query)

2002-09-24 Thread John Williams
On Tue, 24 Sep 2002, Mike Lambert wrote: > > > > $a = (1, 2, 3); # Same as Perl 5's $a = [1,2,3]; > > $a = (1) should then do $a = [1], according to the above. > > This implies that: > > ($a) = (1) implies that $a is [1], something I don't particularly agree > with. You may be missing the chang

RE: Paren madness (was Re: Regex query)

2002-09-24 Thread David Whipp
> From: Jonathan Scott Duff > > $b = 7, 6, 5 > > @b = 7, 6, 5 > > > > Again, both create identical objects, under different > > interfaces. But now we have a problem with +$b: what should > > this mean? To be consistant with +$a (above), I would > > suggest that it simply returns the sum of

Re: Paren madness (was Re: Regex query)

2002-09-24 Thread Trey Harris
In a message dated Tue, 24 Sep 2002, Mike Lambert writes: > Consider: > $a = (1); > and > ($a) = (1); Yes? They both do the same thing--set $a to 1. It looks like the bottom one is a list assigned to a list, but that might be optimized out, as it doesn't matter. > > 5. Assignment to arrays an

Re: Paren madness (was Re: Regex query)

2002-09-24 Thread Mike Lambert
> 2. Scalar assignment. > > my $a;# 1. > $a = X; > > my $a;# 3. > ($a) = X; > > These should all do the same thing, regardless of X. Consider: $a = (1); and ($a) = (1); > 5. Assignment to arrays and lists. > > $a = (1, 2, 3); # Same as Perl 5's $a = [1,2,3];

RE: Paren madness (was Re: Regex query)

2002-09-24 Thread Aaron Sherman
On Tue, 2002-09-24 at 14:47, David Whipp wrote: > It seems that the fundamental problem is the dichotomy between > a scalar, and a list of 1 elem. Thus, we want After the first couple of messages, that was really no longer *my* concern, but I can't speak for others. My concern was mostly that par

Re: Paren madness (was Re: Regex query)

2002-09-24 Thread Jonathan Scott Duff
On Tue, Sep 24, 2002 at 11:47:16AM -0700, David Whipp wrote: > It seems that the fundamental problem is the dichotomy between > a scalar, and a list of 1 elem. Thus, we want > > $a = 7 > > to DWIM, whether I mean a list, or a scalar. Seems to me that > the best way to solve a dichotomy is to d

RE: Paren madness (was Re: Regex query)

2002-09-24 Thread David Whipp
It seems that the fundamental problem is the dichotomy between a scalar, and a list of 1 elem. Thus, we want $a = 7 to DWIM, whether I mean a list, or a scalar. Seems to me that the best way to solve a dichotomy is to declare it to not to be one: a scalar *IS* a list of one element. The only t

Re: Regex query

2002-09-24 Thread John Williams
> > In a message dated Tue, 24 Sep 2002, Chip Salzenberg writes: > > > > then what about > > > > > >$a = (1) > > > > > > ? And if someone says that I have to write: > > > > > >$a = (1,) > > > > > > then I am going on the warpath. That Way Lay Python. You _can_ write that, but you don't

Re: Regex query

2002-09-24 Thread Jonathan Scott Duff
On Tue, Sep 24, 2002 at 12:14:10PM -0400, Trey Harris wrote: > In a message dated Tue, 24 Sep 2002, Jonathan Scott Duff writes: > > > On Tue, Sep 24, 2002 at 11:14:04AM -0400, Aaron Sherman wrote: > > > Again, we're wading into the waters of over-simplification. Let's try: > > > > > > sub

Re: Regex query

2002-09-24 Thread Trey Harris
In a message dated Tue, 24 Sep 2002, Jonathan Scott Duff writes: > On Tue, Sep 24, 2002 at 11:14:04AM -0400, Aaron Sherman wrote: > > Again, we're wading into the waters of over-simplification. Let's try: > > > > sub foo1(){ my @foo=(1,2,3); return @foo; } > > sub foo2(){ my $foo

Re: Regex query

2002-09-24 Thread Jonathan Scott Duff
On Tue, Sep 24, 2002 at 11:14:04AM -0400, Aaron Sherman wrote: > Again, we're wading into the waters of over-simplification. Let's try: > > sub foo1(){ my @foo=(1,2,3); return @foo; } > sub foo2(){ my $foo = [1,2,3]; return $foo; } > sub foo3(*@list) { print @list.length,

Re: Regex query

2002-09-24 Thread Trey Harris
In a message dated 24 Sep 2002, Aaron Sherman writes: > That doesn't really work. Because now you introduce the case where: > > $x = (1,2,3); > @y = (1,2,3); > $z = [1,2,3]; > push @a, $x, @y, $z, (1,2,3), [1,2,3]; > > Behaves in ways that will take hours to explain to newb

Re: Regex query

2002-09-24 Thread Aaron Sherman
On Tue, 2002-09-24 at 11:07, Trey Harris wrote: > In a message dated Tue, 24 Sep 2002, Chip Salzenberg writes: > > then what about > > > >$a = (1) > > > > ? And if someone says that I have to write: > > > >$a = (1,) > > > > then I am going on the warpath. That Way Lay Python. I would *

Re: Regex query

2002-09-24 Thread Dan Sugalski
At 11:07 AM -0400 9/24/02, Trey Harris wrote: > >*shrug* Regardless of whether we like it, what Larry said is true unless >and until he invokes Rule 2. And unless he invokes Rule 2, >C is equivalent to C<[1,2,3]>. Then perhaps, rather than fretting over the unpleasant consequences of the curren

Re: Regex query

2002-09-24 Thread Aaron Sherman
On Tue, 2002-09-24 at 10:27, Peter Haworth wrote: > On 24 Sep 2002 05:21:37 -0400, Aaron Sherman wrote: > > On Tue, 2002-09-24 at 01:46, Trey Harris wrote: > > > sub push(@target is rw, *@list); > > > > Well, yes, but that wasn't the point. The C<*@list> will force array > > flattening, thus >

Re: Regex query

2002-09-24 Thread Trey Harris
In a message dated Tue, 24 Sep 2002, Chip Salzenberg writes: > According to Trey Harris: > > According to Larry, > > $a = (1,2,3); > > is equivalent to > > $a = [1,2,3]; > > because they're both equivalent to > > $a = scalar(1,2,3) > > But that's the bit we're arguing about. If you allow >

Re: Regex query

2002-09-24 Thread Chip Salzenberg
According to Trey Harris: > According to Larry, > $a = (1,2,3); > is equivalent to > $a = [1,2,3]; > because they're both equivalent to > $a = scalar(1,2,3) But that's the bit we're arguing about. If you allow $a = (1,2) then what about $a = (1) ? And if someone says that I have

Re: Regex query

2002-09-24 Thread Peter Haworth
On 24 Sep 2002 05:21:37 -0400, Aaron Sherman wrote: > On Tue, 2002-09-24 at 01:46, Trey Harris wrote: > > sub push(@target is rw, *@list); > > Well, yes, but that wasn't the point. The C<*@list> will force array > flattening, thus > > push @a, [1,2,3], 4; > > will (according to Larry's

Re: Regex query

2002-09-24 Thread Jonathan Scott Duff
On Tue, Sep 24, 2002 at 11:30:57AM +0100, Simon Cozens wrote: > At any rate, I do wish we'd stop kidding ourselves that Perl 6 is at all > going to be "cleaned up" or "regular"; I bet it'll end up with more edge > cases and special exceptions than Perl 5. Simon, Perl 6 *will* be more "regular" as

Re: Regex query

2002-09-24 Thread Simon Cozens
[EMAIL PROTECTED] (Aaron Sherman) writes: > > If we have to resort to much magic to get these right, we're pretty much > > doomed from the outset. > > You have that upside-down. Because this is so fundamental, it's worth a > great deal of magic to make it "seem right" in as many contexts as > pos

Re: Regex query

2002-09-24 Thread Simon Cozens
[EMAIL PROTECTED] (Aaron Sherman) writes: > say that array refs behave the same as arrays in every way *except* as > pertains to list flattening, and in that case, explicit flattening is > required, otherwise the ref is kept in the flattened array. Another blow to regularity. :( -- buf[

Re: Regex query

2002-09-24 Thread Aaron Sherman
On Tue, 2002-09-24 at 01:46, Trey Harris wrote: > In a message dated 24 Sep 2002, Aaron Sherman writes: > > This is because push is > > almost certainly defined as: > > > > sub push(@target, *@list) { ... } > > That should be > > sub push(@target is rw, *@list); Well, yes, but that wa

Re: Regex query

2002-09-23 Thread Aaron Sherman
On Sun, 2002-09-22 at 08:07, Simon Cozens wrote: > [EMAIL PROTECTED] (Jonathan Scott Duff) writes: > > Why can't perl be smart enough to figure out what we mean? > > We're talking about lists, the second most fundamental data structure > in the language. > > If we have to resort to much magic to

Re: Paren madness (was Re: Regex query)

2002-09-23 Thread John Williams
On Mon, 23 Sep 2002, Trey Harris wrote: > > So then, I think if there's just some clarification about how one-tuples > are formed, I think everything I wrote in my earlier mail can DWIM > correctly. There seems to be no magic here, quotations from LoTR to the > contrary. :-) Your post was very h

Re: Regex query

2002-09-23 Thread Trey Harris
In a message dated 24 Sep 2002, Aaron Sherman writes: > This is because push is > almost certainly defined as: > > sub push(@target, *@list) { ... } That should be sub push(@target is rw, *@list); but otherwise I think that's right. Now, implementation in Perl 6 (though I assume it's

Re: Regex query

2002-09-23 Thread Aaron Sherman
On Sat, 2002-09-21 at 06:18, Smylers wrote: > $num = @massive; > > C<$num> becomes a reference to C<@massive>, but in a numeric context it > will evaluate to the number of elements in that array. > But in most cases, you would never do this. You would do something like my int $num =

Re: Regex query

2002-09-23 Thread Trey Harris
In a message dated 24 Sep 2002, Aaron Sherman writes: > Grrr... I want that to work, really I do, but since, as Larry has > pointed out, there's no functional difference between an array ref and > an array in Perl 6, they would be the same. This is because push is > almost certainly defined as: >

Re: Paren madness (was Re: Regex query)

2002-09-23 Thread Trey Harris
Replying to myself to clear a few things up... In a message dated Mon, 23 Sep 2002, Trey Harris writes: > 2. Scalar assignment. > > my $a;# 1. > $a = X; > > my $a;# 2. > $a = X; > > my $a;# 3. > ($a) = X; > > my($a) = X; # 4. > > my($a)

Re: Regex query

2002-09-23 Thread Aaron Sherman
On Mon, 2002-09-23 at 15:48, Luke Palmer wrote: > On 23 Sep 2002, Simon Cozens wrote: > > > [EMAIL PROTECTED] (Luke Palmer) writes: > > > Since we now have an explicit flattening operator (unary *), there's no > > > need to differentiate between a "real" list and a reference to one. > > > > Wha

Re: Paren madness (was Re: Regex query)

2002-09-23 Thread Aaron Sherman
On Mon, 2002-09-23 at 16:58, Trey Harris wrote: > 4. Numeric value. > > The progression spoken about at great length previously: > > +()# == 0 > +(0) # == WHAT? 0? 1? > +(0,1) # == 2 > +(0,1,2) # == 3 > +(0,1,2,3) # == 4 > +(0,...,n) # == n + 1 > >

Re: Paren madness (was Re: Regex query)

2002-09-23 Thread Trey Harris
In a message dated Mon, 23 Sep 2002, Luke Palmer writes: > Y'all have it backwards. > > [1,*[2,[3,4,5]],6] # [1,2,[3,4,5],6] > [1,*[2,*[3,4,5]],6] # [1,2,3,4,5,6] > > Flat flattens outwards, not inwards. Ah. *slaps head* of course. That makes much more sense

Re: Regex query

2002-09-23 Thread Luke Palmer
On 24 Sep 2002, Simon Cozens wrote: > [EMAIL PROTECTED] (Luke Palmer) writes: > > push @a: [1,2,3,4]; > > > > pushes an array ref onto @a. > > > > push @a: *[1,2,3,4]; > > > > pushes 1, 2, 3, and 4 onto @a (as it would without the * and []). > > Remind me which language this is suppos

Re: Paren madness (was Re: Regex query)

2002-09-23 Thread Luke Palmer
On Mon, 23 Sep 2002, Jonathan Scott Duff wrote: > On Mon, Sep 23, 2002 at 04:58:55PM -0400, Trey Harris wrote: > > for (1,("a","b","c"),3 { ... } > > > > and > > > > for 1,("a","b","c"),3 { ... } > > > > Now that I've ventured away from DWIMs and more into WIHDTEMs (What In > > Hell Does T

Re: Paren madness (was Re: Regex query)

2002-09-23 Thread Jonathan Scott Duff
On Mon, Sep 23, 2002 at 04:58:55PM -0400, Trey Harris wrote: > for (1,("a","b","c"),3 { ... } > > and > > for 1,("a","b","c"),3 { ... } > > Now that I've ventured away from DWIMs and more into WIHDTEMs (What In > Hell Does This Expression Mean), is the above equivalent to > > for 1,qw(a

Re: Paren madness (was Re: Regex query)

2002-09-23 Thread Simon Cozens
[EMAIL PROTECTED] (Trey Harris) writes: > May I suggest that we start with some DWIMmy examples Sam sat on the ground and put his head in his hands. 'I wish I had never come here, and I don't want to see no more magic,' he said, and fell silent. -- I hooked up my accelerator pedal in my car to

Re: Regex query

2002-09-23 Thread Simon Cozens
[EMAIL PROTECTED] (Luke Palmer) writes: > push @a: [1,2,3,4]; > > pushes an array ref onto @a. > > push @a: *[1,2,3,4]; > > pushes 1, 2, 3, and 4 onto @a (as it would without the * and []). Remind me which language this is supposed to be, again? -- "Life sucks, but it's better th

Paren madness (was Re: Regex query)

2002-09-23 Thread Trey Harris
I think this discussion has gotten out of hand, and I hope that Larry, Damian or Allison will grace us with a resolution soon. :-) May I suggest that we start with some DWIMmy examples and try to arrive at a mechanism that will make them all DWIM? Here are my opinions, feel free to shoot them do

Re: Regex query

2002-09-23 Thread Luke Palmer
On 23 Sep 2002, Simon Cozens wrote: > [EMAIL PROTECTED] (Luke Palmer) writes: > > Since we now have an explicit flattening operator (unary *), there's no > > need to differentiate between a "real" list and a reference to one. > > What context does "push" impute on its operands? > > If > p

Re: Regex query

2002-09-23 Thread Aaron Sherman
On Sat, 2002-09-21 at 06:38, Smylers wrote: > So if the difference between lists with parens and anon arrays with > square brackets is going away, it may make sense to standardize on the > latter rather than the former. In other words, lists now use square > brackets. > > That frees up parens f

Re: hotplug regexes, other misc regex questions

2002-09-23 Thread Andrew Pimlott
On Wed, Sep 18, 2002 at 05:01:35PM +0200, Damian Conway wrote: > Steve Fink wrote: > > print "yes" if "helo" =~ /hel { .pos-- } lo/; > > This definitely has to work. But remember the call to C is on > the "match object" (i.e. $0), not the string. > > Actually, I would expect that *any* pattern

  1   2   3   >