Dov Wasserman writes:
Larry Wall [EMAIL PROTECTED] wrote in message
news:[EMAIL PROTECTED]
next D next N all D all N
== == = =
$iter $iter.pull ?1
-BEGIN PGP SIGNED MESSAGE-
Hash: SHA1
On 19 Aug 2004, at 18:04, Luke Palmer wrote:
The one in Perl 5 that stands out most was the cause for the only patch
I ever sent to p5p: the rand function. rand $x will give you a
uniformly distributed random number in [0, $x) for any $x EXCEPT 0. If
On Thu, 2004-08-19 at 12:17 -0400, Matt Diephouse wrote:
At this point, you may as well use C.records (think C$/ -- record
separator):
for $foo.records { ... }
Then it'd be a small step to allow:
for $foo.records :sep, { ... }
--or--
for $foo.records(,) { ...
Larry Wall [EMAIL PROTECTED] wrote:
Final blocks on statement-level constructs always imply semicolon
precedence afterwards regardless of the position of the closing curly.
Statement-level constructs are distinguished in the grammar by being
declared in the statement syntactic group:
Larry Wall wrote:
=head1 Title
Synopsis 4: a Summary of Apocalypse 4
A little light reading is always good in the morning ;-)
To return a value from a pointy sub or bare closure, you either
just mention the value last that you want to return, or you can
use Cleave. A Cleave by default exits
On 8/19/04, [EMAIL PROTECTED] (Luke Palmer) wrote:
David Green writes:
Hang on -- should we be saying for each $foo or for $foo.each
anyway? We don't say for @foo.each; the iteration is implicit. So
I'm thinking it should be for $foo or while next $foo.
Well, Cfor $foo gives you a
On 8/19/04, [EMAIL PROTECTED] (Larry Wall) wrote:
It's hard to come up with an English word that means next in scalar
context but all in list context.
I never know whether to name my arrays singular or plural, either. =)
But couldn't there be Two Ways To Do It? One singular name and one
On Thu, Aug 19, 2004 at 07:45:37PM -0700, Larry Wall wrote:
BEGIN {...}*at compile time, ASAP
CHECK {...}*at compile time, ALAP
INIT {...}*at run time, ASAP
END {...} at run time, ALAP
FIRST {...}*at first block entry time
ENTER
Parameters are by default constant within the block. You can
declare a parameter read/write by including the Cis rw trait.
If you rely on C$_ as the implicit parameter to a block, then
then C$_ is considered read/write by default. That is,
the construct:
for @foo {...}
is actually
On Fri, Aug 20, 2004 at 09:21:02AM +0100, Matthew Walton wrote:
: It would be nice if rand behaved a bit more sanely in Perl 6. I can
: understand the reasoning for making rand 0 produce between 0 and 1, but
: that doesn't mean I have to like it.
What makes you think there was any reasoning
Aaron Sherman writes:
Larry Wall wrote:
leave :from(Loop) :labelLINE == 1,2,3;
[...]
leave == :foo:bar:baz(1) if $leaving;
I know it's probably just me, but This section seems to suddenly rely on
a lot more knowledge of the current state of Perl 6 syntax than I have.
Can someone
On Fri, Aug 20, 2004 at 09:18:06AM -0500, Jonathan Scott Duff wrote:
: Whither REDO {...} ? Or do we just manufacture that ourselves with
: NEXT?
Hmm, well, you can view Credo as just a Cgoto TOP in disguise,
or as a Cnext that suppresses the while check. But I think it's
seldom enough used
David Green writes:
Then I thought that maybe for doesn't need to work lazily (except that
the conveniently just-posted Synopsis 4 confirms that it is supposed to
be lazy). Or maybe for is only as lazy as is reasonable, meaning if
it knows how (e.g. if you're using an array or filehandle,
On Fri, Aug 20, 2004 at 09:04:48AM -0700, Dave Whipp wrote:
: Parameters are by default constant within the block. You can
: declare a parameter read/write by including the Cis rw trait.
: If you rely on C$_ as the implicit parameter to a block, then
: then C$_ is considered read/write by
On Fri, Aug 20, 2004 at 10:49:17AM -0600, Luke Palmer wrote:
:
: method postcircumfix: ($self: *%opt) returns List {
: scalar $self.*%opt, $self.*%opt # [1]
: }
:
: [1] Look, Larry, I had to use Cscalar! Maybe we _do_ need to revive
: $()!
It's not clear to me that $() would
I like that arguments will be readonly by default. But when I look at my
current code, I see that I would be typing is rw quite a lot, which in
my opinion is too long for a thing that occurs very often.
Every such situation in my code is a foreach loop. A thing that in Perl
6 will mostly be used
On Fri, Aug 20, 2004 at 12:52:56PM -0700, Larry Wall wrote:
: Unfortunately, the only obvious one, 's', is taken.
I remind myself that 'S' is equally obvious, and not taken. Like _,
it suffers from spacing issues, but could be the ASCII backup for
the § character. (As Y is likely to be the
On Fri, Aug 20, 2004 at 10:07:02PM +0200, Juerd wrote:
: I'm proposing
:
: for zip(@foos, @bars, @xyzzies) - $foo, $bar, $xyzzy { ... }
: for %quux.kv - $key, $value { ... }
That'd probably work on the keys only if the hash was declared to have
object keys. At least in Perl 5, the key
On Fri, 20 Aug 2004 13:31:12 -0700, Larry Wall [EMAIL PROTECTED] wrote:
It's vaguely possible I could be persuaded on the basis that
for zip @a ¥ @b - { ($^a,$^b) = ($^b,$^a) }
Shouldn't that be:
for zip @a, @b - { ... }
--or--
for @a ¥ @b - { ... }
?
--
matt
On Fri, Aug 20, 2004 at 12:39:35AM -0700, Brent 'Dax' Royal-Gordon wrote:
: Larry, you're a genius.
Yeah, well, that and 150 cents'll get me a cup of coffee...
Larry
On Fri, Aug 20, 2004 at 04:46:33PM -0400, Matt Diephouse wrote:
: On Fri, 20 Aug 2004 13:31:12 -0700, Larry Wall [EMAIL PROTECTED] wrote:
: It's vaguely possible I could be persuaded on the basis that
:
: for zip @a ¥ @b - { ($^a,$^b) = ($^b,$^a) }
:
: Shouldn't that be:
:
: for zip
On Fri, 20 Aug 2004 13:49:46 -0700, Larry Wall [EMAIL PROTECTED] wrote:
Yes, a typo. Though it's not actually clear yet whether you have to
write zips args with semicolons, which is why I partially switched
to ¥ in midthink.
Just checking. I wondered if you'd introduced a new feature midthink
Peter Behroozi wrote:
I'm not particular to any of the verbs used yet, but maybe that's
because I don't think of the as a general iterator, but more of a
gobbler-type creature (and formerly a globber, too). Could we try:
for $foo.fetch { ... } #or
for $foo.grab { ... } #or
for $foo.eat { ... }
On Fri, 2004-08-20 at 14:26, Austin Hastings wrote:
Dan Hursh wrote:
generalimpose scalarimpose list
-----
D$foo.eat$foo.bite$foo.gobble
N$foo.look$foo.peek$foo.peruse
hmm, I don't like eat
Larry Wall wrote:
On Fri, Aug 20, 2004 at 12:52:56PM -0700, Larry Wall wrote:
: Unfortunately, the only obvious one, 's', is taken.
I remind myself that 'S' is equally obvious, and not taken. Like _,
it suffers from spacing issues, but could be the ASCII backup for
the § character. (As Y is
Chromatic wrote:
On Fri, 2004-08-20 at 14:26, Austin Hastings wrote:
Dan Hursh wrote:
generalimpose scalarimpose list
-----
D$foo.eat$foo.bite$foo.gobble
N$foo.look$foo.peek$foo.peruse
hmm, I don't like eat
chromatic wrote:
On Fri, 2004-08-20 at 14:26, Austin Hastings wrote:
Dan Hursh wrote:
generalimpose scalarimpose list
-----
D$foo.eat$foo.bite$foo.gobble
N$foo.look$foo.peek$foo.peruse
hmm, I don't
Austin Hastings writes:
Larry Wall wrote:
Hmm. Gotta decided if S$foo.bar() is too ugly to live though...
It is.
Agreed.
I still kinda like underscore.
How about scalar? The fact that one person, one time, came up with a
need to invoke it doesn't mean we have to race it up the
Adverbs are confusing me mightily lately.
It may be that Larry's A12 revision just needs a few examples
*with* parenthesis to straighten me out.
Here are some semi-coherent attempts to sort it out
in my mind. Please correct me where I have made mistakes.
What is the rule(s) for when :foo is an
On Fri, Aug 20, 2004 at 04:15:43PM -0600, John Williams wrote:
: Adverbs are confusing me mightily lately.
:
: It may be that Larry's A12 revision just needs a few examples
: *with* parenthesis to straighten me out.
:
: Here are some semi-coherent attempts to sort it out
: in my mind. Please
On Fri, Aug 20, 2004 at 04:18:55PM -0700, Larry Wall wrote:
: Only a sig of () makes it *not* look for an argument as a list operator.
That's overstated. Only a sig of () or ($x) or (?$x) suppresses
list operator-ness on ordinary function names.
Larry
Larry Wall writes:
On Fri, Aug 20, 2004 at 04:15:43PM -0600, John Williams wrote:
:
:say .meth :foo;# say( .meth( foo=1 ) )
That one works.
But that's because :foo is an adverb to .meth, not because .meth is
taking an argument 'foo' = 1, right?
Likewise
sqrt($x):both
On Fri, Aug 20, 2004 at 06:12:06PM -0600, Luke Palmer wrote:
: Larry Wall writes:
: On Fri, Aug 20, 2004 at 04:15:43PM -0600, John Williams wrote:
: :
: :say .meth :foo;# say( .meth( foo=1 ) )
:
: That one works.
:
: But that's because :foo is an adverb to .meth, not because .meth
On 8/20/04 5:30 PM, Austin Hastings wrote:
How about scalar? The fact that one person, one time, came up with a
need to invoke it doesn't mean we have to race it up the huffman tree.
P6 is winning the DWIM race most of the time contextually. Maybe [#] as
a macro, if you like.
Yeah, that's my
34 matches
Mail list logo