Re: temporization

2003-03-31 Thread Matthijs van Duin
On Mon, Mar 31, 2003 at 10:56:14AM +0200, Matthijs van Duin wrote: temp $foo := $bar; # temporarily bind $foo to $bar temp $foo = $bar;# temporarily assign the value of $bar to $foo I just realize 'temp $foo = 3' might just as well mean bind $foo to a new scalar and initialize it to 3

How shall threads work in P6?

2003-03-31 Thread Austin Hastings
Okay, I've been thinking about closures, continuations, and coroutines, and one of the interfering points has been threads. What's the P6 thread model going to be? As I see it, parrot gives us the opportunity to implement preemptive threading at the VM level, even if it's not available via the

Re: This week's Perl 6 Summary

2003-03-31 Thread Michael Lazzaro
On Monday, March 31, 2003, at 07:39 AM, Piers Cawley wrote: Argument initializations Michael Lazzaro summarized the various different and proposed assignment operators available in Perl 6, including a proposed ::= for 'only assign to uninitialized variables'. Michael wondered how

Re: How shall threads work in P6?

2003-03-31 Thread Matthijs van Duin
On Mon, Mar 31, 2003 at 07:45:30AM -0800, Austin Hastings wrote: I've been thinking about closures, continuations, and coroutines, and one of the interfering points has been threads. What's the P6 thread model going to be? As I see it, parrot gives us the opportunity to implement preemptive

Re: This week's Perl 6 Summary

2003-03-31 Thread Jonathan Scott Duff
On Mon, Mar 31, 2003 at 10:09:43AM -0800, Michael Lazzaro wrote: I'm still hoping rather desperately for a if-uninitialized op in general, even if only for hashes, because the difference between present but undefined and not present is rather crucial for some common algorithms. Can you

Re: How shall threads work in P6?

2003-03-31 Thread Simon Cozens
[EMAIL PROTECTED] (Matthijs Van Duin) writes: I think if we apply the Huffman principle here by optimizing for the most common case, cooperative threading wins from preemptive threading. Well, if you optimize for the most common case, throw out threads altogether. -- The bad reputation UNIX

Re: This week's Perl 6 Summary

2003-03-31 Thread Michael Lazzaro
On Monday, March 31, 2003, at 10:15 AM, Jonathan Scott Duff wrote: On Mon, Mar 31, 2003 at 10:09:43AM -0800, Michael Lazzaro wrote: I'm still hoping rather desperately for a if-uninitialized op in general, even if only for hashes, because the difference between present but undefined and not

Re: How shall threads work in P6?

2003-03-31 Thread Michael G Schwern
On Mon, Mar 31, 2003 at 08:13:09PM +0200, Matthijs van Duin wrote: I think we should consider cooperative threading, implemented using continuations. Yielding to another thread would automatically happen when a thread blocks, or upon explicit request by the programmer. It has many

Re: This week's Perl 6 Summary

2003-03-31 Thread arcadi shehter
Piers Cawley writes: is static? Discussion of static/state variables continued. Arcadi Shehter wondered if it made sense to attach but properties to closures. I confess I didn't really understand what he was driving at. Austin Hastings and Actually, I was confused , thinking

Re: How shall threads work in P6?

2003-03-31 Thread Austin Hastings
--- Dan Sugalski [EMAIL PROTECTED] wrote: At 8:13 PM +0200 3/31/03, Matthijs van Duin wrote: On Mon, Mar 31, 2003 at 07:45:30AM -0800, Austin Hastings wrote: I've been thinking about closures, continuations, and coroutines, and one of the interfering points has been threads. What's the P6

Re: How shall threads work in P6?

2003-03-31 Thread Matthijs van Duin
On Mon, Mar 31, 2003 at 10:50:59AM -0800, Michael G Schwern wrote: I must write my code so each operation only takes a small fraction of time or I must try to predict when an operation will take a long time and yield periodicly. Really.. why? When you still have computation to be done before you

Re: Conditional Creturns?

2003-03-31 Thread Matthijs van Duin
On Mon, Mar 31, 2003 at 11:04:35AM -0800, Michael Lazzaro wrote: my bool $x = result_of_some_big_long_calculation(...args...); return $x if $x; Is there a way that doesn't require the named variable? $_ and return given big_calculation(); or: given big_calculation() { return

Re: How shall threads work in P6?

2003-03-31 Thread Matthijs van Duin
On Mon, Mar 31, 2003 at 01:58:19PM -0500, Dan Sugalski wrote: Dan doesn't like it. :) Well, there are actually a lot of disadvantages, but that's the only important one, so it's probably not worth much thought over alternate threading schemes for Parrot at least--it's going with an OS-level

Re: Conditional Creturns?

2003-03-31 Thread Michael Lazzaro
On Monday, March 31, 2003, at 11:18 AM, Matthijs van Duin wrote: On Mon, Mar 31, 2003 at 11:04:35AM -0800, Michael Lazzaro wrote: my bool $x = result_of_some_big_long_calculation(...args...); return $x if $x; Is there a way that doesn't require the named variable? $_ and return given

Re: Conditional Creturns?

2003-03-31 Thread Jonathan Scott Duff
On Mon, Mar 31, 2003 at 12:12:54PM -0800, Michael Lazzaro wrote: Don't those return Cundef, as opposed to the value of C$_? I.E. wouldn't it be: $_ and return $_ given big_calculation(); -or- given big_calculation() { return $_ when true; } Personally I'd just

Re: How shall threads work in P6?

