Electronics & Programming

develissimo

Open Source electronics development and programming

  • You are not logged in.
  • Root
  • » PHP
  • » [PHP-DEV] Re: [RFC] Namespace syntax decision [RSS Feed]

#1 March 22, 2008 12:46:58

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

[PHP-DEV] Re: [RFC] Namespace syntax decision


Em Sex, 2008-03-21 às 17:01 -0500, Gregory Beaver escreveu:
> > 1) namespace foo { }
>
> This is acceptable if nothing can exist outside namespace foo {} except
> declare and other namespace declarations.
>

Indeed!

Here's my try:http://felipe.ath.cx/diff/namespace.diffhttp://felipe.ath.cx/diff/namespace.phpt--
Regards,
Felipe Pena.


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

Offline

#2 March 22, 2008 16:30:34

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

[PHP-DEV] Re: [RFC] Namespace syntax decision


Hello Felipe,

looks pretty good to me. Let's see what other responses we get by late
wedensday.

marcus

Saturday, March 22, 2008, 12:46:08 PM, you wrote:

> Em Sex, 2008-03-21 às 17:01 -0500, Gregory Beaver escreveu:
>> > 1) namespace foo { }
>>
>> This is acceptable if nothing can exist outside namespace foo {} except
>> declare and other namespace declarations.
>>

> Indeed!

> Here's my try:
>http://felipe.ath.cx/diff/namespace.diff>http://felipe.ath.cx/diff/namespace.phptBest regards,
Marcus


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

Offline

#3 March 22, 2008 17:18:15

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

[PHP-DEV] Re: [RFC] Namespace syntax decision


Hi,

Am Samstag, den 22.03.2008, 16:29 +0100 schrieb Marcus Boerger:

> looks pretty good to me. Let's see what other responses we get by late
> wedensday.

I like the current syntax and don't think it is confusing. So -1 for
changing it.

cu, Larssignature.ascDescription:Dies ist ein digital signierter Nachrichtenteil

Attachments:
attachment signature.asc (835 bytes)

Offline

#4 March 22, 2008 18:51:11

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

[PHP-DEV] Re: [RFC] Namespace syntax decision


Lars Strojny wrote:Hi,

Am Samstag, den 22.03.2008, 16:29 +0100 schrieb Marcus Boerger:
looks pretty good to me. Let's see what other responses we get by late
wedensday.I like the current syntax and don't think it is confusing. So -1 for
changing it.

cu, LarsI'm also -1 on this one. If your namespace needs to be in brackets {}then that means more indentation. Not that it's a huge deal but I liketo keep the indents to a minimum.--
PHP Internals - PHP Runtime Development Mailing List
To unsubscribe, visit:http://www.php.net/unsub.php

Offline

#5 March 22, 2008 18:59:08

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

[PHP-DEV] Re: [RFC] Namespace syntax decision


Hello Ryan,

Saturday, March 22, 2008, 6:50:36 PM, you wrote:

> Lars Strojny wrote:
>> Hi,
>>
>> Am Samstag, den 22.03.2008, 16:29 +0100 schrieb Marcus Boerger:
>>
>>> looks pretty good to me. Let's see what other responses we get by late
>>> wedensday.
>>
>> I like the current syntax and don't think it is confusing. So -1 for
>> changing it.
>>
>> cu, Lars

> I'm also -1 on this one. If your namespace needs to be in brackets {}
> then that means more indentation. Not that it's a huge deal but I like
> to keep the indents to a minimum.

Who forces you to do indentation? Most C++ code that uses namespaces indeed
is not indented. And I see not reason it should. If it whould then the
namespaces with just a semicolon at the end would need the same indentation.

Best regards,
Marcus


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

Offline

#6 March 22, 2008 22:21:48

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

[PHP-DEV] Re: [RFC] Namespace syntax decision


Why can't we stick to consistency ? PHP (classes, functions,
interfaces, abstracts, etc) are all done the same way. What is the
"need" of changing this ?

I see reasons like :

- I don't like indentatation (Answer to that: PHP must make you quite
sad then... and I can't imagine what python makes you feel like...)

So I think what we should do here is either reassemble the ideas (That
were of course lost since the initial discussions).

