Hey all, thanks for the discussion.
First, in terms of implimentation, I've gone back and forth between a
few ways to expose it, but it struck me tonight that the most similar
keyword in use currently is $this. Next to that I think would be static.
But it seems like there is a bigger decision to make than this
feature. Should the language itself impose coding guidlines on
developers?
This reference seems notably basic in an OOP language. The Paradigm is
based largely on two concepts: objects and the messages between them.
For each message, the recipient is known (intrinsically) but the
sender is not. It seems like a basic property of a method call that is
not exposed in a semantically appropriate way.
Chris Trahey
Web Applications Developer
Database Administrator
College Station I.S.D.
On Sep 18, 2009, at 7:28 PM, Larry Garfield <la...@garfieldtech.com>
wrote:
On Friday 18 September 2009 9:12:55 am troels knak-nielsen wrote:
> On Fri, Sep 18, 2009 at 1:05 PM, Ford, Mike
<m.f...@leedsmet.ac.uk> wrote:
> > Well, that sounds like a pretty good definition of a "magic"
constant, so
> > maybe __CALLER__ might be appropriate as well?
>
> It's not a constant, is it now?
>
> __FILE__, __LINE__, __CLASS__ etc. can be resolved at compile-time.
> The caller will only be known at run time.
>
> I, for one, am quite happy that it's fairly complicated and
convoluted
> to get the caller of a method, since it could lead to some seriously
> incomprehensible code in the hands of someone who don't know what
they
> are doing. Requiring the user to use the backtrace is a clear
warning
> sign, and I think that's a good thing.
That's the point I was trying to get at earlier. Implicit context
is ugly.
Doing something ugly should require ugly code. That helps tell you
it's ugly,
and you probably shouldn't be doing it. (Isn't there a Bjarn
Straussup quote
along those lines somewhere?)
--
Larry Garfield
la...@garfieldtech.com
--
PHP Internals - PHP Runtime Development Mailing List
To unsubscribe, visit: http://www.php.net/unsub.php