Re: Properties: problems

2009-07-31 Thread Chad J
John C wrote: > Chad J wrote: >> John C wrote: >>> Here's a couple of annoying problems I encounter quite often with D's >>> properties. Would having some form of property syntax fix them? >>> >>> 1) Array extensions: >>> >>> class Person { >>> >>> string name_; >>> >>> string name() { >>

Re: Properties: problems

2009-07-30 Thread Benji Smith
John C wrote: Chad J wrote: John C wrote: Here's a couple of annoying problems I encounter quite often with D's properties. Would having some form of property syntax fix them? 1) Array extensions: class Person { string name_; string name() { return name_; } } auto

Re: Properties: problems

2009-07-30 Thread John C
Chad J wrote: John C wrote: 2) Indexing: struct Map(K, V) { void opIndexAssign(V value, K key) { ... } V opIndex(K key) { ... } } class WebClient { private Map!(string, string) headers_; Map!(string, string) headers() { return headers_; } } auto clien

Re: Properties: problems

2009-07-30 Thread John C
Chad J wrote: John C wrote: Here's a couple of annoying problems I encounter quite often with D's properties. Would having some form of property syntax fix them? 1) Array extensions: class Person { string name_; string name() { return name_; } } auto person = getPer

Re: Properties: problems

2009-07-29 Thread Chad J
John C wrote: > Here's a couple of annoying problems I encounter quite often with D's > properties. Would having some form of property syntax fix them? > > 1) Array extensions: > > class Person { > > string name_; > > string name() { > return name_; > } > > } > > auto

Properties: problems

2009-07-29 Thread John C
Here's a couple of annoying problems I encounter quite often with D's properties. Would having some form of property syntax fix them? 1) Array extensions: class Person { string name_; string name() { return name_; } } auto person = getPerson(); auto firstAndLast =