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() {
>>
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
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
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
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
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 =