Electronics & Programming

develissimo

Open Source electronics development and programming

  • You are not logged in.
  • Root
  • » PHP
  • » [PHP-DEV] Re: Namespaces: Technical proposal [RSS Feed]

#1 Nov. 29, 2005 07:13:01

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

[PHP-DEV] Re: Namespaces: Technical proposal


Oliver Grätz wrote:one absolutely needs to use namespaces inside the ternary. As such cases
will be pretty rare, this is no big drawback. The good thing: no
whitespace magic is needed!so you replace the need for whitespace magic with the need forparentheses? you do notice you are running in circles?regards,
Lukas

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

Offline

#2 Nov. 29, 2005 10:25:10

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

[PHP-DEV] Re: Namespaces: Technical proposal


Lukas Smith schrieb:
> Oliver Grätz wrote:
>
>
>>one absolutely needs to use namespaces inside the ternary. As such cases
>>will be pretty rare, this is no big drawback. The good thing: no
>>whitespace magic is needed!
>
>
> so you replace the need for whitespace magic with the need for
> parentheses? you do notice you are running in circles?

Nope. Parentheses are a totally different thing here. Adding mandatory
whitespace means giving syntactic meaning to something that normally
never should have it. Meaningful whitespace is really evil. On the other
side parentheses are already there. They are an existing concept of
scoping evaluation. The idea simply consists of not having namespaces
inside the ternary:

- Read the "?":
turn off T_WHITESPACE
- "(" and ")":
reactivate between these
(a marker 'whitespace was off before "("' is needed)
- ":":
do nothing
- end of ternary (")" or ";" or something I might have forgotten):
reactivate T_WHITESPACE

Thisd is also very easy to remember since the rule to learn is:
Namespaces don't exist where they can't. And with the ":", there is only
one such place.

OLLi

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

Offline

#3 Nov. 29, 2005 10:51:46

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

[PHP-DEV] Re: Namespaces: Technical proposal


Just wondering. There's another thread about goto and labels running aswell. If they vote for something like:LABEL:while (cond) {

}Wouldn't this add another technical diffuculty with using ':' as anamespace seporator?Oliver Grätz wrote:Lukas Smith schrieb:Oliver Grätz wrote:one absolutely needs to use namespaces inside the ternary. As such cases
will be pretty rare, this is no big drawback. The good thing: no
whitespace magic is needed!so you replace the need for whitespace magic with the need forparentheses? you do notice you are running in circles?Nope. Parentheses are a totally different thing here. Adding mandatory
whitespace means giving syntactic meaning to something that normally
never should have it. Meaningful whitespace is really evil. On the other
side parentheses are already there. They are an existing concept of
scoping evaluation. The idea simply consists of not having namespaces
inside the ternary:

- Read the "?":
turn off T_WHITESPACE
- "(" and ")":
reactivate between these
(a marker 'whitespace was off before "("' is needed)
- ":":
do nothing
- end of ternary (")" or ";" or something I might have forgotten):
reactivate T_WHITESPACE

Thisd is also very easy to remember since the rule to learn is:
Namespaces don't exist where they can't. And with the ":", there is only
one such place.

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

Offline

#4 Nov. 29, 2005 12:36:05

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

[PHP-DEV] Re: Namespaces: Technical proposal


Oliver Grätz wrote:Nope. Parentheses are a totally different thing here. Adding mandatory
whitespace means giving syntactic meaning to something that normally
never should have it. Meaningful whitespace is really evil. On the other
side parentheses are already there. They are an existing concept of
scoping evaluation. The idea simply consists of not having namespaces
inside the ternary:while i agree that the () approach is less bad than the whitespace one
it is still "bad enough" from an language orthogonally point of view ...

--
Hartmut Holzgraefe, Senior Support Engineer .
MySQL AB, www.mysql.com

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

Offline

#5 Nov. 29, 2005 15:26:04

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

[PHP-DEV] Re: Namespaces: Technical proposal


Just wondering. There's another thread about goto and labels running aswell. If they vote for something like:LABEL:while (cond) {

}Wouldn't this add another technical diffuculty with using ':' as anamespace seporator?Fortunately this is another new feature so there's no old code to break.It's simply a matter of giving namespace:class precedence over label:expr.Though yes, preventing that duality of meaning is a good thing.-Sara--
PHP Internals - PHP Runtime Development Mailing List
To unsubscribe, visit:http://www.php.net/unsub.php

Offline

#6 Nov. 29, 2005 16:33:54

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

[PHP-DEV] Re: Namespaces: Technical proposal


On 29 November 2005 15:27, Sara Golemon wrote:

> > Just wondering. There's another thread about goto and labels
> > running as well. If they vote for something like:
> >
> > LABEL:while (cond) {
> >
> > }
> >
> > Wouldn't this add another technical diffuculty with using ':' as a
> > namespace seporator?
> >
> Fortunately this is another new feature so there's no old
> code to break.
> It's simply a matter of giving namespace:class precedence
> over label:expr.
>
> Though yes, preventing that duality of meaning is a good thing.

That's one reason I suggested possible alternatives such as:

while LABEL (cond) {

or

while (cond) LABEL {

I've no particular preference for any one variation -- whatever parses
easiest!

Cheers!

Mike

---------------------------------------------------------------------
Mike Ford, Electronic Information Services Adviser,
Learning Support Services, Learning & Information Services,
JG125, James Graham Building, Leeds Metropolitan University,
Headingley Campus, LEEDS, LS6 3QS, United Kingdom
Email:
Tel: +44 113 283 2600 extn 4730 Fax: +44 113 283 3211


To view the terms under which this email is distributed, please go tohttp://disclaimer.leedsmet.ac.uk/email.htm--
PHP Internals - PHP Runtime Development Mailing List
To unsubscribe, visit:http://www.php.net/unsub.php

Offline

  • Root
  • » PHP
  • » [PHP-DEV] Re: Namespaces: Technical proposal [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