in my mind, this strays too far from the meaning of C// and adds
ambiguity that makes the operator unusable. perhaps there's room for
an operator that gives some sugar for
my $bill = try { ack() CATCH { thpp() } };
but to me that code is concise enough that it doesn't warrant syntactic
I disagree with the idea that humans don't think concurrently (though
more often they think in terms of data dependencies).
I think this is more analogous to event based programming rather than parallel
programming. Event based and parallel based have some similarities but the
are
Other available chars:
`ws
^ws
ws
*ws
-ws
|ws
:ws
;ws
/ws
I'd vote for :ws which is vaguely reminiscent of the former non-capturing
parens (?:).
It (:ws) also bears little similarity to any other regex construct -
although it looks a bit like a
The outcome is that poddoc can be Pod6 pure and perldoc can be (as its
name suggests) documentation for Perl.
I failed to mention that it also has the benefit that developers can read the
perldoc if they care about method details - or they could read poddoc if they
only want a 7000 ft view
The outcome is that poddoc can be Pod6 pure and perldoc can be (as its
name suggests) documentation for Perl.
Sorry to reply to myself twice.
Making poddoc independent of Perl 6 opens the doors a little further for
having pythondoc and phpdoc and yourlanguageheredoc which extract the POD
foreach my $item (@items) {
#process each item
} else {
#handle the empty list case
}
What do you think?
I'm not sure if I like it, but there have been several times that I would've
used it recently. I think it would certainly have utility.
Paul
While I'm in general agreement with everything you've said it makes me a
tad nervous to hinge so much on the difference of one character. Can you
imagine trying to track down the bug where
if ($alpha === $beta) { ... }
really should have been
if ($alpha == $beta) { ... }
So maybe we have some or all of:
.keys .sortkeys
.values .sortvalues
.kv .sortkv
.pairs.sortpairs
Possible variations: .skeys, .ordkeys, etc. Also could flip the
default and make .keys sort by default and then you use .rawkeys to get
Yes. He also accepted the proposal to add min and max operators -
although I'm unsure why they weren't included as functions/methods
instead. It seems more natural to me to say 'max($a, $b, $c)' or
'($a, $b, $c).max' instead of '[max] $a, $b, $c' or '$a max $b max
$c'. Although it _does_
my ($a, undef, $b) = 1..3;
Huh. I didn't think that worked in Perl 5, either. What am I
misremembering? I distinctly recall having to do things like (my $a, undef,
my $b) to avoid errors because you can't assign to undef. Maybe I'm just
hallucinating.
Are you remembering this:
my
First, when a role is applied to a class at runtime, a instance of that
class in another scope may specifically *not* want that role. Is there a
way of restricting a role to a particular lexical scope short of applying
that role to instances instead of classes?
Seems like you could use an
It may be more useful to discuss this issue using less contrived
examples. :)
I would agree. I haven't had any use for a double if or a double for.
The double if case is handled by . The double for case is handled
by for and map.
The interesting cases are combinations of if and for and
Of course, that wasn't exactly what you were asking, but it does present
a practical solution when you want to:
{say $_ for =}.() if $do_read_input;
Which I just verified works fine under current pugs.
Thank you.
Hadn't thought of that. I think that is workable.
But it also brings
It relates to some old problems in the early part of the RFC/Apocalypse
process, and the fact that:
say $_ for 1..10 for 1..10
Was ambiguous. The bottom line was that you needed to define your
parameter name for that to work, and defining a parameter name on a
modifier means that you
From my early conversations with Larry, I recall that the reason is that
RSTS/E BASIC-PLUS had nested trailing modifiers, and both Larry and I saw
many abuses of these over the years. Therefore, he decided not to repeat
that abomination, limiting it to precisely one level deep. I'm happy for
Yeah, every once in a while, I've wanted the second layer, but I'm
willing to rewrite the statement as a true normal if/while instead of a
backwards if/while, and it *does* help the overall readability.
I'd concede that the actual useful uses are rare enough to not warrant
giving a
it?
Paul Seamons
Section of pge2past.tg that re-writes the expression to be enclosed by an if
block:
transform past (Perl6::Grammar::statement) :language('PIR') {
$P0 = node['statement_control']
if $P0 goto statement_control
$P0 = node['block']
if $P0 goto statement_block
$P0
This was definitively rejected by Larry in 2002:
Yes. That is good to see and I do think I remember seeing that or some similar
postings come to think of it. Thank you for shaking my memory.
Now it is 2006. Object syntax has changed. Little bits and pieces (and
sometimes larger chunks) of
$no or $false or $yes and $true and say OK then ;
$no or $false or say OK then if $yes and $true ;
Thank you for your reply.
I know there are other ways to do it. I've had no choice but to do it other
ways in Perl5.
I don't think I have ever used that notation (outside of file open and
similar to read only strings.
Paul Seamons
could be cut down
considerably if all you want to parse is math (no variables).
Paul Seamons
I don't think this example reads very clearly. Visually you have to parse
until you see the next = and then back track one word to figure out the key.
move( from= $x, $y, delta= $up, $right );
Personally I'd write that as either
move(from = [$x, $y], delta = [$up, $right]);
OR
On Thursday 21 July 2005 12:48 pm, Larry Wall wrote:
* Don't need to topicalize self any more.
* .foo can (again) always be the topic without warnings.
Thank you.
Do the following exist then:
has @x; # private, lexically scoped
has @_x; # private, class scoped, rw _x accessor
I'd have to agree.
I also think that .foo should always mean $_.foo in methods, without causing
any errors if $?SELF =:= $_ becomes false.
OK. There is a lot of historical threads on the subject and already a lot of
legacy in the Perl6 language.
OK - As I understand it, this is what A12
We should approach this from the perspective that $fh is an iterator, so
the general problem is how do we navigate a random-access iterator?.
Well - I kind of thought that $fh was a filehandle that knew how to behave
like an iterator if asked to do so. There are too many applications that
So, if we continue following this API, Perl6 core will contain time(),
but no localtime() nor gmtime(). The Date module will provide human
readable date and time strings, and basic date math.
localtime() and gmtime() seem fairly core to me. The array contexts are
simple, and the scalar
=item *
Quantifiers (except C? and C??) cause a matched subrule or subpattern to
return an array of CMatch objects, instead of just a single object.
What is the effect of the quantifiers C**{0,1} and C**{0,1}? ? Will they
behave like ? and ?? and return a single object - or will they cause
Minor note.
Would you want this:
sub infix:myeq(Str $a, Str $b) { return ($a eq $b) ? $a : ''; }
to be:
sub infix:myeq(Str $a, Str $b) { return ($a eq $b) ? $a but bool::true:
''; }
(Is that the right way to do it ?)
Paul
I think the original (or the latest original) reason for breaking .meth from
meaning $_.meth is that $_ is transitory and there was no way back to the
nameless invocant. In the absense of having a way back, I and others
strongly advocated breaking the link. I think we hated to do it.
Now if
What is this way back you repeatedly mention?
If it is having a name for the invocant, then there has always been one:
method foo ($self:) {
for (1..10) {
$self.method(.sqrt)
}
}
Or, well, two:
method foo {
my $self := $_;
...
Paul Seamons wrote:
Yes, I know there can be a way back. In this thread, none of the
examples give one using existing Perl 6 syntax. They are all proposing new
ways. This is one more.
Sorry if this sounded brash. I have a habit of not figuring out that there is
more of the message to read
The following chunks behave the same in Perl 5.6 as in Perl 5.8. Notice the
output of branching statement modifiers vs. looping statement modifiers.
perl -e '$f=1; {local $f=2; print $f} print - $f\n'
# prints 2 - 1
perl -e '$f=1; {local $f=2 if 1; print $f} print - $f\n
# prints 2 - 1
On Friday 15 April 2005 11:57 am, Juerd wrote:
Paul Seamons skribis 2005-04-15 11:50 (-0600):
my %h = a 1 b 2 c 3;
{
temp %h{$_} ++ for %h.keys;
Just make that two lines. Is that so bad?
temp %h;
%h.values »++;
For the given example, your code fits perfectly. A more common
temp %h;
%h{ %other.keys } = %other.values;
or even
temp %h{ %other.keys } = %other.values;
should work well already?
Almost - but not quite.
In Perl5
perl -MData::Dumper -e '%h=qw(a 1 b 2); {local %h; $h{a}=one; print Dumper
\%h} print Dumper \%h;
$VAR1 = {
'a' =
On Friday 15 April 2005 12:28 pm, Juerd wrote:
temp %h{ %other.keys } = %other.values;
Oops missed that - I like that for solving this particular problem. It does
even work in Perl5:
perl -MData::Dumper -e '%h=qw(a 1 b 2); {local @h{qw(a b)}=(one,two);
print Dumper \%h} print Dumper \%h'
I'm imagining it will be different, as I expect temp to not hide the old
thing. I'm not sure it will.
That is another good question. I just searched through the S and A's and
couldn't find if temp will blank it out. I am thinking it will act like
local. Each of the declarations my, our and
as the invocant for most of the time.
Paul Seamons
I'll go back to lurking about now.
eval read :file(foo)
How about:
eval slurp foo;
Paul Seamons
be a full fledged class
which inherits from Some::Module::That::Defines::A::Class. I doubt that it
is optimal - but it does give a little bit of flexibility.
Paul Seamons
'); # index 3 gets 'value'
# which is harder han @array[3] = 'value'
Paul Seamons
On Thursday 19 August 2004 02:14 pm, Paul Seamons wrote:
@array.push(3 = 'value'); # index 3 gets 'value'
Hmm. Well that makes it hard to have an array of pairs - so never mind.
Paul Seamons
Or for the few Perl emacs people out there:
C-x 8 Y
C-x 8
C-x 8
Paul
On Tuesday 01 June 2004 10:27 am, Gabriel Ebner wrote:
Hello,
Aaron Sherman wrote:
Well, first off my US keyboard doesn't contain it.
Sorry, mistakenly picked an US-International chart.
Second, you're not supposed
42 matches
Mail list logo