Bart Lateur wrote:
>
> >I hate it, it's miserable. Too much hidden trickery and special cases.
>
> Quite the countrary, I should think. Have you seen the subs
> self_or_default and self_or_CGI in the source of CGI.pm?
Yep, if you check out my File::Remote module I hijacked them. Thanks
again,
On Thu, 24 Aug 2000 02:02:06 +0200, Markus Peter wrote:
>$one{two\three\four} instead of $$$one{two}{three}{four}
Isn't that
$one{two}{three}{four}
--
Bart.
This and other RFCs are available on the web at
http://dev.perl.org/rfc/
=head1 TITLE
Replace $self in @_ with self() builtin (not $ME)
=head1 VERSION
Maintainer: Nathan Wiger <[EMAIL PROTECTED]>
Date: 24 Aug 2000
Version: 1
Mailing List: [EMAIL PROTECTED]
Number: 152
Statu
-Original Message-
From: Bart Lateur [mailto:[EMAIL PROTECTED]]
Sent: Wednesday, August 23, 2000 7:00 PM
To: [EMAIL PROTECTED]
Subject: Re: PROTOPROPOSAL FOR NEW BACKSLASH was Re: implied pascal-like
"with" or "express"
On Tue, 22 Aug 2000 00:03:48 -0600 (MDT), Nathan Torkington wrote:
> =head1 TITLE
>
> Replace $self in @_ with self() builtin (not $ME)
>
Don't impose your religion on others. If people want 'this' instead of
'self', that should be just fine.
It should be pretty easy to define the appropriate $ME-reader like this:
use ObjectStyle 'self';
or
use Object
On Thu, 24 Aug 2000, Hildo Biersma wrote:
> Don't impose your religion on others. If people want 'this' instead of
> 'self', that should be just fine.
>
> It should be pretty easy to define the appropriate $ME-reader like this:
>
> use ObjectStyle 'self';
>
> or
>
> use ObjectStyle 'Java
>sub do_stuff {
>my $self = self;
>$self->{STATE}->{something} = @_;
>}
>
>sub error {
>carp @_ if self->config('VerboseErrors');
>}
I've never really seen anything like this before in other languages (Is that
good or bad?). The closest is Java's odd use o
> "Bart" == Bart Lateur <[EMAIL PROTECTED]> writes:
Bart> On Tue, 22 Aug 2000 00:03:48 -0600 (MDT), Nathan Torkington wrote:
>> Normally what you'd say is:
>>
>> with (%record) {
>>
>> }
>>
>> (look at me, using Larry's new ... operator :-)
Bart> No you didn't. You typed four dots.
T
Tom Christiansen wrote:
>
> It is? I don't see that this is a pain at all. It seems like
> a beautiful point of homogenization. You don't force the user
> to say $self; they could use $this if they wanted. Heck, they
> don't need it at all.
>
> my(undef, @args) = @_;
It's a pain if you
Hildo Biersma wrote:
>
> > =head1 TITLE
> >
> > Replace $self in @_ with self() builtin (not $ME)
> >
>
> Don't impose your religion on others. If people want 'this' instead of
> 'self', that should be just fine.
Whoa! I'm not imposing religion on others. FAR FROM IT! Maybe the
examples I demo
On Thu, 24 Aug 2000 13:27:01 -0700, Nathan Wiger wrote:
>It's a pain if you want to support both function-oriented and
>object-oriented calling forms, as CGI.pm does. For example, you can use
>both of these:
>
> print header;
> print $r->header;
>
>with CGI.pm. Now you need a self_of_default
> "Nathan" == Nathan Wiger <[EMAIL PROTECTED]> writes:
Nathan> The key difference is this: $_[0] always contains the first method
Nathan> argument, regardless of whether you're in an object-oriented or
Nathan> function-oriented context. So, if you need to support both (like CGI.pm
Nathan> and
Tom Christiansen wrote:
>
> So it seems that what you're saying is that you'd like a way to
> *know* for certain whether you were invoked as a method -- or not,
> as the case might be.
Sort of. Actually, I want to not care. Adding a :method constraint
doesn't help (actually hurts) because then t
>Currently, the current object context is passed into a sub as the first
>element of @_, leading to the familiar construct:
> my $self = shift;
>However, this is a big PITA. In particular, if you support lots of
>different calling forms (like CGI.pm), you have to check whether $_[0]
>is a ref,
>It's a pain if you want to support both function-oriented and
>object-oriented calling forms, as CGI.pm does. For example, you can use
>both of these:
> print header;
> print $r->header;
>with CGI.pm. Now you need a self_of_default special method, since
>sometimes $_[0] has a class ref and
15 matches
Mail list logo