Dan Sugalski wrote:
The expensive part is the shared data. All the structures in an
interpreter are too large to act on atomically without any sort of
synchronization, so everything shared between interpreters needs to have
a mutex associated with it. Mutex operations are generally cheap, but
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? The
rule
At 9:10 PM -0800 11/17/02, Dave Whipp wrote:
Dan Sugalski wrote:
The expensive part is the shared data. All the structures in an
interpreter are too large to act on atomically without any sort of
synchronization, so everything shared between interpreters needs to
have a mutex associated with
At 2:57 PM + 11/18/02, Nicholas Clark wrote:
But I'm not sure if parrot is going to give the perl interpreter cheap
threading. (Does the async IO mean that one parrot interpreter could
internally co-operatively thread perl in some cases?)
Oh, it could do it preemptively. And parrot can
--- Damian Conway [EMAIL PROTECTED] wrote:
The semantics of Cfor 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
On Mon, Nov 18, 2002 at 08:05:47AM +1100, Damian Conway wrote:
: I still think my original:
:
: sub bar(; $foo = $topic) is given($topic) {...}
:
: is the appropriate compromise.
Won't fly. Referring to something lexical before it's declared is
a no-no. I think we need some other way of
Larry Wall wrote:
On Mon, Nov 18, 2002 at 08:05:47AM +1100, Damian Conway wrote:
: I still think my original:
:
: sub bar(; $foo = $topic) is given($topic) {...}
:
: is the appropriate compromise.
Won't fly. Referring to something lexical before it's declared is
a no-no.
I would maintain
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 ... operator.
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
Damian Conway wrote:
BTW, in thinking about it further, I realize that Dan is going
to have to tackle this issue anyway. There's fundamentally no
difference in the exigencies of:
$junction = $x | $y | $z;
foo($junction);# Call foo($x), foo($y), and foo($z)
matt diephouse wrote:
$junction = $x | $y | $z;
foo($junction);# Call foo($x), foo($y), and foo($z)
# in parallel and collect the results
# in a disjunction
Looking at that code, I'm wondering how you pass
At 9:05 AM +1100 11/19/02, Damian Conway wrote:
matt diephouse wrote:
$junction = $x | $y | $z;
foo($junction);# Call foo($x), foo($y), and foo($z)
# in parallel and collect the results
# in a disjunction
--- 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 enable me to consistently
Damian Conway:
# Larry Wall wrote:
# On Mon, Nov 18, 2002 at 08:05:47AM +1100, Damian Conway wrote:
# : I still think my original:
# :
# : sub bar(; $foo = $topic) is given($topic) {...}
# :
# : is the appropriate compromise.
#
# Won't fly. Referring to something lexical before it's
Damian Conway wrote:
matt diephouse wrote:
$junction = $x | $y | $z;
foo($junction);# Call foo($x), foo($y), and foo($z)
# in parallel and collect the results
# in a disjunction
Looking at that code, I'm
Dan Sugalski wrote:
Hrm. What happens if the junction is then used as an iterator?
$junction = File::Open(foo) | File::Open(bar);
for ($junction) {
...
}
In Larry's formulation that's just the same as:
while $_ := $junction.next { ... }
which, when called on a junction, Cnexts
Larry:
sub bar(; $foo = topicmumble) {...}
Damian:
topic [would be] Cundef.
I assumed topicmumble implied an 'is given'.
I don't see why it couldn't.
Damian:
Hm. Given that the topic is in some sense
a property of the lexical scope of the subroutine
body, this might be a
Mailing-List: contact [EMAIL PROTECTED]; run by ezmlm
Date: Mon, 18 Nov 2002 18:59:58 -0500
From: matt diephouse [EMAIL PROTECTED]
X-SMTPD: qpsmtpd/0.12, http://develooper.com/code/qpsmtpd/
Damian Conway wrote:
matt diephouse wrote:
$junction = $x | $y | $z;
foo($junction);
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
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 07:45:25AM +1100, Damian Conway wrote:
: What mumble might be is an interesting, er, topic.
:
: I would argue it ought to be just $_, which is, after all,
: the One True Topic. And conveniently lexically predeclared in all scopes.
:
: I would also argue that it ought not
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 pulling
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 docs are
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 b c;
On Monday, November 18, 2002, at 05:47 PM, Luke Palmer wrote:
It's either that or have your functions, which were perfectly logical
suddenly be subject to junction logic. That is, if $x == 2 and $x
== 3 both being true, when your code relies on them not both firing.
I think it's a very good
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. Only as the very first
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
#
matt diephouse wrote:
sub foo($param is junction) {...}
Doesn't that go against perl's dynamic philosophy?
???
That requires me to type my methods where I may not want to.
Let's say I have a sub that logs errors:
sub log_error($fh, $error) { # filehandle and error msg
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/code/qpsmtpd/
David Wheeler asked:
How will while behave?
Cwhile 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
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
implicit
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 ... operator do?
It's the ASCII
David Wheeler asked:
while $fh {...}# Iterate until $fh.readline returns EOF?
That's a scalar context?
Sure. Cwhile always evaluates its condition in a scalar context.
Damian
Luke Palmer asked:
What was the final syntax for vector ops?
@a ≪+≫ @b
@a ≫+≪ @b
The latter (this week, at least ;-).
Damian
* 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 =)
On Monday, November 18, 2002, at 08:17 PM, Damian Conway wrote:
Sure. Cwhile always evaluates its condition in a scalar context.
Oh, duh. Thanks.
David
--
David Wheeler AIM: dwTheory
[EMAIL PROTECTED] ICQ: 15726394
Damian Conway [EMAIL PROTECTED] wrote my $file = open error.log
../some/other.log; # I hope this is legal
Under my junctive semantics it is. It simply calls Copen twice, with
the two states, and returns a conjunction of the resulting filehandles.
Though you probably really want a
Larry wrote:
The long and the short of it was that
my sub foo ($_ := $arg = $_)
is how you might set $arg to be both the topic and the given.
Wow. I'm surprised by how much I don't like that syntax! ;-)
I mean, two entirely different meanings for $_ in the space of one parameter
Dave Whipp wrote:
Under my junctive semantics it is. It simply calls Copen twice, with
the two states, and returns a conjunction of the resulting filehandles.
Though you probably really want a *dis*junction there.
The thing that's worrying me is: what happens when one of them throws an
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: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 characters that
At 3:45 PM +1100 11/19/02, Damian Conway wrote:
Dave Whipp wrote:
Does the exception get deferred until after all the threads have completed?
I would doubt it.
We're definitely going to need to nail the semantics down. Would one
thread throwing an exception require all the threads being
my sub foo ($_ = $_)
to just propagate the outer $_ inward.
That only works when $_ can somehow be
shoe-horned into the parameter list.
Whereas:
my sub foo is given($_)
works for *any* parameter list.
Other than the placeholder situation, I
don't understand when one
Dan Sugalski wrote:
We're definitely going to need to nail the semantics down. Would one
thread throwing an exception require all the threads being aborted, for
example?
I would imagine so. You can't reasonably build a junction out of values
that weren't successfully created. If you write:
ralph wrote:
Other than the placeholder situation, I
don't understand when one could do the
'is given($_)' and not do the ($_ = $_).
Any time that the caller's topic isn't supposed to be
explicitly passed as an argument, but is still used within
the subroutine.
For example, the
45 matches
Mail list logo