Sounds like "threads" to me.
What I see that's different from common threads in other languages is
that they are all the same, rather than one master and many new threads
that have no context history above them. In Perl 6, every thread sees
the same dynamic scope as the original. It doesn't
Andrew Whitworth wrote:
> The issue mentioned in the Synopses is that junctions autothread, and
> autothreading in a conditional could potentially create multiple
> threads of execution, all of which are taking different execution
> paths. At some point, to bring it all back together again, the var
Em Ter, 2009-05-26 às 19:33 -0700, Jon Lang escreveu:
> "The exact semantics of autothreading with respect to control
> structures are subject to change over time; it is therefore erroneous
> to pass junctions to any control construct that is not implemented via
> as a normal single or multi dispat
On Tue, May 26, 2009 at 8:05 PM, John M. Dlugosz
<2nb81l...@sneakemail.com> wrote:
> Jon Lang dataweaver-at-gmail.com |Perl 6| wrote:
>>
>> >From S09, under Junctions:
>>
>> "The exact semantics of autothreading with respect to control
>> structures are subject to change over time; it is therefore
Jon Lang dataweaver-at-gmail.com |Perl 6| wrote:
>From S09, under Junctions:
"The exact semantics of autothreading with respect to control
structures are subject to change over time; it is therefore erroneous
to pass junctions to any control construct that is not implemented via
as a normal sing
Damian Conway writes:
>
> There's no second iterator. Just C walking through an array.
>
( questions in the form of answers :-)
so :
* "for" impose array context for first argument and doesnt care about
"nature" of the array which it was given eventually as an argument .
no multiple st
Austin Hastings wrote:
for each $dance: {
^ note colon
1- Why is the colon there? Is this some sub-tile syntactical new-ance
that I missed in a prior message, or a new thing?
It's the way we mark an indirect object in Perl 6.
2- Why is the colon necessary? Isn't the "
Arcadi wrote:
> > > > while <$iter> {...} # Iterate until $iter.each returns false?
> you mean "Iterate until $iter.next returns false?"
Oops. Quite so.
what is the difference between the Iterator and lazy array ?
am I right that it is just "interface" : lazy array is an iterator
Paul Johnson wrote:
Is it illegal now to use quotes in qw()?
Nope. Only as the very first character of a <<...>>.
Paging Mr Cozens. ;-)
It's just another instance of whitespace significance.
print «\"a" "b" "c"»;
Presumably without the backslash here too.
Maybe. It depends on whet
> Larry wrote:
>
> So you can do it any of these ways:
>
> for <$dance> {
>
> for $dance.each {
>
> for each $dance: {
>^ note colon
1- Why is the colon there? Is this some sub-tile syntactical new-ance
that I missed in a prior message, or a new thing?
2- Why i
Damian Conway writes:
> David Wheeler asked:
>
> > How will while behave?
>
> C evaluates its first argument in scalar context, so:
>
>
> > while <$fh> {...}# Iterate until $fh.readline returns EOF?
>
> More or less. Technically: call <$fh.next> and execute the loop
> body i
--- Damian Conway <[EMAIL PROTECTED]> wrote:
> Iain 'Spoon' Truskett wrote:
>
> >>> @a ???+??? @b
> >>> @a ???+??? @b
> >
> > Y'know, for those of us who still haven't set up Unicode, they look
> > remarkably similar =)
>
> "Think Of It As Evolution In Action"
>
> ;-)
This coming from som
Damian Conway said:
>> Is it illegal now to use quotes in qw()?
>
> Nope. Only as the very first character of a <<...>>.
Paging Mr Cozens. ;-)
> So any of these are still fine:
>
> print << "a" "b" "c" >>;
> print <<\"a" "b" "c">>;
> print «\"a" "b" "c"»;
Presumably without
On Monday, November 18, 2002, at 08:19 PM, Damian Conway wrote:
(B
(B>> What was the final syntax for vector ops?
(B>> @a $B"c(B+$B"d(B @b
(B>> @a $B"d(B+$B"c(B @b
(B>
(B> The latter (this week, at least ;-).
(B
(BThis reminds me: I though of another set of bracing characte
Iain 'Spoon' Truskett wrote:
@a ???+??? @b
@a ???+??? @b
Y'know, for those of us who still haven't set up Unicode, they look
remarkably similar =)
"Think Of It As Evolution In Action"
;-)
Damian
On Monday, November 18, 2002, at 08:17 PM, Damian Conway wrote:
Sure. C always evaluates its condition in a scalar context.
Oh, duh. Thanks.
David
--
David Wheeler AIM: dwTheory
[EMAIL PROTECTED] ICQ: 15726394
http://david.w
* Damian Conway ([EMAIL PROTECTED]) [19 Nov 2002 15:19]:
> Luke Palmer asked:
> > What was the final syntax for vector ops?
> >
> >@a ???+??? @b
> >@a ???+??? @b
> The latter (this week, at least ;-).
Y'know, for those of us who still haven't set up Unicode, they look
remarkably similar =
Luke Palmer asked:
What was the final syntax for vector ops?
@a ≪+≫ @b
@a ≫+≪ @b
The latter (this week, at least ;-).
Damian
David Wheeler asked:
while <$fh> {...}# Iterate until $fh.readline returns EOF?
That's a scalar context?
Sure. C always evaluates its condition in a scalar context.
Damian
> Date: Tue, 19 Nov 2002 14:29:46 +1100
> From: Damian Conway <[EMAIL PROTECTED]>
>
> Ken Fox lamented:
>
> >> Or the circumfix <<...>> operator. Which is the problem here.
> >
> > This is like playing poker with God.
>
> I hear God prefers dice.
>
>
> > What does the circumfix <<...>> opera
On Monday, November 18, 2002, at 08:05 PM, Damian Conway wrote:
while <$fh> {...}# Iterate until $fh.readline returns EOF?
More or less. Technically: call <$fh.next> and execute the loop body
if that method
returns true. Whether it still has the automatic binding to $_ and the
implic
David Wheeler asked:
How will while behave?
C evaluates its first argument in scalar context, so:
while <$fh> {...}# Iterate until $fh.readline returns EOF?
More or less. Technically: call <$fh.next> and execute the loop body if that method
returns true. Whether it still has the au
> Mailing-List: contact [EMAIL PROTECTED]; run by ezmlm
> X-Sent: 19 Nov 2002 02:51:54 GMT
> Date: Tue, 19 Nov 2002 13:51:56 +1100
> From: Damian Conway <[EMAIL PROTECTED]>
> X-Accept-Language: en, en-us
> Cc: "[EMAIL PROTECTED]" <[EMAIL PROTECTED]>
> X-SMTPD: qpsmtpd/0.12, http://develooper.com/co
On Monday, November 18, 2002, at 06:51 PM, Damian Conway wrote:
for <$fh> {...}# Build and then iterate a lazy array (the elements
# of which call back to the filehandle's input
# retrieval coroutine)
for <$iter> {...} # Build and then iterate a lazy array (the elements
Seriously, that's a good trick. How does it work? What do these
examples do?
print <<"a" "b" "c">>;
Squawks about finding the string "b" immediately after the heredoc introducer.
print <<"a"
"b"
"c">>;
Likewise.
Is it illegal now to use quotes in qw()?
Nope. Onl
Damian Conway wrote:
It's [<<...>>>] the ASCII synonym for the «...» operator, which
is a synonym for the qw/.../ operator.
Nope. Heredocs still start with <<.
Hey! Where'd *that* card come from? ;)
Seriously, that's a good trick. How does it work? What do these
examples do?
print <<"a" "
Ken Fox lamented:
Or the circumfix <<...>> operator. Which is the problem here.
This is like playing poker with God.
I hear God prefers dice.
What does the circumfix <<...>> operator do?
It's the ASCII synonym for the «...» operator, which is a
synonym for the qw/.../ operator.
Here d
Damian Conway wrote:
Ken Fox wrote:
The < must begin the circumfix <> operator.
Or the circumfix <<...>> operator. Which is the problem here.
This is like playing poker with God. Assuming you can get over
the little hurdles of Free Will and Omniscience, there's still
the problem of Him pullin
Larry wrote:
So you can do it any of these ways:
for <$dance> {
for $dance.each {
for each $dance: {
^ note colon
Then there's this approach to auto-iteration:
my @dance := Iterator.new(@squares);
for @dance {
Okay, so now I need to make sense of the
On Tue, Nov 19, 2002 at 08:53:17AM +1100, Damian Conway wrote:
: my $dance = Iterator.new(@squares);
: for $dance {
Scalar variables have to stay scalar in list context, so $dance cannot
suddenly start behaving like a list. Something must tell the scalar
to behave like a list, and I don't
--- Damian Conway <[EMAIL PROTECTED]> wrote:
> Austin Hastings asked:
> > That is, can I say
> >
> > for (@squares)
> > {
> > ...
> > if $special.instructions eq 'Advance three spaces'
> > {
> > $_.next.next.next;
> > }
> > ...
> > }
> >
> > or some other suchlike thing that will
Austin Hastings asked:
By extension, if it is NOT given an iterator object, will it appear to
create one?
Yep.
That is, can I say
for (@squares)
{
...
if $special.instructions eq 'Advance three spaces'
{
$_.next.next.next;
}
...
}
or some other suchlike thing that will enab
Ken Fox wrote:
Damian Conway wrote:
my $iter = fibses();
for < <$iter> > {...}
(Careful with those single angles, Eugene!)
Operator << isn't legal when the grammar is expecting an
expression, right?
Right.
The < must begin the circumfix <> operator.
Or the circumfix <<...>> op
--- Damian Conway <[EMAIL PROTECTED]> wrote:
> The semantics of C would simply be that if it is given an
> iterator object (rather than a list or array), then it calls
> that object's iterator once per loop.
By extension, if it is NOT given an iterator object, will it appear to
create one?
That
Damian Conway wrote:
my $iter = fibses();
for < <$iter> > {...}
(Careful with those single angles, Eugene!)
Operator << isn't legal when the grammar is expecting an
expression, right? The < must begin the circumfix <> operator.
Is the grammar being weakened so that yacc can handle it?
Luke Palmer enquired:
we still have implicit iteration:
for fibs() {
print "Now $_ rabbits\n";
}
Really? What if fibs() is a coroutine that returns lists (Fibonacci
lists, no less), and you just want to iterate over one of them? The
syntax:
for &fibs {
print "
> Date: Mon, 18 Nov 2002 09:28:59 +1100
> From: Damian Conway <[EMAIL PROTECTED]>
I've a couple of questions here:
> we still have implicit iteration:
>
> for fibs() {
> print "Now $_ rabbits\n";
> }
Really? What if fibs() is a coroutine that returns lists (Fibonacci
lists,
Of course, apart from the "call-with-new-args" behaviour, having
Pythonic coroutines isn't noticably less powerful. Given:
sub fibs ($a = 0 is copy, $b = 1 is copy) {
loop {
yield $b;
($a, $b) = ($b, $a+b);
}
}
we still have implicit iteration:
Angel Faus wrote:
I understand that this formulation is more powefull, but one thing I like
about python's way (where a coroutine is just a funny way to generate lazy
arrays) is that it lets you _use_ coroutines without even knowing what they
are about.
Such as when you say:
for $graph.nodes {
At 1:29 PM +1100 11/17/02, Damian Conway wrote:
The formulation of coroutines I favour doesn't work like that.
Every time you call a suspended coroutine it resumes from immediately
after the previous C than suspended it. *And* that C
returns the new argument list with which it was resumed.
Hrm.
Damian Conway wrote:
>
> The formulation of coroutines I favour doesn't work like that.
>
> Every time you call a suspended coroutine it resumes from immediately
> after the previous C than suspended it. *And* that C
> returns the new argument list with which it was resumed.
>
> So you can write th
Dan Sugalski wrote:
I dunno. One of the things I've seen with coroutines is that as long as
you call them with no arguments, you get another iteration of the
coroutine--you actually had to call it with new arguments to reset the
thing.
The formulation of coroutines I favour doesn't work like
At 8:31 AM +1100 11/17/02, Damian Conway wrote:
Peter Haworth asked:
So to get the same yield context, each call to the coroutine has to be from
the same calling frame. If you want to get several values from the same
coroutine, but from different calling contexts, can you avoid the need to
wrap
Peter Haworth asked:
So to get the same yield context, each call to the coroutine has to be from
the same calling frame. If you want to get several values from the same
coroutine, but from different calling contexts, can you avoid the need to
wrap it in a closure?
I don't think so.
Damian
On Tue, 12 Nov 2002 14:30:24 +, Peter Haworth wrote:
> So to get the same yield context, each call to the coroutine has to be from
> the same calling frame. If you want to get several values from the same
> coroutine, but from different calling contexts, can you avoid the need to
> wrap it in a
On Wed, 06 Nov 2002 10:38:45 +1100, Damian Conway wrote:
> Luke Palmer wrote:
> > I just need a little clarification about yield().
>
> C is exactly like a C, except that when you
> call the subroutine next time, it resumes from after the C.
>
> > how do you tell the difference between a
> > recu
Luke Palmer wrote:
I just need a little clarification about yield().
The first point of clarification is that the subject is a little off.
C gives us *co-routines*, not *continuations*.
consider this sub:
sub iterate(@foo) {
yield for @foo;
undef;
}
(Where yield defaults to the t
On Tue, 9 Jul 2002 16:42:03 +0100, Peter Haworth wrote:
> > When you invoke a continuation you put the call scratchpads and lexical
> > scratchpads back to the state they were when you took the continuation.
>
> If you restore the lexicals, how does this ever finish?
Never mind. It's the *acces
On Mon, 8 Jul 2002 16:54:16 -0400, Dan Sugalski wrote:
> while ($foo) {
> $foo--;
> }
>
> Pretty simple. (For illustrative purposes) To do that with
> continuations, it'd look like:
>
> $cont = take_continuation();
> if ($foo) {
> $foo--;
> invoke($cont);
>
On Mon, 8 Jul 2002, [EMAIL PROTECTED] wrote:
> Yep. But serializing continuations is either tough, or not
> completely doable, since programs tend to have handles on things
> outside their direct control like filehandles, sockets, database
> connections, and suchlike things. Resuming a continuatio
Thus it was written in the epistle of Peter Scott,
>
> So if you could serialize a continuation, you could freeze your program
> state to disk and restore it later? Cool, makes for easy checkpoint/restarts.
I think that that would be true only if *all* data was maintained in those
scratchpads
At 10:24 PM +0100 7/8/02, Nicholas Clark wrote:
>On Mon, Jul 08, 2002 at 04:54:16PM -0400, Dan Sugalski wrote:
>> Pretty simple. (For illustrative purposes) To do that with
>> continuations, it'd look like:
>>
>> $cont = take_continuation();
>> if ($foo) {
>> $foo--;
>> invok
At 3:01 PM -0700 7/8/02, Peter Scott wrote:
>At 04:54 PM 7/8/02 -0400, Dan Sugalski wrote:
>>A continuation is a sort of super-closure. Like a closure it
>>captures its lexical variables, so every time you use it, you're
>>referring to the same set of variables, which live on until the
>>contin
At 04:54 PM 7/8/02 -0400, Dan Sugalski wrote:
>A continuation is a sort of super-closure. Like a closure it captures
>its lexical variables, so every time you use it, you're referring to
>the same set of variables, which live on until the continuation's
>destroyed. This works because the variab
On Mon, Jul 08, 2002 at 04:54:16PM -0400, Dan Sugalski wrote:
> Pretty simple. (For illustrative purposes) To do that with
> continuations, it'd look like:
>
>$cont = take_continuation();
>if ($foo) {
> $foo--;
> invoke($cont);
>}
>
> take_continuation() returns a continua
On Mon, 8 Jul 2002, Dan Sugalski wrote:
> Pretty simple. (For illustrative purposes) To do that with
> continuations, it'd look like:
>
> $cont = take_continuation();
> if ($foo) {
> $foo--;
> invoke($cont);
> }
>
> take_continuation() returns a continuation for the curren
56 matches
Mail list logo