SC == Simon Cozens [EMAIL PROTECTED] writes:
SC raiddev /dev/md0
SC raid-level 5
SC option value
SC option value
SC ...
SC device /dev/sde1
SC raid-disk 0
i have some
SC == Simon Cozens [EMAIL PROTECTED] writes:
SC rule comm_eol { sp* comment? sp* \n };
aren't those sp*'s redundant? the first is overlapping with the one at
the beginning of comment.
SC But comment only matches if there *is* a comment, and there may not
SC be, so I want to
[EMAIL PROTECTED] (Uri Guttman) writes:
actually i just had another thought. you don't need any of the $foo :=
stuff as the match tree will have it all for you.
Yes, but it's nice to be able to access the captured things by
name. Or should I be saying things like
rule raiddev { comment*
SC == Simon Cozens [EMAIL PROTECTED] writes:
SC [EMAIL PROTECTED] (Uri Guttman) writes:
actually i just had another thought. you don't need any of the $foo :=
stuff as the match tree will have it all for you.
SC Yes, but it's nice to be able to access the captured things by
SC
On 20 Sep 2002, Simon Cozens wrote:
: their names. also if you use a scalar to grab something which is in a
: quantified outer rule what is put in the var? a ref to a list of the
: grabbed things?
:
: *nod* Something I'd like to know.
Yes, in fact any list forced into scalar context will
On Sun, 15 Sep 2002, Steve Fink wrote:
: What should this do:
:
: my $x = the letter x;
: print yes if $x =~ /the { $x .= ! } .* !/;
Depends. I think it may be necessary for speed and safety reasons
to set COW on the string we're matching, so that you're always matching
against the
On Fri, 2002-09-20 at 04:14, Larry Wall wrote:
On 20 Sep 2002, Simon Cozens wrote:
: their names. also if you use a scalar to grab something which is in a
: quantified outer rule what is put in the var? a ref to a list of the
: grabbed things?
:
: *nod* Something I'd like to know.
On Thu, 19 Sep 2002, Brent Dax wrote:
: Aaron Sherman:
: # topicalize: To default to C$_ in a prototype (thus
: # acquiring the caller's current topic).
:
: Well, to topicalize a region of code is actually to specify a different
: topic, that is, a different value for $_. For example:
:
:
On 20 Sep 2002, Aaron Sherman wrote:
: Is that any list as oppopsed to any array? Or is that arrayref in a
: numeric context the length of the array? In other words does this do
: what I think I think it does?
:
: $shouldbe3 = (1,2,3) + 0;
It's 3, though not for the reason a Perl 5
Larry Wall:
# That binds the dynamically surrounding $_ to $x as an
# out-of-band parameter. Can also bind to $_ to make it the
# current topic.
The problem I have with that is this:
sub for_trace(*@array, block) {
loop($_=0; $_ @array; $_++) {
On Fri, 2002-09-20 at 10:36, Larry Wall wrote:
On Thu, 19 Sep 2002, Brent Dax wrote:
: (An aside: it strikes me that you could use Cgiven as a scoped lexical
: alias, i.e.
: given $bar - $foo {
: print $foo;
: }
Sure, though it also aliases to $_.
Does that mean
On Fri, 2002-09-20 at 10:39, Larry Wall wrote:
On 20 Sep 2002, Aaron Sherman wrote:
: Is that any list as oppopsed to any array? Or is that arrayref in a
: numeric context the length of the array? In other words does this do
: what I think I think it does?
:
: $shouldbe3 = (1,2,3) + 0;
On Fri, 20 Sep 2002, Brent Dax wrote:
: Larry Wall:
: # That binds the dynamically surrounding $_ to $x as an
: # out-of-band parameter. Can also bind to $_ to make it the
: # current topic.
:
: The problem I have with that is this:
:
: sub for_trace(*@array, block) {
:
On Fri, 20 Sep 2002, Larry Wall wrote:
But if a fast implementation needs to keep pointers into a string
rather than offsets from the beginning, we're asking for core dumps if
the string is modified out from under the pointers, or we have to
adjust all known pointers any time the string may
On 20 Sep 2002, Aaron Sherman wrote:
: On Fri, 2002-09-20 at 10:36, Larry Wall wrote:
: On Thu, 19 Sep 2002, Brent Dax wrote:
:
: : (An aside: it strikes me that you could use Cgiven as a scoped lexical
: : alias, i.e.
: : given $bar - $foo {
: : print $foo;
: : }
:
: Sure,
On Fri, 20 Sep 2002, Larry Wall wrote:
Yes, in fact any list forced into scalar context will make a ref in Perl 6:
$arrayref = (1,2,3);
That would seem to obviate the need for brackets to define array
references. Is there any case where [1,2,3] would be needed instead of
(1,2,3)?
Also,
On 20 Sep 2002, Aaron Sherman wrote:
: I assumed that's what C//=$_ was. It does have the disadvantage of
: looking like variable assignment, though.
BTW, latest leaning is toward = rather than //= for parameter defaults,
since it can, in fact, be undef if the parameter is supplied, while //=
On Fri, 20 Sep 2002, Sean O'Rourke wrote:
: On Fri, 20 Sep 2002, Larry Wall wrote:
: But if a fast implementation needs to keep pointers into a string
: rather than offsets from the beginning, we're asking for core dumps if
: the string is modified out from under the pointers, or we have to
:
On Fri, 20 Sep 2002, Larry Wall wrote:
The current thinking as of Zurich is that the given passes in
separate from the ordinary parameters:
sub ($a,$b,$c) is given($x) {...}
That binds the dynamically surrounding $_ to $x as an out-of-band
parameter. Can also bind to $_ to make it the
Larry said:
BTW, latest leaning is toward = rather than //= for parameter
defaults, ...
Horray!
Sorry. Couldn't resist. :-)
-angel
Simple men are happy with simple presents
On Fri, 20 Sep 2002, John Williams wrote:
: On Fri, 20 Sep 2002, Larry Wall wrote:
:
: Yes, in fact any list forced into scalar context will make a ref in Perl 6:
:
: $arrayref = (1,2,3);
:
: That would seem to obviate the need for brackets to define array
: references. Is there any
On Fri, 20 Sep 2002, Sean O'Rourke wrote:
: On Fri, 20 Sep 2002, Larry Wall wrote:
: The current thinking as of Zurich is that the given passes in
: separate from the ordinary parameters:
:
: sub ($a,$b,$c) is given($x) {...}
:
: That binds the dynamically surrounding $_ to $x as an
On Fri, 20 Sep 2002, Larry Wall wrote:
On Fri, 20 Sep 2002, John Williams wrote:
: On Fri, 20 Sep 2002, Larry Wall wrote:
:
: Yes, in fact any list forced into scalar context will make a ref in Perl 6:
:
: $arrayref = (1,2,3);
:
: That would seem to obviate the need for brackets
Personally, I like the looks of
sub foo($a, $b is given) { ... }
Does this mean that we allow/encourage uses of $_ other than as a default
for an optional argument? I think it would be less confusing and
error-prone to associate the underscore-aliasing with the parameter $_
will
John Williams wrote:
On Fri, 20 Sep 2002, Larry Wall wrote:
On Fri, 20 Sep 2002, John Williams wrote:
: On Fri, 20 Sep 2002, Larry Wall wrote:
:
: Yes, in fact any list forced into scalar context will make a ref in Perl 6:
:
: $arrayref = (1,2,3);
:
: That would seem to obviate the
I was just thinking that $((1,2,3)) is also the same as [1,2,3],
and shorter than scalar(1,2,3).
I wonder if you can't just use $(1, 2, 3) to the same effect.
I think you can. I was under the impression that the C comma was dying,
so that would have to make a list or err.
Also, I
Here is a discussion thread of Exegesis 5
http://www.perl.com/pub/a/2002/08/22/exegesis5.html at
http://developers.slashdot.org/developers/02/08/23/1232230.shtml?tid=145
But the signal/noise is too low, with side tracks into
Monty Python etc.
In section Smarter alternatives there is this
According to Luke Palmer:
I think to get Perl5 behavioueaur :), you do this:
my @flatL = ( *(1a, 2a), *(1b, 2b) );
Geez, I hope not, because that would imply that in
my @v = ( func() );
that func is called in a scalar context.
--
Chip Salzenberg - a.k.a. -[EMAIL
Larry wrote:
: $shouldbe3 = (1,2,3) + 0;
It's 3, though not for the reason a Perl 5 programmer would think.
(In Perl 6 it's the length of the anonymous array, not the
last value.)
This kind of clever magic always makes me nervous:
it introduces subtle bug potentials.
(7,8,9) == 3 #
According to David Whipp:
(7,8,9) == 3 # true
(7,8) == 2 # true
(7) == 1 # false
() == 0 # true?
Hell, yes, why didn't I think of that? This is exactly the same
problem that afflicts Python's tuple syntax!
Larry, I strongly suggest that making () act in any way like []
On Fri, 20 Sep 2002, Chip Salzenberg wrote:
According to Luke Palmer:
I think to get Perl5 behavioueaur :), you do this:
my flatL = ( *(1a, 2a), *(1b, 2b) );
Geez, I hope not, because that would imply that in
my v = ( func() );
that func is called in a scalar context.
On Fri, 20 Sep 2002, David Whipp wrote:
Larry wrote:
: $shouldbe3 = (1,2,3) + 0;
It's 3, though not for the reason a Perl 5 programmer would think.
(In Perl 6 it's the length of the anonymous array, not the
last value.)
This kind of clever magic always makes me nervous:
it
This kind of clever magic always makes me nervous:
it introduces subtle bug potentials.
(7,8,9) == 3 # true
(7,8) == 2 # true
(7) == 1 # false
() == 0 # true?
I believe the last two cases should be:
(7,)== 1
(,) == 0
Because its the perl6
According to John Williams:
I believe the last two cases should be:
(7,)== 1
(,) == 0
Gack! It's Python's tuple syntax! Run away! Run away!
Seriously, having actually programmed Python for money (no smiley --
it was NOT fun), I can say that this syntactical hack would be a
On Fri, Sep 20, 2002 at 09:02:52PM -0600, John Williams wrote:
On Fri, 20 Sep 2002, Tanton Gibbs wrote:
If this is the case, then can you also have:
(,7)
What is its length?
Hmm, it's a syntax error in perl5.
I'd advocate it continuing to be a syntax error in perl 6.
Maybe ()
On Fri, Sep 20, 2002 at 02:17:42PM -0700, David Whipp wrote:
Larry wrote:
: $shouldbe3 = (1,2,3) + 0;
It's 3, though not for the reason a Perl 5 programmer would think.
(In Perl 6 it's the length of the anonymous array, not the
last value.)
This kind of clever magic always makes
This kind of clever magic always makes me nervous:
it introduces subtle bug potentials.
(7,8,9) == 3 # true
(7,8) == 2 # true
(7) == 1 # false
Why is this one false? I'd expect it to be true just as the others.
(7) == 7
why? Otherwise, we couldn't use parens for
On Fri, 20 Sep 2002, Jonathan Scott Duff wrote:
But I cannot tell whether (7) is list context or numeric context,
Nope, you can't tell without the surrounding context:
(7) + 0;# numeric
$a = (7); # list
(7) == 1; # boolean (same as (7).length == 1)
38 matches
Mail list logo