2003-03-31 Thread Matthijs van Duin
On Mon, Mar 31, 2003 at 11:58:01AM -0800, Michael G Schwern wrote: Off-list since this tastes like it will rapidly spin out of control. On-list since this is relevant for others participating in the discussion Classic scenario for threading: GUI. GUI uses my module which hasn't been carefully

Re: Conditional Creturns?

2003-03-31 Thread Matthijs van Duin
On Mon, Mar 31, 2003 at 12:12:54PM -0800, Michael Lazzaro wrote: On Monday, March 31, 2003, at 11:18 AM, Matthijs van Duin wrote: Don't those return Cundef, as opposed to the value of C$_? I.E. wouldn't it be: $_ and return $_ given big_calculation(); -or- given big_calculation() {

Re: Conditional Creturns?

2003-03-31 Thread Paul
--- Jonathan Scott Duff [EMAIL PROTECTED] wrote: On Mon, Mar 31, 2003 at 12:12:54PM -0800, Michael Lazzaro wrote: Don't those return Cundef, as opposed to the value of C$_? I.E. wouldn't it be: $_ and return $_ given big_calculation(); -or- given big_calculation() {

Re: How shall threads work in P6?

2003-03-31 Thread Matthijs van Duin
On Mon, Mar 31, 2003 at 07:21:03PM +0100, Simon Cozens wrote: [EMAIL PROTECTED] (Matthijs Van Duin) writes: I think if we apply the Huffman principle here by optimizing for the most common case, cooperative threading wins from preemptive threading. Well, if you optimize for the most common case,

Re: Conditional Creturns?

2003-03-31 Thread Smylers
Michael Lazzaro writes: Forgive me; a very minor style efficiency question... what would the canonical way to do this be, given what we know of Perl6? # the hapless, inefficient version: return result_of_some_big_long_calculation(...args...) if

Re: Conditional Creturns?

2003-03-31 Thread Michael Lazzaro
On Monday, March 31, 2003, at 11:21 AM, Smylers wrote: Michael Lazzaro writes: Forgive me; a very minor style efficiency question... what would the canonical way to do this be, given what we know of Perl6? # the hapless, inefficient version: return

Re: Conditional Creturns?

2003-03-31 Thread Matthijs van Duin
On Mon, Mar 31, 2003 at 02:58:12PM -0800, Michael Lazzaro wrote: my $x = baz(...args...); return $x if $x; I'm looking for a Perl6 way to say that oft-repeated, oft-chained two-line snippet up there without declaring the temporary variable. Using Cgiven or Cwhen, maybe? $_ and return $_

Re: Conditional Creturns?

2003-03-31 Thread Damian Conway
Matthijs van Duin wrote: On Mon, Mar 31, 2003 at 02:58:12PM -0800, Michael Lazzaro wrote: my $x = baz(...args...); return $x if $x; I'm looking for a Perl6 way to say that oft-repeated, oft-chained two-line snippet up there without declaring the temporary variable. Using Cgiven or

Re: Conditional Creturns?

2003-03-31 Thread Matthijs van Duin
On Tue, Apr 01, 2003 at 09:25:39AM +1000, Damian Conway wrote: baz does refer to the Code object itself, as you say. However, the bar(...) syntax *will* DWYM too. That's because: baz(@args); is just a shorthand for: baz.(@args); That's not what page 5 of Apoc 6 says: quote Note that when

Re: Conditional Creturns?

2003-03-31 Thread Luke Palmer
On Monday, March 31, 2003, at 12:30 PM, Paul wrote: I started to suggest this myself, then realized that you might not want it to return at all if the value is false. Yes, exactly: sub foo(...args...) { # We first attempt to get our return value the easy way. # If

== vs. eq

2003-03-31 Thread Luke Palmer
Since my mail server has been down for a week, I've had a lot of time to look through Perl 6 as it stands, without being concerned with current issues. I'll do them one-message-at-a-time (and rather slowly, too). The first thing I noticed was the == / eq distinction. This has been invaluable

is is overoverloaded?

2003-03-31 Thread Luke Palmer
While my last post was about removing entities, this one will be about adding them. Now, I don't know what Larry has up his sleeve in this respect, but as I see it now, Cis is too heavily overloaded. As it stands, it means 3 things: (1) Attributing traits (2) Inheriting base classes

Re: Conditional Creturns?

2003-03-31 Thread Damian Conway
Matthijs van Duin wrote: That's not what page 5 of Apoc 6 says: Wow, I guess I should read those things, eh? ;-) Thanks for correcting my mistake, Matthijs. Damian

This week's Perl 6 Summary

2003-03-31 Thread Piers Cawley
The Perl 6 Summary for the week ending 20030330 Welcome once again to the gallimaufry that is a Perl 6 summary. Unfettered this week by the presence of feline distraction we plunge straight into the crystal clear waters of perk6-internals. Iterator proof of concept People must

Re: How shall threads work in P6?

2003-03-31 Thread Dan Sugalski
At 8:13 PM +0200 3/31/03, Matthijs van Duin wrote: On Mon, Mar 31, 2003 at 07:45:30AM -0800, Austin Hastings wrote: I've been thinking about closures, continuations, and coroutines, and one of the interfering points has been threads. What's the P6 thread model going to be? As I see it, parrot

Conditional Creturns?

2003-03-31 Thread Michael Lazzaro
Forgive me; a very minor style efficiency question... what would the canonical way to do this be, given what we know of Perl6? # the hapless, inefficient version: ... return result_of_some_big_long_calculation(...args...) if result_of_some_big_long_calculation(...args...);