Re: When can I take given as read?

2005-06-21 Thread Carl Franks
sub factorial (Int $n is topic) { return 1 when 0; return $n * factorial $n; } hmm, could we write... sub foo (Class $self is topic: +$foo, +$bar) { .method; } to avoid having to use ./ ? Cheers, Carl

Re: When can I take given as read?

2005-06-21 Thread Piers Cawley
Carl Franks [EMAIL PROTECTED] writes: sub factorial (Int $n is topic) { return 1 when 0; return $n * factorial $n; } hmm, could we write... sub foo (Class $self is topic: +$foo, +$bar) { .method; } to avoid having to use ./ ? Yay!

Re: When can I take given as read?

2005-06-21 Thread Juerd
Carl Franks skribis 2005-06-21 8:54 (+0100): hmm, could we write... sub foo (Class $self is topic: +$foo, +$bar) { .method; } For such a short method, perhaps just using $_ directly makes more sense: sub foo (Class $_: +$foo, +$bar) { .method; } to avoid having to use ./

Re: AUTLOAD and $_

2005-06-21 Thread Adam Kennedy
I think there exists an even simpler way to avoid any mess involved. Instead of letting AUTOLOAD receive and pass on arguments, and instead of letting AUTOLOAD call the loaded sub, why not have AUTOLOAD do its thing, and then have *perl* call the sub? sub AUTOLOAD ($whatever) { # but no

Re: AUTLOAD and $_

2005-06-21 Thread Luke Palmer
On 6/21/05, Adam Kennedy [EMAIL PROTECTED] wrote: You are of course assuming that every use of AUTOLOAD, for all time, will result in a) Calling another function b) An error Wouldn't this lead to hacks where people do things like this just to prevent perl thinking it's a failure? sub

Re: ./method defunct

2005-06-21 Thread Jonathan Scott Duff
On Mon, Jun 20, 2005 at 07:34:57PM -0400, Kurt wrote: On 6/18/05, Juerd wrote: Why exactly is the slash not acceptable for you? Almost everyone has said they like it. I personally find ./method prettier and easier to type than any of the alternatives. I don't like it because I think

Re: ./method defunct

2005-06-21 Thread Juerd
What does this have to do with perl6-internals? F-up to p6l. Matthew Zimmerman skribis 2005-06-21 11:27 (-0400): $self-_fraction * $self-concentration + $s2-_fraction * $s2-concentration You can still write it like that, if you declare a

Re: ./method defunct

2005-06-21 Thread Juerd
Jonathan Scott Duff skribis 2005-06-21 10:00 (-0500): I expect that soon after perl6 is released (heck, maybe before it's released) we'll get tools that will translate perl6 to perl6 while performing some syntactic manipulation. For instance, it could explicitize code (replacing ./method with

Re: AUTLOAD and $_

2005-06-21 Thread Juerd
Adam Kennedy skribis 2005-06-21 12:10 (+1000): You are of course assuming that every use of AUTOLOAD, for all time, will result in a) Calling another function b) An error That is more or less what it's for. Do note that this other function that is called can be entirely statementless, thus a

Re: AUTLOAD and $_

2005-06-21 Thread chromatic
On Tue, 2005-06-21 at 13:35 +, Luke Palmer wrote: I think people are being pretty closed-minded about closures. I'm pretty closed-minded about writing code that does nothing to prevent the language from doing the wrong thing by default. I already have a fantastic way to write code that

Re: ./method defunct

2005-06-21 Thread Matthew Zimmerman
Juerd wrote: What does this have to do with perl6-internals? F-up to p6l. Sorry! Typing faster than my brain is working. Resent to the right list. If I have a complicated mathematical expression If you have anything that is complicated, a verbose version should always be considered, if

Re: ./method defunct

2005-06-21 Thread Matthew Zimmerman
[Sorry, sent this to the wrong list by mistake.] Matthew Zimmerman wrote: Juerd wrote: Kurt skribis 2005-06-20 19:46 (-0400): On 6/20/05, Juerd wrote: Or you can just get your self with a simple (module that does) macro self () { '$?SELF' } And you could do the same for `./`.

Re: AUTLOAD and $_

2005-06-21 Thread Juerd
chromatic skribis 2005-06-21 9:23 (-0700): I already have a fantastic way to write code that does nothing: I don't write it. Just add braces around the thing you don't write. Juerd -- http://convolution.nl/maak_juerd_blij.html http://convolution.nl/make_juerd_happy.html

Re: AUTLOAD and $_

2005-06-21 Thread Larry Wall
On Mon, Jun 20, 2005 at 07:09:42PM -0500, Rod Adams wrote: : S10 talks about how it is AUTOSUB vs AUTOMETH (and others), but AUTOLOAD : is still around. S10 doesn't mention it, but I think it's been said that : AUTOLOAD only gets called as a last resort. Really, the only point of keeping

Re: AUTLOAD and $_

2005-06-21 Thread Rod Adams
Larry Wall wrote: On Mon, Jun 20, 2005 at 07:09:42PM -0500, Rod Adams wrote: : S10 talks about how it is AUTOSUB vs AUTOMETH (and others), but AUTOLOAD : is still around. S10 doesn't mention it, but I think it's been said that : AUTOLOAD only gets called as a last resort. Really, the only