Well, my thinking was, in my annotation engine, rather than globally
registering aliases for fully-qualified annotation-type class-names, I
would support the use-statement.

This is generally how it works in other languages (such as C#) that have
built-in support for annotations.

So you'd be able to say "use VendorName\AnnotationLibrary\SomeAnnotation"
at the top of your script, and emulating the PHP name-resolution rules, you
would then be able to annotation classes/properties simply with "@some"
rather than the full class-name.

I know this is very specific to my project, but I could see this being
important to other aspects of meta-programming with PHP in general. Clearly
I'm not the first person who has needed this - there are numerous (more or
less complete) implementations around the net...

Although as said, I see your argument about time/effort vs usefulness, and
I do agree, there are probably other areas of PHP in need of more immediate
attention than this one. It is a problem that can be solved with user-code,
although, as always, that means varying APIs of varying quality, and most
likely some degree of duplication, since each library that needs these
feature is going to implement this feature in different ways...


2012/1/30 Johannes Schlüter <johan...@schlueters.de>

> On Mon, 2012-01-30 at 09:33 -0500, Rasmus Schultz wrote:
> > From my point of view, the concept of a "file" has become semantically
> more
> > important, and increasingly relevant to Reflection, with the latest PHP
> > features added in the past couple of years.
> >
> > I can see what you mean though - it's probably not a small effort, and
> > there are probably more important aspects of PHP that need attention...
>
> When at runtime do you need this? - I can see the need for doing it
> "statically" when building some form of autoloading map or such.
>
> For static analysis I (in my personal, probably narrow) opinion see
> little benefit in doing it from within PHP (see other part of the
> thread)
>
> johannes
>
>
>

Reply via email to