Hello all,
Sorry to post here being an "outsider".
I didn't post because I know nothing about the internals, really.
However after some incomplete thought I have a not very thorough
suggestion about the ambiguity issue mentioned in the RFC wiki.
I would like to ask if this is possible.
Let me quote the challenge here:
<quote> // is this class one::step or namespace one::step? one::step::two(); </quote>Is is possible that the engine first looks for
classes, then namespaces? So
"one::step::two();" should always result in:
Namespace: one
Class: step
Static Method: two
Now the "ambiguity" is resolved.
If we want to really mean namespace "one::step" and function two(),
one must explicitly write the following:
(one::step)::two();
Yes, parenthesis, just like when we want to write (1 + 2) * 3.
So my question is: can parenthesis play a part in namespace resolving?
There can be problem, e.g. I don't know if the engine can distinguish it
from typecasting without many efforts. But anyway I hope this doesn't
sound too stupid :).
T
Hi,
http://wiki.php.net/rfc/namespaceissues
Read it and discuss. Let's be clear people: the technical problems in
namespaces are limited and solvable. The problems in the political
environment surrounding them may not be. Wouldn't politics be a
stupid-ass reason to remove namespaces?Greg
Edmund Tam wrote:
(one::step)::two();
Yes, parenthesis, just like when we want to write (1 + 2) * 3.
So my question is: can parenthesis play a part in namespace resolving?
see this is the problem and where the solution should be (imo)
mynamespace::anotherspace::somespace <<makes sense
class::method() <<makes sense
it's when you join the two together that the ambiguity comes in
so the solution should be some way of visually and technically defining
where a namespace-path ends
only solutions are:
parenthesis around the namespace-path:
(mynamespace::anotherspace::somespace)class::method()
or a separator at the end of the namespace-path (greg's option 2)
mynamespace::anotherspace::somespace:::class::method() [:::]
mynamespace::anotherspace::somespace:>class::method() [:>]
mynamespace::anotherspace::somespace class::method() [ (space)]
mynamespace::anotherspace::somespace..class::method() [..]
anything clear and unambiguous visually!