Electronics & Programming

develissimo

Open Source electronics development and programming

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

#1 March 21, 2008 23:02:01

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

[RFC] Namespace syntax decision


Marcus Boerger wrote:
> Hello Internals,
>
> we all were asked to stop discussing syntax of namespaces as we were told
> that we would decide after the namespace functionality was fully implemented.
> Now I think that the functionallity is pretty much settled we should
> revisit the syntax. We all have been very patient so far. Anyway here goes
> my take on it:
>
> PHP is very close to Java and C++ in terms of Syntax. And many of our users
> are familiar with one or even both of them. Also we have a tendency to
> especially take syntax from those two or be in line with those two
> languages. That said I see two ways:
>
> 1) namespace foo { }

This is acceptable if nothing can exist outside namespace foo {} except
declare and other namespace declarations.

>
> 2) package foo;
>
> I favor 1) if we allow namespace nesting and 2) if not. The current way of
> nesting is very confusing:
> namespace foo; namespace bar;

I prefer this syntax because it discourages multiple namespaces, but
still allows them (nesting is an inaccurate term in this case, I
strongly encourage not using it)

Greg

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

Offline

#2 March 22, 2008 20:40:54

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

[RFC] Namespace syntax decision


Marcus Boerger wrote:
> Hello Internals,
>
> we all were asked to stop discussing syntax of namespaces as we were told
> that we would decide after the namespace functionality was fully implemented.
> Now I think that the functionallity is pretty much settled we should
> revisit the syntax. We all have been very patient so far. Anyway here goes
> my take on it:
>
> PHP is very close to Java and C++ in terms of Syntax. And many of our users
> are familiar with one or even both of them. Also we have a tendency to
> especially take syntax from those two or be in line with those two
> languages. That said I see two ways:
>
> 1) namespace foo { }
>
> 2) package foo;

I did not notice until now that you had changed the keyword to package.
-1 on this change. Either namespace blah; or namespace blah {}.

Greg

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

Offline

#3 March 22, 2008 23:00:13

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

[RFC] Namespace syntax decision


Hi,

On Fri, 2008-03-21 at 22:36 +0100, Marcus Boerger wrote:
> PHP is very close to Java and C++ in terms of Syntax. And many of our users
> are familiar with one or even both of them. Also we have a tendency to
> especially take syntax from those two or be in line with those two
> languages. That said I see two ways:
>
> 1) namespace foo { }
>
> 2) package foo;
>
> I favor 1) if we allow namespace nesting and 2) if not. The current way of
> nesting is very confusing:
> namespace foo; namespace bar;

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.

johannes


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

Offline

#4 March 27, 2008 00:42:47

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

[RFC] Namespace syntax decision


Hi,

On Fri, 2008-03-21 at 22:36 +0100, Marcus Boerger wrote:
> we all were asked to stop discussing syntax of namespaces as we were told
> that we would decide after the namespace functionality was fully implemented.
> Now I think that the functionallity is pretty much settled we should
> revisit the syntax. We all have been very patient so far. Anyway here goes
> my take on it:

Allowing multiple namespaces per file using the "namespace foo;" syntax
feels really bad for me. Therefore I basically agree with Marcus on the
two options.

> 1) namespace foo { }
>
> 2) package foo;
>
> I favor 1) if we allow namespace nesting and 2) if not. The current
> way of
> nesting is very confusing:
> namespace foo; namespace bar;

About the options I don't have strong opinions but I see that people
want multiple namespaces per file. We aren't like other languages which
enforce one class per file and I don't think we should enforce one
namespace per file. Therefore I prefer 1).

johannes


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

Offline

  • Root
  • » PHP
  • » [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