Sun Fortress and Perl 6

2005-04-27 Thread Autrijus Tang
Fortress is Sun's project at making a next-generation computer language. I like its technical report very, very much: http://research.sun.com/projects/plrg/fortress0618.pdf (via http://lambda-the-ultimate.org/node/view/673 ) Syntax aside (eg. their `=` and `:=` has the reverse meaning in

Re: Sun Fortress and Perl 6

2005-04-27 Thread Autrijus Tang
On Wed, Apr 27, 2005 at 08:21:27AM -, Rafael Garcia-Suarez wrote: Autrijus Tang wrote in perl.perl6.language : 4. Software Transaction Memory In Fortress, there is also an `atomic` trait for functions, that declares the entire function as atomic. Interesting; and this rolling-back

Re: Sun Fortress and Perl 6

2005-04-27 Thread Juerd
Autrijus Tang skribis 2005-04-27 17:04 (+0800): I can certainly see a `is pure` trait on Perl 6 function that declares them to be safe from side effects. In a sense, `is const` also does that. `is pure` would be great to have! For possible auto-memoization of likely-to-be-slow subs it can be

Re: Sun Fortress and Perl 6

2005-04-27 Thread Luke Palmer
Juerd writes: Autrijus Tang skribis 2005-04-27 17:04 (+0800): I can certainly see a `is pure` trait on Perl 6 function that declares them to be safe from side effects. In a sense, `is const` also does that. `is pure` would be great to have! For possible auto-memoization of

Re: use English

2005-04-27 Thread Aaron Sherman
On Tue, 2005-04-26 at 10:48, Luke Palmer wrote: Aaron Sherman writes: The reasons I don't use English in P5: * Variable access is slower Hmm, looks to me like $INPUT_RECORD_SEPARATOR is faster. (Actually they're the same: on each run a different one won, but just barely like

Re: Sun Fortress and Perl 6

2005-04-27 Thread Paul Johnson
On Wed, Apr 27, 2005 at 01:53:11AM -0600, Luke Palmer wrote: Juerd writes: Autrijus Tang skribis 2005-04-27 17:04 (+0800): I can certainly see a `is pure` trait on Perl 6 function that declares them to be safe from side effects. In a sense, `is const` also does that. `is pure`

Malfunction Junction, what's your function?

2005-04-27 Thread Joshua Gatcomb
Ok - sorry for the cheesy subject line but I couldn't resist. So I am working on porting some interesting pieces of code I wrote in p5 at the Monastery to p6 for the benefit of others - primarily to show how easy the transition can be. Since Pugs doesn't have p6 rules yet I wanted to show off

Re: Sun Fortress and Perl 6

2005-04-27 Thread Matt
On Wed, 27 Apr 2005 03:32:12 -0400, Autrijus Tang [EMAIL PROTECTED] wrote: 3. Labels applies to blocks, not statements Instead of this: LABEL: say Hello! say Hi! One has to write this (essentially creating named blocks): LABEL: { say Hello! say Hi! }

Re: Malfunction Junction, what's your function?

2005-04-27 Thread Patrick R. Michaud
On Wed, Apr 27, 2005 at 08:46:53AM -0400, Joshua Gatcomb wrote: The problem is that in the regex version I use capturing parens to identify the character matched. For the purposes of the problem I don't need to rely on the first character matched I just need to know 1. Without doing a lot

Re: Malfunction Junction, what's your function?

2005-04-27 Thread Thomas Sandlaß
Patrick R. Michaud wrote: On Wed, Apr 27, 2005 at 08:46:53AM -0400, Joshua Gatcomb wrote: The problem is that in the regex version I use capturing parens to identify the character matched. For the purposes of the problem I don't need to rely on the first character matched I just need to know 1.

Re: Malfunction Junction, what's your function?

2005-04-27 Thread Paul Seamons
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

Re: Malfunction Junction, what's your function?

2005-04-27 Thread Jonathan Scott Duff
On Wed, Apr 27, 2005 at 10:30:35AM -0600, Paul Seamons wrote: 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