- Why did we want to call it a package ? Simply because it behaves
exactly like packages ?
- Why do we decide to have a whole new way of declaring namespaces ?
(IE: No braces)
- Since we decided to have "namespaces" what is "so" bad about having
nested namespaces?

Do we want to be "that" different from others? I think having a
solution that looks a lot like other software languages is something
that will not only bring us users but also bring us a lot of love from
other language developers (when they have to use PHP (because yes,
some have to use other languages)).

Greg came up with a pretty good patch for multiple namespaces per
file. However it does not follow the "PHP Coding Practices" - In terms
of style and characters used.

Greg? Stas? Dmitry? Could we get a "resume" of the backstage talks you
guys spoke about? I'm sure you did so just a little taste to inform us
all of "why" we decided to change PHP's general syntax would be
awesome :)

Thanks,

D

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

Offline

#7 March 22, 2008 23:19:49

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

[PHP-DEV] Re: [RFC] Namespace syntax decision


Felipe Pena wrote:
> Em Sex, 2008-03-21 às 17:01 -0500, Gregory Beaver escreveu:
>>> 1) namespace foo { }
>> This is acceptable if nothing can exist outside namespace foo {} except
>> declare and other namespace declarations.
>>
>
> Indeed!
>
> Here's my try:
>http://felipe.ath.cx/diff/namespace.diff>http://felipe.ath.cx/diff/namespace.phpt>

Hi Felipe,

The patch is pristine coding, but I do think the error message needs
some loving:

+ if (zend_do_namespace_check(TSRMLS_C) == FAILURE) {
+ zend_error(E_COMPILE_ERROR, "Only namespace declaration
is allowed
in the script");

This implies that only "namespace" is allowed, and would be confusing to
99% of users. Might I suggest this error message instead:

"This script contains namespaces, all other code must be contained
within namespace declarations"

Greg

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

Offline

#8 March 23, 2008 00:08:06

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

[PHP-DEV] Re: [RFC] Namespace syntax decision


Em Sáb, 2008-03-22 às 17:19 -0500, Gregory Beaver escreveu:
> Felipe Pena wrote:
> > Em Sex, 2008-03-21 às 17:01 -0500, Gregory Beaver escreveu:
> >>> 1) namespace foo { }
> >> This is acceptable if nothing can exist outside namespace foo {} except
> >> declare and other namespace declarations.
> >>
> >
> > Indeed!
> >
> > Here's my try:
> >http://felipe.ath.cx/diff/namespace.diff> >http://felipe.ath.cx/diff/namespace.phpt> >
>
> Hi Felipe,
>
> The patch is pristine coding, but I do think the error message needs
> some loving:
>
> + if (zend_do_namespace_check(TSRMLS_C) == FAILURE) {
> + zend_error(E_COMPILE_ERROR, "Only namespace declaration
> is allowed
> in the script");
>
> This implies that only "namespace" is allowed, and would be confusing to
> 99% of users. Might I suggest this error message instead:
>
> "This script contains namespaces, all other code must be contained
> within namespace declarations"

Nice. Patch updated! :)

--
Regards,
Felipe Pena.


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

Offline

#9 March 23, 2008 02:55:06

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

[PHP-DEV] Re: [RFC] Namespace syntax decision


Hi!Why can't we stick to consistency ? PHP (classes, functions,I think "consistency" became, as many other previously useful words, tomean "agree with me" on this list, so it's meaningless.Greg? Stas? Dmitry? Could we get a "resume" of the backstage talks you
guys spoke about? I'm sure you did so just a little taste to inform us
all of "why" we decided to change PHP's general syntax would be
awesome :)We discussed this topic like 20 times already, so how you expect to hearsomething new now?--
Stanislav Malyshev, Zend Software Architect
http://www.zend.com/(408)253-8829 MSN:

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

Offline

#10 March 23, 2008 10:06:16

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

[PHP-DEV] Re: [RFC] Namespace syntax decision


Johannes Schlüter schrieb:I said in some previous post I won't like multiple namespaces per file
using the 2nd syntax. So imo: either on ns per file and the 2nd syntax
or allow multiple and use brackets. And then I prefer the latter.I second that emotion.

--
Sebastian Bergmannhttp://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: [RFC] Namespace syntax decision [RSS Feed]

Board footer

Moderator control

Enjoy the 16th of December
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