Electronics & Programming

develissimo

Open Source electronics development and programming

  • You are not logged in.
  • Root
  • » PHP
  • » [PHP-DEV] Re: Basic Namespace Requirements [RSS Feed]

#1 Nov. 28, 2005 22:26:22

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

[PHP-DEV] Re: Basic Namespace Requirements


> So, the question is, can we scrap both namespace constants and namespace
> functions and just stay with classes (as was agreed on several months ago,
> Andi himself agreeing to it)? This would make the patch smaller, simpler,
> AND would allow me to reuse the "::" operator (and there would be no
> conflicts with ternary operations).
>
Absolutely. Static methods and Class constants are more than sufficient.
All the added functionality of namespaces without all the baggage.

+1

-Sara

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

Offline

#2 Nov. 28, 2005 22:48:56

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

[PHP-DEV] Re: Basic Namespace Requirements


Hello Sara,

Please explain what the difference is between nested classes, and
this type of namespacing?

If you scrapped namespace constants and functions, then all we have
left is classes. If it was looked at as nested classes, then we get
all the functionality with all the simplicity and the benefit of
being able to use "::".

Please take a moment to explain, because I am an avid user, not a
tokenizer :)

--
Best regards,
Jason

Monday, November 28, 2005, 5:25:41 PM, you wrote:

>> So, the question is, can we scrap both namespace constants and namespace
>> functions and just stay with classes (as was agreed on several months ago,
>> Andi himself agreeing to it)? This would make the patch smaller, simpler,
>> AND would allow me to reuse the "::" operator (and there would be no
>> conflicts with ternary operations).
>>
SG> Absolutely. Static methods and Class constants are more than sufficient.
SG> All the added functionality of namespaces without all the baggage.

SG> +1

SG> -Sara


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

Offline

#3 Nov. 28, 2005 22:51:02

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

[PHP-DEV] Re: Basic Namespace Requirements


Jessie Hernandez schrieb:

> I think this is the best solution thus far. If any one of you still feels a
> need for constants/functions, PLEASE show me a _valid_ example that cannot
> be accomplished by just simply putting the constant/function inside a class
> in the namespace.

No complaints from me. I try to avoid both since a long time. Functions
would be nice, simply for convenience (sometimes one wants to use
something so often that a static method just isn't as nice), but I
really don't see any need for global constants EXCEPT that supporting
everything that's currently OUTSIDE of namespaces would allow to
completetly clean it without further work.

> If I don't hear of any valid arguments, then I'm going to go ahead and scrap
> constants and functions and then concentrate on the final details of the
> patch.

Did you give the "no namespaces in the ternary" idea a try?
Even if this doesn't make it I'd be happy to know if it works.

Anyways, +2 for both : and ::

OLLi

PS: I'm now preparing the final table. We should not stretch this any
more ;-) The First subscribers are getting heart attcks from too much
mail...

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

Offline

#4 Nov. 28, 2005 23:10:47

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

[PHP-DEV] Re: Basic Namespace Requirements


I personally never use constants anyway. But at least functions andvariables should work with namespaces:namespace name1 {
$var = 3;
function func();
}

From a language perspective those should exist only in that namespace.I also think '\' as a seporator is nice. It has this nice filesystemfeeling to it. :)(Although now I'm wondering if we use '\' as a seporator, shouldn't itbe possible to use '\' in stead of the Paamayim Nekudotayim '::'seporator as well? Just to keep things consistent? hmmm... )Oliver Grätz wrote:Jessie Hernandez schrieb:I think this is the best solution thus far. If any one of you still feels a
need for constants/functions, PLEASE show me a _valid_ example that cannot
be accomplished by just simply putting the constant/function inside a class
in the namespace.No complaints from me. I try to avoid both since a long time. Functions
would be nice, simply for convenience (sometimes one wants to use
something so often that a static method just isn't as nice), but I
really don't see any need for global constants EXCEPT that supporting
everything that's currently OUTSIDE of namespaces would allow to
completetly clean it without further work.If I don't hear of any valid arguments, then I'm going to go ahead and scrap
constants and functions and then concentrate on the final details of the
patch.Did you give the "no namespaces in the ternary" idea a try?
Even if this doesn't make it I'd be happy to know if it works.

Anyways, +2 for both : and ::

OLLi

PS: I'm now preparing the final table. We should not stretch this any
more ;-) The First subscribers are getting heart attcks from too much
mail...--
PHP Internals - PHP Runtime Development Mailing List
To unsubscribe, visit:http://www.php.net/unsub.php

Offline

#5 Nov. 29, 2005 06:04:48

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

[PHP-DEV] Re: Basic Namespace Requirements


Sara Golemon schrieb:
> All the added functionality of namespaces without all the baggage.

+1

--
Sebastian Bergmannhttp://www.sebastian-bergmann.de/GnuPG Key: 0xB85B5D69 / 27A7 2B14 09E4 98CD 6277 0E5B 6867 C514 B85B 5D69

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

Offline

  • Root
  • » PHP
  • » [PHP-DEV] Re: Basic Namespace Requirements [RSS Feed]

Board footer

Moderator control

Enjoy the 24th of April
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