Re: Malfunction Junction, what's your function?

2005-04-27 Thread Luke Palmer
Thomas Sandla writes: Patrick R. Michaud wrote: On Wed, Apr 27, 2005 at 08:46:53AM -0400, Joshua Gatcomb wrote: The problem is that in the regex version I use capturing parens to identify the character matched. For the purposes of the problem I don't need to rely on the first character

Re: Malfunction Junction, what's your function?

2005-04-27 Thread Patrick R. Michaud
On Wed, Apr 27, 2005 at 06:29:46PM +0200, Thomas Sandlaß wrote: Patrick R. Michaud wrote: my $matches = any( @x_chars ) eq any( @y_chars ); my $match = $matches.pick; Perhaps the easiest way to explain the difficulty here is to note that executing a relational op (i.e. returning a boolean)

Re: LABELS: block

2005-04-27 Thread Aaron Sherman
On Tue, 2005-04-26 at 17:13, Juerd wrote: or you could have a keyword that introduces the label: rx/label ws+ identifier ws+ (statement|control)/ or you could use some kind of trickery: rx/label : $/ Or make it a macro. labelfoo; for 1... { ... } This has

Re: Malfunction Junction, what's your function?

2005-04-27 Thread Rod Adams
Thomas Sandlaß wrote: Patrick R. Michaud wrote: On Wed, Apr 27, 2005 at 08:46:53AM -0400, Joshua Gatcomb wrote: The problem is that in the regex version I use capturing parens to identify the character matched. For the purposes of the problem I don't need to rely on the first character matched I

Re: Malfunction Junction, what's your function?

2005-04-27 Thread Patrick R. Michaud
On Wed, Apr 27, 2005 at 10:30:35AM -0600, Paul Seamons wrote: Minor note. Would you want this: sub infix:myeq(Str $a, Str $b) { return ($a eq $b) ? $a : ''; } to be [corrected]: sub infix:myeq(Str $a, Str $b) { return ($a eq $b) ?? $a but bool::true :: ''; } Perhaps, but I

Re: Malfunction Junction, what's your function?

2005-04-27 Thread Luke Palmer
Rod Adams writes: Perhaps the easiest way to explain the difficulty here is to note that executing a relational op (i.e. returning a boolean) value on a junction argument returns a junction of boolean values. Is that so? Does Perl6 have some fundamental law of junction preservation? I

Re: use English

2005-04-27 Thread Luke Palmer
Aaron Sherman writes: Ever since I stopped caring about speed, I've started to write code almost twice as fast. And the code itself isn't slower. Ok, so let's separate the premature optimization from removing massive bottlenecks from code. When I can get a reporting program that takes

Re: Malfunction Junction, what's your function?

2005-04-27 Thread Rod Adams
Luke Palmer wrote: Rod Adams writes: Perhaps the easiest way to explain the difficulty here is to note that executing a relational op (i.e. returning a boolean) value on a junction argument returns a junction of boolean values. Is that so? Does Perl6 have some fundamental law of

Re: turning off warnings for a function's params?

2005-04-27 Thread Piers Cawley
David Storrs [EMAIL PROTECTED] writes: I image we've all written logging code that looks something like this (Perl5 syntax): sub foo { my ($x,$y) = @_; note(Entering frobnitz(). params: '$x', '$y'); ... } This, of course, throws an 'uninitialized value in

This week's summary

2005-04-27 Thread The Perl 6 Summarizer
The Perl 6 Summary for the week ending 2005-04-26 It's my turn again. What fun. What, I hear you all ask, has been going on in the crazy mixed up world of Perl 6 design and development? Read this summary and, beginning with perl6-compiler, I shall tell you. This week in

Re: Sun Fortress and Perl 6

2005-04-27 Thread Sam Vilain
Luke Palmer wrote: `is pure` would be great to have! For possible auto-memoization of likely-to-be-slow subs it can be useful, but it also makes great documentation. It's going in there whether Larry likes it or not[1]. There are so incredibly many optimizations that you can do on pure functions,