Re: [PHP-DEV] Proposal: shorthand object property setting syntax.

2010-04-21 Thread Toorion
Sorry for long delay... On 03/29/2010 09:19 AM, Victor Bolshov wrote: Toorion, I suggest *not* your code becomes unreadable because of PHP limitations but because of you application architecture limitations. I see from your example that you're building a Ext.JS datagrid. And, what is done in th

Re: [PHP-DEV] Proposal: shorthand object property setting syntax.

2010-03-28 Thread Victor Bolshov
Toorion, I suggest *not* your code becomes unreadable because of PHP limitations but because of you application architecture limitations. I see from your example that you're building a Ext.JS datagrid. And, what is done in the example, is writing in PHP what should be written in JavaScript. ExtJS

Re: [PHP-DEV] Proposal: shorthand object property setting syntax.

2010-03-28 Thread Stan Vassilev
Hi, There is another solution to this problem, which is sort-of-on-the-table, and it's named parameters: $myLongNameObject = new MyLongNameObject( 'property1' => '1', 'property2' => '2', 'property3' => '3', 'property4' => '4', 'property5' => '5', ); With prop

Re: [PHP-DEV] Proposal: shorthand object property setting syntax.

2010-03-27 Thread Davey Shafik
On Mar 27, 2010, at 3:59 PM, Bharat Nagwani wrote: > I might have missed earlier emails. How about this? > > $myLongNameObject = new myLongNameObject { >property1: '1', >property2: '2', >property3: '3', >property4: '4', >property5: '5', > }; > > Can we av

RE: [PHP-DEV] Proposal: shorthand object property setting syntax.

2010-03-27 Thread Bharat Nagwani
I might have missed earlier emails. How about this? $myLongNameObject = new myLongNameObject { property1: '1', property2: '2', property3: '3', property4: '4', property5: '5', }; Can we avoid the new as well like in Javascript? $myLongNameObject = { pro

Re: [PHP-DEV] Proposal: shorthand object property setting syntax.

2010-03-27 Thread Stan Vassilev
Hi, There is another solution to this problem, which is sort-of-on-the-table, and it's named parameters: $myLongNameObject = new MyLongNameObject( 'property1' => '1', 'property2' => '2', 'property3' => '3', 'property4' => '4', 'property5' => '5', ); With pr

Re: [PHP-DEV] Proposal: shorthand object property setting syntax.

2010-03-27 Thread Toorion
On 03/27/2010 08:09 PM, Johannes Schlüter wrote: You can always use a (temporary) alias to shorten things $myLongNameObject = new MyLongNameObject(); $t = $myLongNameObject; $t->property1 = '1'; $t->property2 = '2'; $t->property3 = '3'; $t->property4 = '4'; $t->property5 = '5

Re: [PHP-DEV] Proposal: shorthand object property setting syntax.

2010-03-27 Thread Toorion
On 03/27/2010 07:23 PM, Martin Jansen wrote: On 27.03.10 17:02, Toorion wrote: $myLongNameObject = new MyLongNameObject(); $myLongNameObject->property1 = '1'; $myLongNameObject->property2 = '2'; $myLongNameObject->property3 = '3'; $myLongNameObject->property4 = '4'; $myLongNameOb

Re: [PHP-DEV] Proposal: shorthand object property setting syntax.

2010-03-27 Thread Pierre Joye
2010/3/27 Johannes Schlüter : > Syntax-wise it /could/  work like this: > > with ($MyLongNameObject) { >    ->property1 = ''; >    ->property2 = ''; > } > > but there's no big benefit over an alias but way more confusion with a > new syntax, a new keyword, ... This syntax is well known i

Re: [PHP-DEV] Proposal: shorthand object property setting syntax.

2010-03-27 Thread Johannes Schlüter
On Sat, 2010-03-27 at 19:02 +0300, Toorion wrote: > Very often (for example when work with dom or UI object) setting plenty > of object properties is require. At this time we has not a lot options. > Standard way looks very dirty and be reason of more copy-paste-work. > > Reproduce code: > --

Re: [PHP-DEV] Proposal: shorthand object property setting syntax.

2010-03-27 Thread Stefan Marr
>> However, the proposal reminds me of Pascal's 'with'-construct: >> >> new(pointertob); >> >> with pointertob^ do >> begin >> a := 10; >> b := 'A'; >> c := nil >> end; > > Can one do something like "b := this.a"? This sounds like a huge can of > worms to me. Ehm, I don't see what might be p

Re: [PHP-DEV] Proposal: shorthand object property setting syntax.

2010-03-27 Thread Martin Jansen
On 27.03.10 17:29, Stefan Marr wrote: > > On 27 Mar 2010, at 17:23, Martin Jansen wrote: > >> On 27.03.10 17:02, Toorion wrote: >>> $myLongNameObject = new MyLongNameObject(); >>> $myLongNameObject->property1 = '1'; >>> $myLongNameObject->property2 = '2'; >>> $myLongNameObject->property3

Re: [PHP-DEV] Proposal: shorthand object property setting syntax.

2010-03-27 Thread Stefan Marr
On 27 Mar 2010, at 17:23, Martin Jansen wrote: > On 27.03.10 17:02, Toorion wrote: >> $myLongNameObject = new MyLongNameObject(); >> $myLongNameObject->property1 = '1'; >> $myLongNameObject->property2 = '2'; >> $myLongNameObject->property3 = '3'; >> $myLongNameObject->property4 = '444

Re: [PHP-DEV] Proposal: shorthand object property setting syntax.

2010-03-27 Thread Martin Jansen
On 27.03.10 17:02, Toorion wrote: > $myLongNameObject = new MyLongNameObject(); > $myLongNameObject->property1 = '1'; > $myLongNameObject->property2 = '2'; > $myLongNameObject->property3 = '3'; > $myLongNameObject->property4 = '4'; > $myLongNameObject->property5 = '5'; [...] >