> 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
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!
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 us
> 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
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
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 th
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 `./`.
Certainly.
However, there has proven to be much demand for something like ./met
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 decla
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
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, thu
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 doe
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 only
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
http://convolution
[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 `./`.
C
On 6/21/05, Matthew Zimmerman <[EMAIL PROTECTED]> wrote:
> Could we revisit the idea of using a shorter keyword for $?SELF, like
> 'o'? I know that $Larry said the idea was "probably" not going to work:
>
>http://tinyurl.com/7baz6
>
> but I'm curious if the reasoning that killed it then still
Kevin Scaldeferri wrote:
It seems to me like the time Devel::Cover takes to do its book-keeping
when a process terminates is linear in the total number of files in the
cover_db, rather than linear in the number of files involved in that
particular process.
[snip]
This seems unfortunate for a
On Jun 21, 2005, at 1:09 PM, James E Keenan wrote:
Kevin Scaldeferri wrote:
It seems to me like the time Devel::Cover takes to do its
book-keeping when a process terminates is linear in the total number
of files in the cover_db, rather than linear in the number of files
involved in that part
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 AUTOLOA
>>> This seems unfortunate for at least two reasons:
>>> 1) it ends up taking a really long time to run the tests. At some
>>> point, maybe long enough that nightly tests become prohibitive (even
>>> more so for continuous integration).
> We have a substantial Perl code base (as I've said sever
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 po
20 matches
Mail list logo