Re: [PHP-DEV] Namespaces
On Sat, 8 Mar 2003, l0t3k wrote: this may be a bit premature, but how do i inject the classes, functions and constants in my extension into a namespace ? You can't do that. Derick -- my other box is your windows PC - Derick Rethans http://derickrethans.nl/ PHP Magazine - PHP Magazine for Professionals http://php-mag.net/ - -- PHP Development Mailing List http://www.php.net/ To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP-DEV] Namespaces
Derick, is this planned then ? it would make no sense not to support it. actually i should clarify that i want the extension to define its own namespace into which all its classes, consts and vars go (as opposed to inserting into a preexisting one). Derick Rethans [EMAIL PROTECTED] wrote in message news:[EMAIL PROTECTED] On Sat, 8 Mar 2003, l0t3k wrote: this may be a bit premature, but how do i inject the classes, functions and constants in my extension into a namespace ? You can't do that. Derick -- my other box is your windows PC - Derick Rethans http://derickrethans.nl/ PHP Magazine - PHP Magazine for Professionals http://php-mag.net/ - -- PHP Development Mailing List http://www.php.net/ To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP-DEV] Namespaces
On Sat, 8 Mar 2003, l0t3k wrote: Derick, is this planned then ? it would make no sense not to support it. actually i should clarify that i want the extension to define its own namespace into which all its classes, consts and vars go (as opposed to inserting into a preexisting one). Ah, you meant the C code... not sure then. Derick -- my other box is your windows PC - Derick Rethans http://derickrethans.nl/ PHP Magazine - PHP Magazine for Professionals http://php-mag.net/ - -- PHP Development Mailing List http://www.php.net/ To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP-DEV] Namespaces
At 08:10 08.03.2003, l0t3k wrote: this may be a bit premature, but how do i inject the classes, functions and constants in my extension into a namespace ? l0t3k See below :-) marcus /* {{{ register_namespace */ /* You will have to alloc the pns before the call */ void register_namespace(zend_namespace * pns, char *namespace_name TSRMLS_DC) { pns-name_length = strlen(namespace_name); pns-name = namespace_name; zend_hash_add(CG(global_namespace).class_table, pns-name, pns-name_length+1, (void **)pns, sizeof(zend_namespace *), NULL); zend_init_namespace(pns TSRMLS_CC); } /* }}} */ /* {{{ register_interface */ /* You will have to alloc the pce before the call and namespace_entry must be valid */ void register_interface(zend_class_entry *pce, zend_namespace *namespace_entry, char *class_name TSRMLS_DC) { pce-type = ZEND_USER_CLASS; pce-name_length = strlen(class_name); pce-name = class_name; pce-parent = NULL; pce-num_interfaces = 0; zend_initialize_class_data(pce, 1 TSRMLS_CC); /* entries changed by initialize */ pce-ce_flags = ZEND_ACC_ABSTRACT | ZEND_ACC_INTERFACE; pce-ns = namespace_entry; zend_hash_add(namespace_entry-class_table, class_name, pce-name_length+1, pce, sizeof(zend_class_entry *), NULL); } /* }}} */ -- PHP Development Mailing List http://www.php.net/ To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP-DEV] Namespaces
You, sir, are a gentleman and a scholar ;-) i assume that given your familiarity and recent work with ZE2 that this will be merged ? i can live with a locally patched tree for the moment.. i assume i ZE2 cleans all this up for me after MSHUTDOWN (i.e. i dont need to worry about doing so manually)? l0t3k Marcus Börger [EMAIL PROTECTED] wrote in message news:[EMAIL PROTECTED] At 08:10 08.03.2003, l0t3k wrote: this may be a bit premature, but how do i inject the classes, functions and constants in my extension into a namespace ? l0t3k See below :-) -- PHP Development Mailing List http://www.php.net/ To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP-DEV] Namespaces
At 03:36 09.03.2003, l0t3k wrote: You, sir, are a gentleman and a scholar ;-) i assume that given your familiarity and recent work with ZE2 that this will be merged ? i can live with a locally patched tree for the moment.. No plans on that yet. For now i am using this functionality for a new extension. i assume i ZE2 cleans all this up for me after MSHUTDOWN (i.e. i dont need to worry about doing so manually)? Currently i have many memleaks at shutdown but do not investigate them because i remeber i have heard of problems there and i am shure it would work. regards marcus -- PHP Development Mailing List http://www.php.net/ To unsubscribe, visit: http://www.php.net/unsub.php
[PHP-DEV] Namespaces
this may be a bit premature, but how do i inject the classes, functions and constants in my extension into a namespace ? l0t3k -- PHP Development Mailing List http://www.php.net/ To unsubscribe, visit: http://www.php.net/unsub.php
[PHP-DEV] Namespaces
this may be a bit premature, but how do i inject the classes, functions and constants in my extension into a namespace ? l0t3k -- PHP Development Mailing List http://www.php.net/ To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP-DEV] Re: [Zend Engine 2] Re: [PHP-DEV] namespaces ambiguity
BB why not = then. imo the parser will easily distinguish array BB definition from an expression The last thing we need is symbol reuse. The parser can distinguish a lot of things, the problem is that the human developer would be confused. = has a clear meaning in PHP, adding other meaning to it would have very high WTF factor for the developer. -- Stanislav Malyshev, Zend Products Engineer [EMAIL PROTECTED] http://www.zend.com/ +972-3-6139665 ext.115 -- PHP Development Mailing List http://www.php.net/ To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] To contact the list administrators, e-mail: [EMAIL PROTECTED]
Re: [PHP-DEV] Re: [Zend Engine 2] Re: [PHP-DEV] namespaces ambiguity
Whoa. Once again I'm on that train of thought that eliminates the difference between classes and namespaces. +1 from me. - Stig [Zeev Suraski [EMAIL PROTECTED]] :: is taken, but why not do it the C++ way? It also uses :: for both classes and namespaces. Zeev At 21:35 30-09-01, Stig Sæther Bakken wrote: [Andi Gutmans [EMAIL PROTECTED]] Hey, I just started playing around with the parser to support the namespaces syntax Stig laid out in his RFC. I think I've thought of an ambiguity (with constants) which makes me wonder how feasible the proposed syntax is. Consider the following expression: $test?FOO:BAR:BARBARA Would this mean that the person meant $test?(FOO):(BAR:BARBARA) or $test?(FOO:BAR):BARBARA? Okay, is there another character we can use? Doesn't look that way. Maybe we need to use two characters then? Since both :: and - are taken, // is the best suggestion I can come up with. - Stig -- Stig Sæther Bakken [EMAIL PROTECTED] Fast Search Transfer ASA, Trondheim, Norway -- PHP Development Mailing List http://www.php.net/ To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] To contact the list administrators, e-mail: [EMAIL PROTECTED] -- Stig Sæther Bakken [EMAIL PROTECTED] Fast Search Transfer ASA, Trondheim, Norway -- PHP Development Mailing List http://www.php.net/ To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] To contact the list administrators, e-mail: [EMAIL PROTECTED]
Re: [PHP-DEV] namespaces ambiguity
[Andi Gutmans [EMAIL PROTECTED]] At 09:35 PM 9/30/2001 +0200, Stig Sæther Bakken wrote: [Andi Gutmans [EMAIL PROTECTED]] Hey, I just started playing around with the parser to support the namespaces syntax Stig laid out in his RFC. I think I've thought of an ambiguity (with constants) which makes me wonder how feasible the proposed syntax is. Consider the following expression: $test?FOO:BAR:BARBARA Would this mean that the person meant $test?(FOO):(BAR:BARBARA) or $test?(FOO:BAR):BARBARA? Okay, is there another character we can use? Doesn't look that way. Maybe we need to use two characters then? Since both :: and - are taken, // is the best suggestion I can come up with. // can't be used because of comments. D-oh! :-) - Stig -- Stig Sæther Bakken [EMAIL PROTECTED] Fast Search Transfer ASA, Trondheim, Norway -- PHP Development Mailing List http://www.php.net/ To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] To contact the list administrators, e-mail: [EMAIL PROTECTED]
Re: [PHP-DEV] Re: [Zend Engine 2] Re: [PHP-DEV] namespaces ambiguity
[Zak Greant [EMAIL PROTECTED]] On September 30, 2001 06:15 pm, Wez Furlong wrote: What about . then (Java/Delphi)? --Wez. Wouldn't that conflict with the concatenation operator? Unless I am mistaken, it looks like only the following single symbols are available: % * | \ (outside of quotes at least) Uhm, % and * are taken for modulo and multiplication. So how do these look: HTML\Table - looks too 1980 HTML|Table - hmm, weird I still think Zeev's suggestion (HTML::Table) is very good, if it doesn't impose too much runtime overhead. - Stig -- Stig Sæther Bakken [EMAIL PROTECTED] Fast Search Transfer ASA, Trondheim, Norway -- PHP Development Mailing List http://www.php.net/ To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] To contact the list administrators, e-mail: [EMAIL PROTECTED]
Re: [PHP-DEV] Re: [Zend Engine 2] Re: [PHP-DEV] namespaces ambiguity
Stig Sæther Bakken wrote: Whoa. Once again I'm on that train of thought that eliminates the difference between classes and namespaces. +1 from me. - Stig [Zeev Suraski [EMAIL PROTECTED]] :: is taken, but why not do it the C++ way? It also uses :: for both classes and namespaces. as we are already using classes in our company to emulate namespaces every once in a while (and i slightly remember having seen a tutorial advertising this) its a +1 from my side, too -- Hartmut Holzgraefe [EMAIL PROTECTED] http://www.six.de +49-711-99091-77 -- PHP Development Mailing List http://www.php.net/ To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] To contact the list administrators, e-mail: [EMAIL PROTECTED]
Re: [PHP-DEV] namespaces ambiguity
I still think Zeev's suggestion (HTML::Table) is very good, if it doesn't impose too much runtime overhead. +1 for :: If that is impossible, how about some new combination, like : HTML:Table looks ok, too... Cheerio, Marc. -- PHP Development Mailing List http://www.php.net/ To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] To contact the list administrators, e-mail: [EMAIL PROTECTED]
[PHP-DEV] Re: [Zend Engine 2] Re: [PHP-DEV] Re: [Zend Engine 2] Re: [PHP-DEV] namespaces ambiguity
At 12:46 PM 10/1/2001 +0200, Stig Sæther Bakken wrote: [Zak Greant [EMAIL PROTECTED]] On September 30, 2001 06:15 pm, Wez Furlong wrote: What about . then (Java/Delphi)? --Wez. Wouldn't that conflict with the concatenation operator? Unless I am mistaken, it looks like only the following single symbols are available: % * | \ (outside of quotes at least) Uhm, % and * are taken for modulo and multiplication. So how do these look: HTML\Table - looks too 1980 HTML|Table - hmm, weird I still think Zeev's suggestion (HTML::Table) is very good, if it doesn't impose too much runtime overhead. I don't like Zeev's suggestion because it does impose an extra hash lookup (usually it'll be two) and probably some more logic too. I don't think that new features we add today should suffer from run-time overhead some constructs from the past have had to suffer. By the way, it also has some ambiguities. Is foo::bar() a function in class foo or in namespace foo. No one said you can't have a namespace foo when you have a class foo. I think the best way to go is to go with ':' and live with the ambiguity. Many languages have such ambiguities and it's probably not such a big deal. In light of :: also having ambiguities why not go with :? Andi -- PHP Development Mailing List http://www.php.net/ To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] To contact the list administrators, e-mail: [EMAIL PROTECTED]
Re: [PHP-DEV] Re: [Zend Engine 2] Re: [PHP-DEV] namespaces ambiguity
At 12:48 PM 10/1/2001 +0200, Hartmut Holzgraefe wrote: Stig Sæther Bakken wrote: Whoa. Once again I'm on that train of thought that eliminates the difference between classes and namespaces. +1 from me. - Stig [Zeev Suraski [EMAIL PROTECTED]] :: is taken, but why not do it the C++ way? It also uses :: for both classes and namespaces. as we are already using classes in our company to emulate namespaces every once in a while (and i slightly remember having seen a tutorial advertising this) its a +1 from my side, too Maybe we need to think if there's a possibility to combine namespaces and classes and therefore it automatically would be ::. I am against two mechanisms that use :: but if we can find a nice way of combining the two (haven't thought about it yet) it could be pretty decent. Andi -- PHP Development Mailing List http://www.php.net/ To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] To contact the list administrators, e-mail: [EMAIL PROTECTED]
Re: [PHP-DEV] namespaces ambiguity
On Mon, Oct 01, 2001 at 01:06:05PM +0200, Marc Boeren wrote : I still think Zeev's suggestion (HTML::Table) is very good, if it doesn't impose too much runtime overhead. +1 for :: If that is impossible, how about some new combination, like : Er... I usually don't want my code smile all day long at me ... *SCNR* : - Markus -- PHP Development Mailing List http://www.php.net/ To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] To contact the list administrators, e-mail: [EMAIL PROTECTED]
Re: [PHP-DEV] namespaces ambiguity
On Mon, Oct 01, 2001 at 01:06:05PM +0200, Marc Boeren wrote: If that is impossible, how about some new combination, like : HTML:Table looks ok, too... Some languages use quotes like ' or ` to indicate namespaces. Since the context in question may not allow the start of a string constant anyway, I don't see a problem with this, as in HTML'Table or similar constructs. Kristian -- Kristian Köhntopp, NetUSE AG, Dr.-Hell-Straße, D-24107 Kiel Tel: +49 431 386 435 00, Fax: +49 431 386 435 99 -- PHP Development Mailing List http://www.php.net/ To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] To contact the list administrators, e-mail: [EMAIL PROTECTED]
Re: [PHP-DEV] Re: [Zend Engine 2] Re: [PHP-DEV] namespaces ambiguity
On October 1, 2001 04:46 am, Stig Sæther Bakken wrote: [Zak Greant [EMAIL PROTECTED]] On September 30, 2001 06:15 pm, Wez Furlong wrote: What about . then (Java/Delphi)? --Wez. Wouldn't that conflict with the concatenation operator? Unless I am mistaken, it looks like only the following single symbols are available: % * | \ (outside of quotes at least) Uhm, % and * are taken for modulo and multiplication. Errr... I just threw those in to make you and Wez feel better about . and \\ - really ;D So how do these look: HTML\Table - looks too 1980 HTML|Table - hmm, weird Agreed. I still think Zeev's suggestion (HTML::Table) is very good, if it doesn't impose too much runtime overhead. +1 - seems nice and natural to me. :) -- Zak Greant PHP Quality Assurance Team http://qa.php.net/ We must be the change we wish to see. - M. K. Ghandi -- PHP Development Mailing List http://www.php.net/ To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] To contact the list administrators, e-mail: [EMAIL PROTECTED]
[PHP-DEV] Re: [Zend Engine 2] Re: [PHP-DEV] Re: [Zend Engine 2] Re: [PHP-DEV] namespaces ambiguity
On October 1, 2001 04:51 am, Andi Gutmans wrote: At 12:46 PM 10/1/2001 +0200, Stig Sæther Bakken wrote: [snip] I still think Zeev's suggestion (HTML::Table) is very good, if it doesn't impose too much runtime overhead. I don't like Zeev's suggestion because it does impose an extra hash lookup (usually it'll be two) and probably some more logic too. I don't think that new features we add today should suffer from run-time overhead some constructs from the past have had to suffer. By the way, it also has some ambiguities. Is foo::bar() a function in class foo or in namespace foo. No one said you can't have a namespace foo when you have a class foo. I think the best way to go is to go with ':' and live with the ambiguity. Many languages have such ambiguities and it's probably not such a big deal. In light of :: also having ambiguities why not go with :? Andi This may be a ~very~ daft question, but what effect would having classes behave as read-only namespaces have? Would that alleviate any problems? Just my one cent (not willing to put a whole two cents on this one. ;) -- Zak Greant PHP Quality Assurance Team http://qa.php.net/ We must be the change we wish to see. - M. K. Ghandi -- PHP Development Mailing List http://www.php.net/ To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] To contact the list administrators, e-mail: [EMAIL PROTECTED]
Re: [PHP-DEV] Re: [Zend Engine 2] Re: [PHP-DEV] namespaces ambiguity
BB why not = then. imo the parser will easily distinguish array BB definition from an expression The last thing we need is symbol reuse. The parser can distinguish a lot of things, the problem is that the human developer would be confused. = has a clear meaning in PHP, adding other meaning to it would have very high WTF factor for the developer. sure. the F'ed WTF... :) anyway this is a better solution if the best syntax :: makes stuff slow. thinking in general a namespace is very close to a class, so if there's no tech reasons not to make a single implementation of both it'd be perfect b. -- PHP Development Mailing List http://www.php.net/ To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] To contact the list administrators, e-mail: [EMAIL PROTECTED]
Re: [PHP-DEV] Re: [Zend Engine 2] Re: [PHP-DEV] namespaces ambiguity
On Mon, Oct 01, 2001 at 12:55:16PM +0200, Andi Gutmans wrote: Maybe we need to think if there's a possibility to combine namespaces and classes and therefore it automatically would be ::. I am against two mechanisms that use :: but if we can find a nice way of combining the two (haven't thought about it yet) it could be pretty decent. There's the Python approach, where namespaces are determined by classes, and there's the Perl approach, where everything has a package (which defaults to 'main'). -- Jon Parise ([EMAIL PROTECTED]) . Information Technology (2001) http://www.csh.rit.edu/~jon/ : Computer Science House Member -- PHP Development Mailing List http://www.php.net/ To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] To contact the list administrators, e-mail: [EMAIL PROTECTED]
RE: [PHP-DEV] namespaces ambiguity
Stupid suggestion, is ::: (three colons) pushing it? What's wrong with :, except for the fact that it resembles a smiley? There is already - and =... Cheerio, Marc. -- PHP Development Mailing List http://www.php.net/ To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] To contact the list administrators, e-mail: [EMAIL PROTECTED]
Re: [PHP-DEV] namespaces ambiguity
All I can say about this ... I don't want to language being intelligent and try to assume any behaviour. In C (gosch, again. No, I don't want to turn PHP into C) under certain cicumstances you get ambiguousity warnings. But this wouldn't be a useful idea for PHP because in C its only during compilation whereas in PHP it would be runtime. I'ld like to as some kind of ambiguousity parse error ... $test?FOO:BAR:BARBARA And its unreadable too (perl). People will tend to mix up the default behaviour even it would be $test?(FOO:BAR):BARBARA ... - Markus On Sun, Sep 30, 2001 at 07:31:58PM +0200, Andi Gutmans wrote : Hey, I just started playing around with the parser to support the namespaces syntax Stig laid out in his RFC. I think I've thought of an ambiguity (with constants) which makes me wonder how feasible the proposed syntax is. Consider the following expression: $test?FOO:BAR:BARBARA Would this mean that the person meant $test?(FOO):(BAR:BARBARA) or $test?(FOO:BAR):BARBARA? Andi -- PHP Development Mailing List http://www.php.net/ To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] To contact the list administrators, e-mail: [EMAIL PROTECTED] -- Markus Fischer, http://guru.josefine.at/~mfischer/ EMail: [EMAIL PROTECTED] PGP Public Key: http://guru.josefine.at/~mfischer/C2272BD0.asc PGP Fingerprint: D3B0 DD4F E12B F911 3CE1 C2B5 D674 B445 C227 2BD0 -All your scripts are belong to Zend- -- PHP Development Mailing List http://www.php.net/ To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] To contact the list administrators, e-mail: [EMAIL PROTECTED]
Re: [PHP-DEV] namespaces ambiguity
[Andi Gutmans [EMAIL PROTECTED]] Hey, I just started playing around with the parser to support the namespaces syntax Stig laid out in his RFC. I think I've thought of an ambiguity (with constants) which makes me wonder how feasible the proposed syntax is. Consider the following expression: $test?FOO:BAR:BARBARA Would this mean that the person meant $test?(FOO):(BAR:BARBARA) or $test?(FOO:BAR):BARBARA? Okay, is there another character we can use? Doesn't look that way. Maybe we need to use two characters then? Since both :: and - are taken, // is the best suggestion I can come up with. - Stig -- Stig Sæther Bakken [EMAIL PROTECTED] Fast Search Transfer ASA, Trondheim, Norway -- PHP Development Mailing List http://www.php.net/ To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] To contact the list administrators, e-mail: [EMAIL PROTECTED]
Re: [PHP-DEV] namespaces ambiguity
On Sun, Sep 30, 2001 at 09:35:15PM +0200, Stig Sther Bakken wrote: I just started playing around with the parser to support the namespaces syntax Stig laid out in his RFC. I think I've thought of an ambiguity (with constants) which makes me wonder how feasible the proposed syntax is. Consider the following expression: $test?FOO:BAR:BARBARA Would this mean that the person meant $test?(FOO):(BAR:BARBARA) or $test?(FOO:BAR):BARBARA? Okay, is there another character we can use? Doesn't look that way. Maybe we need to use two characters then? Since both :: and - are taken, // is the best suggestion I can come up with. In what context would '//' not indicate the start of a comment? -- Jon Parise ([EMAIL PROTECTED]) . Information Technology (2001) http://www.csh.rit.edu/~jon/ : Computer Science House Member -- PHP Development Mailing List http://www.php.net/ To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] To contact the list administrators, e-mail: [EMAIL PROTECTED]
[PHP-DEV] Re: [Zend Engine 2] Re: [PHP-DEV] namespaces ambiguity
:: is taken, but why not do it the C++ way? It also uses :: for both classes and namespaces. Zeev At 21:35 30-09-01, Stig Sæther Bakken wrote: [Andi Gutmans [EMAIL PROTECTED]] Hey, I just started playing around with the parser to support the namespaces syntax Stig laid out in his RFC. I think I've thought of an ambiguity (with constants) which makes me wonder how feasible the proposed syntax is. Consider the following expression: $test?FOO:BAR:BARBARA Would this mean that the person meant $test?(FOO):(BAR:BARBARA) or $test?(FOO:BAR):BARBARA? Okay, is there another character we can use? Doesn't look that way. Maybe we need to use two characters then? Since both :: and - are taken, // is the best suggestion I can come up with. - Stig -- Stig Sæther Bakken [EMAIL PROTECTED] Fast Search Transfer ASA, Trondheim, Norway -- PHP Development Mailing List http://www.php.net/ To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] To contact the list administrators, e-mail: [EMAIL PROTECTED]
Re: [PHP-DEV] namespaces ambiguity
At 09:35 PM 9/30/2001 +0200, Stig Sæther Bakken wrote: [Andi Gutmans [EMAIL PROTECTED]] Hey, I just started playing around with the parser to support the namespaces syntax Stig laid out in his RFC. I think I've thought of an ambiguity (with constants) which makes me wonder how feasible the proposed syntax is. Consider the following expression: $test?FOO:BAR:BARBARA Would this mean that the person meant $test?(FOO):(BAR:BARBARA) or $test?(FOO:BAR):BARBARA? Okay, is there another character we can use? Doesn't look that way. Maybe we need to use two characters then? Since both :: and - are taken, // is the best suggestion I can come up with. // can't be used because of comments. Andi -- PHP Development Mailing List http://www.php.net/ To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] To contact the list administrators, e-mail: [EMAIL PROTECTED]
[PHP-DEV] Re: [Zend Engine 2] Re: [PHP-DEV] namespaces ambiguity
Well the difference is that C++ can figure out what to do at compile-time. I don't think we can which means that it would put more logic into run-time which is a bad thing IMO (especially for something new like this). Or can you think of a way to differ between these at compile-time? Andi At 09:56 PM 9/30/2001 +0200, Zeev Suraski wrote: :: is taken, but why not do it the C++ way? It also uses :: for both classes and namespaces. Zeev At 21:35 30-09-01, Stig Sæther Bakken wrote: [Andi Gutmans [EMAIL PROTECTED]] Hey, I just started playing around with the parser to support the namespaces syntax Stig laid out in his RFC. I think I've thought of an ambiguity (with constants) which makes me wonder how feasible the proposed syntax is. Consider the following expression: $test?FOO:BAR:BARBARA Would this mean that the person meant $test?(FOO):(BAR:BARBARA) or $test?(FOO:BAR):BARBARA? Okay, is there another character we can use? Doesn't look that way. Maybe we need to use two characters then? Since both :: and - are taken, // is the best suggestion I can come up with. - Stig -- Stig Sæther Bakken [EMAIL PROTECTED] Fast Search Transfer ASA, Trondheim, Norway -- PHP Development Mailing List http://www.php.net/ To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] To contact the list administrators, e-mail: [EMAIL PROTECTED]
[PHP-DEV] Re: [Zend Engine 2] Re: [PHP-DEV] namespaces ambiguity
What about . then (Java/Delphi)? --Wez. On 09/30/01, Andi Gutmans [EMAIL PROTECTED] wrote: Well the difference is that C++ can figure out what to do at compile-time. I don't think we can which means that it would put more logic into run-time which is a bad thing IMO (especially for something new like this). Or can you think of a way to differ between these at compile-time? Andi At 09:56 PM 9/30/2001 +0200, Zeev Suraski wrote: :: is taken, but why not do it the C++ way? It also uses :: for both classes and namespaces. -- PHP Development Mailing List http://www.php.net/ To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] To contact the list administrators, e-mail: [EMAIL PROTECTED]
Re: [PHP-DEV] Re: [Zend Engine 2] Re: [PHP-DEV] namespaces ambiguity
On September 30, 2001 06:15 pm, Wez Furlong wrote: What about . then (Java/Delphi)? --Wez. Wouldn't that conflict with the concatenation operator? Unless I am mistaken, it looks like only the following single symbols are available: % * | \ (outside of quotes at least) -- Zak Greant PHP Quality Assurance Team http://qa.php.net/ We must be the change we wish to see. - M. K. Ghandi -- PHP Development Mailing List http://www.php.net/ To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] To contact the list administrators, e-mail: [EMAIL PROTECTED]
Re: [PHP-DEV] Re: [Zend Engine 2] Re: [PHP-DEV] namespaces ambiguity
Quoting Zeev Suraski [EMAIL PROTECTED]: :: is taken, but why not do it the C++ way? It also uses :: for both classes and namespaces. +1 on that. -chuck -- Because of your melodic nature, the moonlight never misses an appointment. - fortune cookie -- PHP Development Mailing List http://www.php.net/ To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] To contact the list administrators, e-mail: [EMAIL PROTECTED]
Re: [PHP-DEV] Re: [Zend Engine 2] Re: [PHP-DEV] namespaces ambiguity
why not = then. imo the parser will easily distinguish array definition from an expression b. - Original Message - From: Andi Gutmans [EMAIL PROTECTED] To: Zeev Suraski [EMAIL PROTECTED]; Stig Sæther Bakken [EMAIL PROTECTED] Cc: [EMAIL PROTECTED]; [EMAIL PROTECTED] Sent: Sunday, September 30, 2001 11:02 PM Subject: [PHP-DEV] Re: [Zend Engine 2] Re: [PHP-DEV] namespaces ambiguity Well the difference is that C++ can figure out what to do at compile-time. I don't think we can which means that it would put more logic into run-time which is a bad thing IMO (especially for something new like this). Or can you think of a way to differ between these at compile-time? Andi At 09:56 PM 9/30/2001 +0200, Zeev Suraski wrote: :: is taken, but why not do it the C++ way? It also uses :: for both classes and namespaces. Zeev At 21:35 30-09-01, Stig Sæther Bakken wrote: [Andi Gutmans [EMAIL PROTECTED]] Hey, I just started playing around with the parser to support the namespaces syntax Stig laid out in his RFC. I think I've thought of an ambiguity (with constants) which makes me wonder how feasible the proposed syntax is. Consider the following expression: $test?FOO:BAR:BARBARA Would this mean that the person meant $test?(FOO):(BAR:BARBARA) or $test?(FOO:BAR):BARBARA? Okay, is there another character we can use? Doesn't look that way. Maybe we need to use two characters then? Since both :: and - are taken, // is the best suggestion I can come up with. - Stig -- Stig Sæther Bakken [EMAIL PROTECTED] Fast Search Transfer ASA, Trondheim, Norway -- PHP Development Mailing List http://www.php.net/ To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] To contact the list administrators, e-mail: [EMAIL PROTECTED] -- PHP Development Mailing List http://www.php.net/ To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] To contact the list administrators, e-mail: [EMAIL PROTECTED]