Piers Cawley wrote:
For myself, I'd like to see AUTOLOAD with a signature along the lines of:
sub AUTOLOAD (Symbol $sym, ArgumentCollection $args, Continuation $cc)
returns (Code | Pair)
{
...
}
This presupposes a deal of support infrastructure, but also provides
flexibility. F
Luke Palmer <[EMAIL PROTECTED]> writes:
> On 6/20/05, chromatic <[EMAIL PROTECTED]> wrote:
>> On Mon, 2005-06-20 at 12:11 +0200, Juerd wrote:
>>
>> > I think there exists an even simpler way to avoid any mess involved.
>> > Instead of letting AUTOLOAD receive and pass on arguments, and instead
>>
On Tue, 2005-06-21 at 20:08 -0500, Rod Adams wrote:
> Should we then perhaps rename it to: DEPRECATED_PERL5_AUTOLOAD ?
Poster 1: I hate it!
Poster 2: I love it!
Poster 3: How about PERL_5_AUTOLOAD_DO_NOT_USE?
Poster 4: That's a stupid feature to add!
Poster 5: That's too much to type! Isn't
Maxim Sloyko skribis 2005-06-22 14:27 (+0400):
> Can we do "return undef" in this case? I mean. can undef mean a no-op
> in subref context?
That's a rather false value. I hope undef is not executable. It's a much
better idea to special case empty closures, IMO.
Juerd
--
http://convolution.nl/
Rod Adams skribis 2005-06-21 20:08 (-0500):
> Should we then perhaps rename it to: DEPRECATED_PERL5_AUTOLOAD ?
That sounds like a good idea. In fact, a pragma to enable it would not
be a bad idea either, IMO.
Juerd
--
http://convolution.nl/maak_juerd_blij.html
http://convolution.nl/make_juerd_h
Juerd wrote:
sub AUTOLOAD ($whatever) { # but no *[at]_
my $s = get_subref_for $whatever;
our &::($whatever) := $s;
return sub () { 1 };
Then the subref will not be executed, and the bug will very quickly be
discovered. I don't see any problem with this.
Can we do "return un
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
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
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
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
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 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
> 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 Mon, Jun 20, 2005 at 04:37:31PM -0600, Luke Palmer wrote:
> On 6/20/05, chromatic <[EMAIL PROTECTED]> wrote:
> > On Mon, 2005-06-20 at 12:11 +0200, Juerd wrote:
> >
> > > I think there exists an even simpler way to avoid any mess involved.
> > > Instead of letting AUTOLOAD receive and pass on a
Juerd wrote:
I also don't see the symmetry between AUTOLOAD and AUTOMETH. Two things
bother be about that: LOAD versus METH, while it should be SUB versus
METH, and that METHOD is abbreviated while in the method keyword it is
not. Either it should be abbreviated everywhere: meth foo { ... }, or
chromatic skribis 2005-06-20 15:58 (-0700):
> I think:
> sub AUTOLOAD {}
> is better than:
> sub AUTOLOAD { return sub {} }
It's nicer to type, but I think that your preferred syntax means that
the AUTOLOAD sub itself has to call any loaded code, which can mean that it
has to fit arbit
On Mon, 2005-06-20 at 16:37 -0600, Luke Palmer wrote:
> On 6/20/05, chromatic <[EMAIL PROTECTED]> wrote:
> > Who says AUTOLOAD will always either call a loaded sub or fail?
> Uh, what else can it do? It doesn't have to load a sub to return a
> code reference.
I think:
class NullObject
{
chromatic skribis 2005-06-20 14:56 (-0700):
> Who says AUTOLOAD will always either call a loaded sub or fail?
I don't recall any clearl spec of Perl 6's AUTOLOAD. If there is
something I missed, say so and please do provide example code. Questions
like the one quoted tend to irritate me.
There is
On 6/20/05, chromatic <[EMAIL PROTECTED]> wrote:
> On Mon, 2005-06-20 at 12:11 +0200, Juerd wrote:
>
> > 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
chromatic wrote:
Who says AUTOLOAD will always either call a loaded sub or fail?
Maybe it should be passed a continuation too, then? Then it could
choose exactly what to do with it.
Sam.
On Mon, 2005-06-20 at 12:11 +0200, Juerd wrote:
> 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
Juerd wrote:
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 ($w) { return o
Juerd skribis 2005-06-20 12:11 (+0200):
> sub AUTOLOAD ($w) { return our &::($w) = get_subref_for $w }
> sub AUTOLOAD { our &::($^a) = get_subref_for $^a }
That's :=, of course.
Juerd
--
http://convolution.nl/maak_juerd_blij.html
http://convolution.nl/make_juerd_happy.html
http://convo
Sam Vilain skribis 2005-06-20 12:54 (+1200):
> sub AUTOLOAD($_ = $CALLER::$_, [EMAIL PROTECTED]) {
> In a way, $_ forms part of the prototype definition, but is "out of band"
> to the regular arguments on @_; it can't interfere with positional
> characteristics, or you have to "shift" it off befor
24 matches
Mail list logo