At 02:07 AM 11/6/2003 +0100, Christian Schneider wrote:
George Schlossnagle wrote:
George (thinking [] is pretty but disliking alternative syntaxes)
Ok, let me recap my short visit on this mailing list:
1) Dangling commas in function calls were considered bloat
No, not bloat. I was worried that
On Wed, 2003-11-05 at 17:48, Andi Gutmans wrote:
At 11:48 AM 11/5/2003 -0500, Ilia Alshanetsky wrote:
On November 5, 2003 11:21 am, you wrote:
Well, like I said before, I am not sure this is a clear case of that. I'm
probably the biggest defender around of the no-magic rule, but [] does
Perlish or not could not be a real reason for adding or not adding a feature
in PHP. The important thing here is if it fits to the language concept or
not.
Kouber
Sara Golemon [EMAIL PROTECTED] wrote in message
news:[EMAIL PROTECTED]
FWIW- (And I understand I'm late chiming in on this thread)
Kouber Saparev wrote:
Perlish or not could not be a real reason for adding or not
adding a feature in PHP. The important thing here is if it
fits to the language concept or not.
Indeed, and IMHO it does, much like
($a==$b)?...
fits in quite well as an alternative to
if ($a==$b)...
It is
At 09:58 AM 11/6/2003 +0100, Stig S. Bakken wrote:
Let's sum up the pros and cons:
Pros: sexiness?
Cons: another BC issue, syntax obfuscation, potential grammar conflicts
Just to be more accurate there are no BC issues and as far as I know, there
aren't any grammar conflicts.
Andi
--
PHP
Mike Robinson wrote:
Perlish or not could not be a real reason for adding or not
adding a feature in PHP. The important thing here is if it
fits to the language concept or not.
Indeed, and IMHO it does, much like
($a==$b)?...
fits in quite well as an alternative to
if ($a==$b)...
It is an
On 05 November 2003 17:19, Marco Tabini wrote:
Ford, Mike [LSS] wrote:
On 05 November 2003 17:06, Marco Tabini contributed these pearls of
wisdom:
Christian Schneider wrote:
Marco Tabini wrote:
$a = [[1,2,3],[1=[1,3,2,2], a=[[1,2,3,4],4,[1,2]]];
On 05 November 2003 18:39, Andrei Zmievski wrote:
On Wed, 05 Nov 2003, Ford, Mike [LSS] wrote:
I don't think the number of characters is the main issue here --
it's about having a *nicer* set of characters. Personally, I'd be
still be in favour (although not quite as
Please move this thread to private email.
- Sascha
--
PHP Internals - PHP Runtime Development Mailing List
To unsubscribe, visit: http://www.php.net/unsub.php
Sascha,
I don't think it's a private matter. Feel free to delete the emails with
this subject when they come in.
Andi
At 01:30 PM 11/6/2003 +0100, Sascha Schumann wrote:
Please move this thread to private email.
- Sascha
--
PHP Internals - PHP Runtime Development Mailing List
To
On Thu, 6 Nov 2003, Andi Gutmans wrote:
Sascha,
I don't think it's a private matter.
If there was anything constructive in that long thread of I
like it -- no, I don't! I might agree with you, but given
the current contents, the noise exceeds the useful debate by
far.
-
On Thu, 2003-11-06 at 13:04, Andi Gutmans wrote:
At 09:58 AM 11/6/2003 +0100, Stig S. Bakken wrote:
Let's sum up the pros and cons:
Pros: sexiness?
Cons: another BC issue, syntax obfuscation, potential grammar conflicts
Just to be more accurate there are no BC issues and as far as I
Hi Christian,
Personally I don't like having two ways of doing things. It makes it harder
for people to read scripts.
However, I think the proposed syntax is significantly more elegant than
today's array() which makes me think twice about the idea and possibly
making an exception to the rule.
Very cool.
How about supporting .. syntax, btw. as in [1..3] or [a..z]? Might
no be the worth, just thinking out loud ;)
Christian Schneider wrote:
I propose to add an alternative (backward compatible) short array
creation syntax:
$a = [ 1, 2, 3 ]; and $a = [ 'a' = 42, 'b' = foo ];
It can
Very cool.
How about supporting .. syntax, btw. as in [1..3] or [a..z]? Might
no be the worth, just thinking out loud ;)
might not be worth it..
Christian Schneider wrote:
I propose to add an alternative (backward compatible) short array
creation syntax:
$a = [ 1, 2, 3 ]; and $a = [ 'a' = 42,
Your idea is even cooler...;)
I would like to have these in PHP.
Kouber
Michael Walter [EMAIL PROTECTED] wrote in message
news:[EMAIL PROTECTED]
Very cool.
How about supporting .. syntax, btw. as in [1..3] or [a..z]? Might
no be the worth, just thinking out loud ;)
Christian Schneider
Andi Gutmans wrote:
I guess I think it'd be interesting to see what other's think. Also,
another point to check is if list() can also be converted into []
because having a hybrid wouldn't be too nice.
Having list() work the same way would be very sexy indeed:
[$a, $b] = [$b, $a];
To be honest I
Hi
The problem i see when using array() (or list()) is that it nearly looks
like it is a function, but it isn't. Using [] instead would clearly
mark this difference.
array() and list() are special language constructs, why shouldn't they look a bit
special?
This doesn't break backwards
On 05 November 2003 08:50, Andi Gutmans contributed these pearls of wisdom:
At 12:33 AM 11/5/2003 +0100, Christian Schneider wrote:
I propose to add an alternative (backward compatible) short
array creation syntax: $a = [ 1, 2, 3 ]; and $a = [ 'a' =
42, 'b' = foo ];
Personally I don't
s0niX wrote:
The problem i see when using array() (or list()) is that it nearly looks
like it is a function, but it isn't. Using [] instead would clearly
mark this difference.
array() and list() are special language constructs, why shouldn't
they look a bit special?
This doesn't break
I like it a lot as well. Having the [] syntax also support range()-like
calls would be a very nice idea as well. :D
Regards,
Manuzhai
Mike Robinson [EMAIL PROTECTED] wrote in message
news:[EMAIL PROTECTED]
s0niX wrote:
The problem i see when using array() (or list()) is that it nearly looks
On Wednesday 05 November 2003 09:49, Andi Gutmans wrote:
However, I think the proposed syntax is significantly more elegant than
today's array() which makes me think twice about the idea and possibly
making an exception to the rule. I think it'll improve the look of PHP
scripts. Also I think
Andi Gutmans wrote:
Personally I don't like having two ways of doing things. It makes it
harder for people to read scripts.
It looks like the one way of doing two separate things.
I mean that semanics of two usages of square brackets as operator is
inverse depending on whether it is used in
On Wed, 05 Nov 2003 19:34:52 +0700
Alexey Trunyov [EMAIL PROTECTED] wrote:
Andi Gutmans wrote:
Personally I don't like having two ways of doing things. It makes it
harder for people to read scripts.
It looks like the one way of doing two separate things.
No, it looks like someone
I do not like the new syntax at all. If anything it seems rather unnatural and
what do you save, typing of 5 characters that makes it clear that this is an
array to even the most novice of users? It certainly not going to make the
code any faster and if anything will only add confusion.
Firm
Hi Andi, Christian--
From a logical standpoint, I think this could be very confusing. To me,
for one, square brackets imply reference, not assignment. Taking
something that means take something out of the array and now using it
to mean put something in the array makes the language a bit less
On Wed, 5 Nov 2003 08:06:53 -0500
Ilia Alshanetsky [EMAIL PROTECTED] wrote:
I do not like the new syntax at all. If anything it seems rather unnatural and
what do you save, typing of 5 characters that makes it clear that this is an
array to even the most novice of users? It certainly not
On Wed, 5 Nov 2003, Ilia Alshanetsky wrote:
I do not like the new syntax at all. If anything it seems rather unnatural and
what do you save, typing of 5 characters that makes it clear that this is an
array to even the most novice of users? It certainly not going to make the
code any faster
Ok, I tried to just listen to what people are saying but this comment
went too far ;-)
Antony Dovgal wrote:
No, it looks like someone trying to turn PHP into Perl (or Python).
I'm just trying to improve PHP. And I write _a lot_ of PHP code, so I
have some idea about where the syntax could be
PROTECTED]
Envoye : mercredi 5 novembre 2003 16:35
A : Antony Dovgal
Cc : [EMAIL PROTECTED]
Objet : Re: [PHP-DEV] Proposal: Array syntax
Ok, I tried to just listen to what people are saying but this comment
went too far ;-)
Antony Dovgal wrote:
No, it looks like someone trying to turn PHP into Perl
On November 5, 2003 10:34 am, Christian Schneider wrote:
PHP is a mix of C, Perl and other styles anyway, why deny it? It's
strength is that it's a pragmatic and simple language but that doesn't
mean that nothing should be changed ever.
PHP strength (IMHO) is it's simple and clear syntax,
On Wed, 05 Nov 2003 16:34:52 +0100
Christian Schneider [EMAIL PROTECTED] wrote:
I'm just trying to improve PHP. And I write _a lot_ of PHP code, so I
have some idea about where the syntax could be improved IMHO.
changing the syntax is not the best way imho.
PHP is a mix of C, Perl and
On Wed, 5 Nov 2003, Ilia Alshanetsky wrote:
On November 5, 2003 10:34 am, Christian Schneider wrote:
PHP is a mix of C, Perl and other styles anyway, why deny it? It's
strength is that it's a pragmatic and simple language but that doesn't
mean that nothing should be changed ever.
PHP
Antony Dovgal wrote:
do you agree, that $a[] = ''; and $a = []; look almost similar for newbies?
And they both deal with arrays. That's not confusing to me.
Why have $a[] = ''; then in the first place? You already have
array_push($a, ''). Or do you seriously think $a[] = ''; shouldn't be there?
On November 5, 2003 11:21 am, you wrote:
Well, like I said before, I am not sure this is a clear case of that. I'm
probably the biggest defender around of the no-magic rule, but [] does
imply something array-related to most people, so I think the magic part is
much smaller than in other
At 11:48 AM 11/5/2003 -0500, Ilia Alshanetsky wrote:
On November 5, 2003 11:21 am, you wrote:
Well, like I said before, I am not sure this is a clear case of that. I'm
probably the biggest defender around of the no-magic rule, but [] does
imply something array-related to most people, so I
On Wed, 5 Nov 2003, Ilia Alshanetsky wrote:
I do not like the new syntax at all. If anything it seems rather unnatural and
what do you save, typing of 5 characters that makes it clear that this is an
array to even the most novice of users? It certainly not going to make the
code any faster and
On 05 November 2003 15:57, Ilia Alshanetsky contributed these pearls of
wisdom:
On November 5, 2003 10:34 am, Christian Schneider wrote:
PHP is a mix of C, Perl and other styles anyway, why deny it?
It's strength is that it's a pragmatic and simple language
but that doesn't mean that nothing
Rasmus Lerdorf wrote:
On Wed, 5 Nov 2003, Ilia Alshanetsky wrote:
On November 5, 2003 10:34 am, Christian Schneider wrote:
PHP is a mix of C, Perl and other styles anyway, why deny it? It's
strength is that it's a pragmatic and simple language but that doesn't
mean that nothing should be changed
Andi Gutmans wrote:
I don't believe in saving characters.
Agreed, it's not about saving characters (only).
Anyway, it's no biggy and if most people here think it shouldn't be
added then that's fine with me.
Ok, a quick head count gave 9 people pro, 6 people con and 3 people I
couldn't figure
On Nov 5, 2003, at 11:52 AM, Marco Tabini wrote:
But isn't there a big difference between an assignment and a reference?
I, for one, think that language constructs should be as univocal as
possible in order to minimize confusion, lest we end up having to read
something like:
$a =
On Wed, 5 Nov 2003, Christian Schneider wrote:
Andi Gutmans wrote:
I don't believe in saving characters.
Agreed, it's not about saving characters (only).
Anyway, it's no biggy and if most people here think it shouldn't be
added then that's fine with me.
Ok, a quick head count gave 9
Marco Tabini wrote:
$a = [[1,2,3],[1=[1,3,2,2], a=[[1,2,3,4],4,[1,2]]];
$a = array(array(1,2,3),array(1=array(1,3,2,2),
a=array(array(1,2,3,4),4,array(1,2)));
What was your point again? ;-)
- Chris
--
PHP Internals - PHP Runtime Development Mailing List
To unsubscribe, visit:
George Schlossnagle wrote:
On Nov 5, 2003, at 11:52 AM, Marco Tabini wrote:
But isn't there a big difference between an assignment and a reference?
I, for one, think that language constructs should be as univocal as
possible in order to minimize confusion, lest we end up having to read
Christian Schneider wrote:
Marco Tabini wrote:
$a = [[1,2,3],[1=[1,3,2,2], a=[[1,2,3,4],4,[1,2]]];
$a = array(array(1,2,3),array(1=array(1,3,2,2),
a=array(array(1,2,3,4),4,array(1,2)));
Besides my previous points, something even more abominable:
$a = [1,2,$b[11]];
Is that confusing enough
On 05 November 2003 16:48, Ilia Alshanetsky contributed these pearls of
wisdom:
I mean c'mon, is 5 characters that much of a problem and is
absolute code clarity not worth those 5 characters? Character
efficiency is done in Perl, where you can do things like ~=
and @_, but that makes Perl
On 05 November 2003 17:06, Marco Tabini contributed these pearls of wisdom:
Christian Schneider wrote:
Marco Tabini wrote:
$a = [[1,2,3],[1=[1,3,2,2], a=[[1,2,3,4],4,[1,2]]];
$a = array(array(1,2,3),array(1=array(1,3,2,2),
a=array(array(1,2,3,4),4,array(1,2)));
Besides my previous
On 05 November 2003 16:52, Marco Tabini contributed these pearls of wisdom:
$a = [[1,2,3],[1=[1,3,2,2], a=[[1,2,3,4],4,[1,2]]];
I don't know about you, but I can't even begin to count the
brackets in there... :-)
At quick glance says it looks unbalanced. A count shows why: 7 [s and 6 ]s
Ford, Mike [LSS] wrote:
On 05 November 2003 17:06, Marco Tabini contributed these pearls of wisdom:
Christian Schneider wrote:
Marco Tabini wrote:
$a = [[1,2,3],[1=[1,3,2,2], a=[[1,2,3,4],4,[1,2]]];
$a = array(array(1,2,3),array(1=array(1,3,2,2),
a=array(array(1,2,3,4),4,array(1,2)));
On November 5, 2003 12:01 pm, Ford, Mike [LSS] wrote:
I don't think the number of characters is the main issue here -- it's about
having a *nicer* set of characters. Personally, I'd be still be in favour
(although not quite as much) if the proposed syntax were [[[1,2,3]]] -- for
me, it's
isn't always
a good thing.
Add me to the -1 list. Even tho' it's a cool idea.
- Steph
-Original Message-
From: Christian Schneider [mailto:[EMAIL PROTECTED]
Sent: 04 November 2003 23:33
To: [EMAIL PROTECTED]
Subject: [PHP-DEV] Proposal: Array syntax
I propose to add
At 11:58 AM 11/5/2003 -0500, George Schlossnagle wrote:
On Nov 5, 2003, at 11:52 AM, Marco Tabini wrote:
But isn't there a big difference between an assignment and a reference?
I, for one, think that language constructs should be as univocal as
possible in order to minimize confusion, lest we
Think backwards.. Will you be able to convince
any perl/python/javascript developer to use
array(), list(), range() structs?
r
$a = [1,2,$b[11]];
Is that confusing enough for you? ;-)
Mt.
--
PHP Internals - PHP Runtime Development Mailing List
To unsubscribe, visit:
Romans Malinovskis wrote:
Think backwards.. Will you be able to convince
any perl/python/javascript developer to use
array(), list(), range() structs?
I really don't think this needs to be a concern. You can't be everything
to all people.
Mt.
r
$a = [1,2,$b[11]];
Is that confusing enough for
On Wed, 5 Nov 2003, Christian Schneider wrote:
Andi Gutmans wrote:
I don't believe in saving characters.
Agreed, it's not about saving characters (only).
Anyway, it's no biggy and if most people here think it shouldn't be
added then that's fine with me.
Ok, a quick head count
On Nov 5, 2003, at 12:33 PM, Derick Rethans wrote:
On Wed, 5 Nov 2003, Christian Schneider wrote:
Andi Gutmans wrote:
I don't believe in saving characters.
Agreed, it's not about saving characters (only).
Anyway, it's no biggy and if most people here think it shouldn't be
added then that's fine
On Wed, 5 Nov 2003, Christian Schneider wrote:
Andi Gutmans wrote:
I don't believe in saving characters.
Agreed, it's not about saving characters (only).
Anyway, it's no biggy and if most people here think it shouldn't be
added then that's fine with me.
Ok, a quick head count gave
On Wed, 5 Nov 2003, Christian Schneider wrote:
Andi Gutmans wrote:
I don't believe in saving characters.
Agreed, it's not about saving characters (only).
Anyway, it's no biggy and if most people here think it shouldn't be
added then that's fine with me.
Ok, a quick head count
On Wednesday, Nov 5, 2003, at 17:48 Europe/Copenhagen, Andi Gutmans
wrote:
Anyway, it's no biggy and if most people here think it shouldn't be
added then that's fine with me.
I like the new syntax proposal, especially when passing arrays as
function parameters.
+1 here.
Edin
--
PHP
The devs are mostly at the conference now. I think it is easy to discuss.
I won't be surprised if cons after that are more than pros.
I think end-user / newbie votes should be rather considered than dev's since
they are ones who will be learning and getting used to this syntax. So why
don't
At 2003-11-05 09:59 +0100, Michael Walter wrote:
Very cool.
How about supporting .. syntax, btw. as in [1..3] or [a..z]? Might no be the
worth, just thinking out loud ;)
I'm also in favor of a shorter notation for array() and list().
In fact this also helps to ease the problem I have
with
Alle 18:48, mercoledì 5 novembre 2003, Romans Malinovskis ha scritto:
The devs are mostly at the conference now. I think it is easy to
discuss. I won't be surprised if cons after that are more than
pros.
I think end-user / newbie votes should be rather considered than
dev's since they are
Jaap van Ganswijk wrote:
At 2003-11-05 09:59 +0100, Michael Walter wrote:
Very cool.
How about supporting .. syntax, btw. as in [1..3] or [a..z]? Might no be the worth, just thinking out loud ;)
I'm also in favor of a shorter notation for array() and list().
In fact this also helps to
Michael Walter wrote:
$a = [1,2,$b[11]];
Is that confusing enough for you? ;-)
What's confusing about it?
The fact that $b[11] references an item of an array, while
[1,2,$b[11]] assigns values to the array $a. The fact that you (and,
probably, most of us) can't tell right off the bat is a
I like some of the Python syntax. But some of it is cumbersome. Same
with PHP. But I think PHP is closer to what I want so what's wrong with
trying to improve it where it's possible (and easily done)?
agree, and you can easily make PHP code not readable with such improvements.
again, I can't
I guess we'll have to agree to disagree
$a = [1,2,$b[11]] is semantically inconsistent.
Yeah, I agree to disagree on that one, too :)
Actually, do you realize that you use () both for grouping and for
application? I can't see anything wrong with using square brackets for
array element access
On Nov 5, 2003, at 12:54 PM, Jani Taskinen wrote:
On Wed, 5 Nov 2003, Andi Gutmans wrote:
At 11:58 AM 11/5/2003 -0500, George Schlossnagle wrote:
is that any less clear than
$a = array(array(1,2,3), array(1 = array(1,3,2,2), array(a =
array(array(1,2,3,4), 4, array(1,2)));
Both examples can be
On Wed, 05 Nov 2003, Ford, Mike [LSS] wrote:
On 05 November 2003 16:48, Ilia Alshanetsky contributed these pearls of
wisdom:
I mean c'mon, is 5 characters that much of a problem and is
absolute code clarity not worth those 5 characters? Character
efficiency is done in Perl,
On Nov 5, 2003, at 1:29 PM, Marco Tabini wrote:
$a = [1,2,$b[11]] is semantically inconsistent.
How so? Is
foo(array(1,2));
semantically inconsistent? On one hand () is used with a language
construct (array()), whereas in the other context it indicates
arguments to a function. I think that
George Schlossnagle wrote:
On Nov 5, 2003, at 1:29 PM, Marco Tabini wrote:
$a = [1,2,$b[11]] is semantically inconsistent.
How so? Is
I think I've already explained why.
foo(array(1,2));
semantically inconsistent? On one hand () is used with a language
construct (array()), whereas in the
+1 for the [] syntax. I also feel it's much more intuitive. Calling
(what looks like) a function to make an array seems plain silly to me.
Shane
--
PHP Internals - PHP Runtime Development Mailing List
To unsubscribe, visit: http://www.php.net/unsub.php
Marco Tabini wrote:
George Schlossnagle wrote:
On Nov 5, 2003, at 1:29 PM, Marco Tabini wrote:
$a = [1,2,$b[11]] is semantically inconsistent.
How so? Is
I think I've already explained why.
Not really understandable, though.
foo(array(1,2));
semantically inconsistent? On one hand () is
On Wed, 2003-11-05 at 14:03, David Enderson wrote:
I believe the ultimate goal of PHP is to have a quick and dirty
language that is easy to read, use, and learn. While Rasmus's comment
I complete disagree with the quick and dirty statement. Maybe at one
time, but I think a lot of effort has
-Original Message-
From: Robert Cummings [mailto:[EMAIL PROTECTED]
Sent: Wednesday, November 05, 2003 3:09 PM
To: David Enderson
Cc: [EMAIL PROTECTED]
Subject: RE: [PHP-DEV] Proposal: Array syntax
On Wed, 2003-11-05 at 14:03, David Enderson wrote:
I believe the ultimate goal
FWIW- (And I understand I'm late chiming in on this thread)
I'm -1 on this syntax.
It's Perlish and ugly. It is *not* PHP syntax.
-Sara
--
PHP Internals - PHP Runtime Development Mailing List
To unsubscribe, visit: http://www.php.net/unsub.php
On Nov 5, 2003, at 5:41 PM, Sara Golemon wrote:
FWIW- (And I understand I'm late chiming in on this thread)
I'm -1 on this syntax.
It's Perlish and ugly. It is *not* PHP syntax.
To continue to play devils advocate, I actually find it C-ish and nice:
char foo[] = { a, b, c i told you so};
Anyway, it's no biggy and if most people here think it shouldn't be added
then that's fine with me.
Thies reminded me of something that should be considered here; we talked
about
and alternative array syntax for overloaded objects where all the array
indices are
required in one chunk to be able
George Schlossnagle wrote:
George (thinking [] is pretty but disliking alternative syntaxes)
Ok, let me recap my short visit on this mailing list:
1) Dangling commas in function calls were considered bloat
2) Adding the local vars to debug_backtrace() was silently ignored
3) A prettier array
After all this I guess I have to maintain my own PHP branch and hope for
PHP6 to address some of my issues. Or switch to another language at some
point, because a language to me is a tool, not a religion.
This is exactly the point. Why waste so much energy on deciding how to
spell out your
Ard Biesheuvel wrote:
spell out your array definitions. The decision has been made a long time
ago to use the array() syntax. Adding alternatives adds nothing but the
I was under the impression that syntax changes are possible. Silly me.
Try/catch however are a fundamental extension to the
I propose to add an alternative (backward compatible) short array
creation syntax:
$a = [ 1, 2, 3 ]; and $a = [ 'a' = 42, 'b' = foo ];
It can also be used in function calls:
img(['src' = logo.gif, 'alt' = Logo]);
Reason behind this change: Arrays are used a lot and should therefore
have as
Christian Schneider wrote:
Note: I checked the newsgroup archive but couldn't find a discussion
about this. After not hearing back about my proposed enhancement to
debug_backtrace() and the dangling comma for function call parameters
being rejected I wonder if I'm using the right mailing list
More magic. The difference between these two lines:
$a = array(1,2,3);
$a = [ 1,2,3 ];
is that with the first you can go and look up the array keyword and see
what it does, whereas on the second line you have no idea. You can't look
up a [
You are right that arrays are common and that this
83 matches
Mail list logo