Electronics & Programming

develissimo

Open Source electronics development and programming

  • You are not logged in.
  • Root
  • » PHP
  • » [PHP-DEV] Re: phpnamespaces.org! [RSS Feed]

#1 Dec. 1, 2005 16:52:56

l.
Registered: 2009-11-02
Reputation: +  0  -
Profile   Send e-mail  

[PHP-DEV] Re: phpnamespaces.org!


""Jessie Hernandez"" <> wrote in message

>
> 2) How will symbols be resolved inside namespaces? If a class "A" exists
> in
> namespace "N", and a global class "A" also exists, then by referencing
> "A",
> what should happen? Should the namespaced "A" be used? If so, then the
> global "A" cannot be accessed from the namespace. Is this OK? These rules
> would need to be the same and affects the following contexts:
i should know this, but does PHP use :: as the global scope resolver as in
C++ ? if so,
namespaced A ==> $A
global A ==> ::$A

l0t3k

--
PHP Internals - PHP Runtime Development Mailing List
To unsubscribe, visit:http://www.php.net/unsub.php

Offline

#2 Dec. 1, 2005 16:59:21

Jessie H.
Registered: 2009-11-02
Reputation: +  0  -
Profile   Send e-mail  

[PHP-DEV] Re: phpnamespaces.org!


Hi l0t3k,

Yes, this is how it's done in C++, but do we want to allow this syntax for
PHP? If so,
it'll either be :::A, ::A (can be used, but might be inconsistent as ":::"
is used everywhere else), or \A, depending on the final separator...


Regards,

Jessie



""l0t3k"" <> wrote in message

>
> ""Jessie Hernandez"" <> wrote in message
>
> >
> > 2) How will symbols be resolved inside namespaces? If a class "A" exists
> > in
> > namespace "N", and a global class "A" also exists, then by referencing
> > "A",
> > what should happen? Should the namespaced "A" be used? If so, then the
> > global "A" cannot be accessed from the namespace. Is this OK? These
rules
> > would need to be the same and affects the following contexts:
> i should know this, but does PHP use :: as the global scope resolver as
in
> C++ ? if so,
> namespaced A ==> $A
> global A ==> ::$A
>
> l0t3k

--
PHP Internals - PHP Runtime Development Mailing List
To unsubscribe, visit:http://www.php.net/unsub.php

Offline

#3 Dec. 2, 2005 00:31:19

M. S.
Registered: 2009-11-02
Reputation: +  0  -
Profile   Send e-mail  

[PHP-DEV] Re: phpnamespaces.org!


hi,personally, I find :::A, ::A and such constructs *extremely* ugly. MightI suggest using a special keyword to denote global scoped classes?eg:global:::A and such. global already is a keyword, but I'm pretty sure itcould be reused in this context. Plus, it clearly shows where you'regetting it all from.- tul

Jessie Hernandez wrote:Hi l0t3k,

Yes, this is how it's done in C++, but do we want to allow this syntax for
PHP? If so,
it'll either be :::A, ::A (can be used, but might be inconsistent as ":::"
is used everywhere else), or \A, depending on the final separator...


Regards,

Jessie



""l0t3k"" <> wrote in message
""Jessie Hernandez"" <> wrote in message
2) How will symbols be resolved inside namespaces? If a class "A" exists
in
namespace "N", and a global class "A" also exists, then by referencing
"A",
what should happen? Should the namespaced "A" be used? If so, then the
global "A" cannot be accessed from the namespace. Is this OK? Theseruleswould need to be the same and affects the following contexts:i should know this, but does PHP use :: as the global scope resolver asinC++ ? if so,
namespaced A ==> $A
global A ==> ::$A

l0t3k--
PHP Internals - PHP Runtime Development Mailing List
To unsubscribe, visit:http://www.php.net/unsub.php

Offline

#4 Dec. 2, 2005 17:13:50

Jessie H.
Registered: 2009-11-02
Reputation: +  0  -
Profile   Send e-mail  

[PHP-DEV] Re: phpnamespaces.org!


""M. Sokolewicz"" <> wrote in message

> hi,
>
> personally, I find :::A, ::A and such constructs *extremely* ugly. Might
> I suggest using a special keyword to denote global scoped classes?
> eg:
> global:::A and such. global already is a keyword, but I'm pretty sure it
> could be reused in this context. Plus, it clearly shows where you're
> getting it all from.
>

BRILLIANT! I'm going to take this approach. Thanks!!


Regards,

Jessie

--
PHP Internals - PHP Runtime Development Mailing List
To unsubscribe, visit:http://www.php.net/unsub.php

Offline

  • Root
  • » PHP
  • » [PHP-DEV] Re: phpnamespaces.org! [RSS Feed]

Board footer

Moderator control

Enjoy the 20th of January
PoweredBy

The Forums are managed by develissimo stuff members, if you find any issues or misplaced content please help us to fix it. Thank you! Tell us via Contact Options
Leave a Message
Welcome to Develissimo Live Support