While we're lynching features, how bout' them omittable parens?

2009-05-18 Thread Chad J
Nevermind properties. Any chance we can forbid the omittable parentheses, at least in the lhs of an assignment expression? In the more general case, any value type that gets modified but never read or copied elsewhere is probably either dead code, a bug, or a benchmark. The latter is easy to fix

Re: While we're lynching features, how bout' them omittable parens?

2009-05-18 Thread Lionello Lunesu
"Chad J" wrote in message news:gut0f2$jc...@digitalmars.com... Nevermind properties. Any chance we can forbid the omittable parentheses, at least in the lhs of an assignment expression? In the more general case, any value type that gets modified but never read or copied elsewhere is probably

Re: While we're lynching features, how bout' them omittable parens?

2009-05-18 Thread Chad J
Lionello Lunesu wrote: > > "Chad J" wrote in message > news:gut0f2$jc...@digitalmars.com... >> Nevermind properties. Any chance we can forbid the omittable >> parentheses, at least in the lhs of an assignment expression? >> >> In the more general case, any value type that gets modified but never

Re: While we're lynching features, how bout' them omittable parens?

2009-05-18 Thread dsimcha
== Quote from Chad J (chadj...@__spam.is.bad__gmail.com)'s article > Lionello Lunesu wrote: > > > > "Chad J" wrote in message > > news:gut0f2$jc...@digitalmars.com... > >> Nevermind properties. Any chance we can forbid the omittable > >> parentheses, at least in the lhs of an assignment expressio

Re: While we're lynching features, how bout' them omittable parens?

2009-05-18 Thread Nick Sabalausky
"Chad J" wrote in message news:gut1od$l5...@digitalmars.com... > Lionello Lunesu wrote: >> >> "Chad J" wrote in message >> news:gut0f2$jc...@digitalmars.com... >>> Nevermind properties. Any chance we can forbid the omittable >>> parentheses, at least in the lhs of an assignment expression? >>>

Re: While we're lynching features, how bout' them omittable parens?

2009-05-18 Thread BCS
Hello dsimcha, == Quote from Chad J (chadj...@__spam.is.bad__gmail.com)'s article Lionello Lunesu wrote: "Chad J" wrote in message news:gut0f2$jc...@digitalmars.com... Nevermind properties. Any chance we can forbid the omittable parentheses, at least in the lhs of an assignment expressio

Re: While we're lynching features, how bout' them omittable parens?

2009-05-18 Thread Chad J
dsimcha wrote: > > Yeah, file a Bugzilla. Shouldn't ++, +=, etc. only work on lvalues? *shrug* http://d.puremagic.com/issues/show_bug.cgi?id=3008

Re: While we're lynching features, how bout' them omittable parens?

2009-05-18 Thread Andrei Alexandrescu
Chad J wrote: dsimcha wrote: Yeah, file a Bugzilla. Shouldn't ++, +=, etc. only work on lvalues? *shrug* http://d.puremagic.com/issues/show_bug.cgi?id=3008 Voted up! Andrei

Re: While we're lynching features, how bout' them omittable parens?

2009-05-18 Thread Jesse Phillips
On Mon, 18 May 2009 21:53:06 -0400, Nick Sabalausky wrote: > "Chad J" wrote in message > news:gut1od$l5...@digitalmars.com... >> Lionello Lunesu wrote: >>> >>> "Chad J" wrote in message >>> news:gut0f2$jc...@digitalmars.com... Nevermind properties. Any chance we can forbid the omittable >>

Re: While we're lynching features, how bout' them omittable parens?

2009-05-18 Thread Ary Borenszweig
Jesse Phillips escribió: On Mon, 18 May 2009 21:53:06 -0400, Nick Sabalausky wrote: "Chad J" wrote in message news:gut1od$l5...@digitalmars.com... Lionello Lunesu wrote: "Chad J" wrote in message news:gut0f2$jc...@digitalmars.com... Nevermind properties. Any chance we can forbid the omitt

Re: While we're lynching features, how bout' them omittable parens?

2009-05-19 Thread Nick Sabalausky
"Jesse Phillips" wrote in message news:gutbro$14e...@digitalmars.com... > On Mon, 18 May 2009 21:53:06 -0400, Nick Sabalausky wrote: >> >> I still want to get rid of omittable parens (and function-call-as-a-lhs) >> anyway. They're a horrible substitute for a real property syntax. > > I don't like

Re: While we're lynching features, how bout' them omittable parens?

2009-05-19 Thread Rainer Deyke
Nick Sabalausky wrote: > D leaves the function/property distinction up to the caller, which is > rediculous because in most cases only one or the other actually makes sense. I totally agree with this. > C# places the responsilibily for that function-syntax/property-syntax choice > on the calle

Re: While we're lynching features, how bout' them omittable parens?

2009-05-19 Thread Denis Koroskin
On Tue, 19 May 2009 05:53:06 +0400, Nick Sabalausky wrote: > "Chad J" wrote in message > news:gut1od$l5...@digitalmars.com... >> Lionello Lunesu wrote: >>> >>> "Chad J" wrote in message >>> news:gut0f2$jc...@digitalmars.com... Nevermind properties. Any chance we can forbid the omittable >

Re: While we're lynching features, how bout' them omittable parens?

2009-05-19 Thread Steven Schveighoffer
On Tue, 19 May 2009 00:29:17 -0400, Ary Borenszweig wrote: Jesse Phillips escribió: On Mon, 18 May 2009 21:53:06 -0400, Nick Sabalausky wrote: "Chad J" wrote in message news:gut1od$l5...@digitalmars.com... Lionello Lunesu wrote: "Chad J" wrote in message news:gut0f2$jc...@digitalmars.c

Re: While we're lynching features, how bout' them omittable parens?

2009-05-19 Thread Bill Baxter
On Tue, May 19, 2009 at 1:15 AM, Nick Sabalausky wrote: > "Jesse Phillips" wrote in message > news:gutbro$14e...@digitalmars.com... >> On Mon, 18 May 2009 21:53:06 -0400, Nick Sabalausky wrote: >>> >>> I still want to get rid of omittable parens (and function-call-as-a-lhs) >>> anyway. They're a

Re: While we're lynching features, how bout' them omittable parens?

2009-05-19 Thread Leandro Lucarella
Steven Schveighoffer, el 19 de mayo a las 09:54 me escribiste: > >So for me, properties are way more than just syntax sugar. > > AFAIK, this is not enforced by the compiler... > > I write C# properties that have side effects. Well, in D2 it would make sense to make mandatory that properties are

Re: While we're lynching features, how bout' them omittable parens?

2009-05-19 Thread Daniel Keep
Leandro Lucarella wrote: > Steven Schveighoffer, el 19 de mayo a las 09:54 me escribiste: >>> So for me, properties are way more than just syntax sugar. >> AFAIK, this is not enforced by the compiler... >> >> I write C# properties that have side effects. > > Well, in D2 it would make sense to mak

Re: While we're lynching features, how bout' them omittable parens?

2009-05-19 Thread Jesse Phillips
On Tue, 19 May 2009 11:12:13 -0300, Leandro Lucarella wrote: > > class C > { > int no_prop() { return 1; } > property int prop() { return 2; } > } > > C c = new C; > int x = c.no_prop; // error > x = x.prop; // ok > > "property" should imply "pure". I actually wouldn't have an issu

Re: While we're lynching features, how bout' them omittable parens?

2009-05-19 Thread Jarrett Billingsley
On Tue, May 19, 2009 at 10:12 AM, Leandro Lucarella wrote: > Steven Schveighoffer, el 19 de mayo a las 09:54 me escribiste: >> >So for me, properties are way more than just syntax sugar. >> >> AFAIK, this is not enforced by the compiler... >> >> I write C# properties that have side effects. > > We

Re: While we're lynching features, how bout' them omittable parens?

2009-05-19 Thread Steven Schveighoffer
On Tue, 19 May 2009 10:12:13 -0400, Leandro Lucarella wrote: Steven Schveighoffer, el 19 de mayo a las 09:54 me escribiste: >So for me, properties are way more than just syntax sugar. AFAIK, this is not enforced by the compiler... I write C# properties that have side effects. Well, in D2

Re: While we're lynching features, how bout' them omittable parens?

2009-05-19 Thread Ary Borenszweig
Steven Schveighoffer wrote: On Tue, 19 May 2009 00:29:17 -0400, Ary Borenszweig wrote: Jesse Phillips escribió: On Mon, 18 May 2009 21:53:06 -0400, Nick Sabalausky wrote: "Chad J" wrote in message news:gut1od$l5...@digitalmars.com... Lionello Lunesu wrote: "Chad J" wrote in message new

Re: While we're lynching features, how bout' them omittable parens?

2009-05-19 Thread Ary Borenszweig
Leandro Lucarella wrote: Steven Schveighoffer, el 19 de mayo a las 09:54 me escribiste: So for me, properties are way more than just syntax sugar. AFAIK, this is not enforced by the compiler... I write C# properties that have side effects. Well, in D2 it would make sense to make mandatory th

Re: While we're lynching features, how bout' them omittable parens?

2009-05-19 Thread Leandro Lucarella
Jarrett Billingsley, el 19 de mayo a las 11:31 me escribiste: > On Tue, May 19, 2009 at 10:12 AM, Leandro Lucarella wrote: > > Steven Schveighoffer, el 19 de mayo a las 09:54 me escribiste: > >> >So for me, properties are way more than just syntax sugar. > >> > >> AFAIK, this is not enforced by th

Re: While we're lynching features, how bout' them omittable parens?

2009-05-19 Thread grauzone
How the hell do you write a pure setter? Ok, "almost pure" =P You should be able to modify "this", of course. Properties could be automatically marked as const. Then a setter would not be allowed to change anything, except members explicitly marked with a "mutable" attribute. Oh wait, tha

Re: While we're lynching features, how bout' them omittable parens?

2009-05-19 Thread Steven Schveighoffer
On Tue, 19 May 2009 13:32:35 -0400, Ary Borenszweig wrote: Steven Schveighoffer wrote: On Tue, 19 May 2009 00:29:17 -0400, Ary Borenszweig wrote: Jesse Phillips escribió: On Mon, 18 May 2009 21:53:06 -0400, Nick Sabalausky wrote: "Chad J" wrote in message news:gut1od$l5...@digitalma

Re: While we're lynching features, how bout' them omittable parens?

2009-05-19 Thread Robert Fraser
Chad J wrote: Nevermind properties. Any chance we can forbid the omittable parentheses, at least in the lhs of an assignment expression? In the more general case, any value type that gets modified but never read or copied elsewhere is probably either dead code, a bug, or a benchmark. The latte

Re: While we're lynching features, how bout' them omittable parens?

2009-05-19 Thread BCS
Reply to Ary, Steven Schveighoffer wrote: On Tue, 19 May 2009 00:29:17 -0400, Ary Borenszweig wrote: Jesse Phillips escribió: On Mon, 18 May 2009 21:53:06 -0400, Nick Sabalausky wrote: "Chad J" wrote in message news:gut1od$l5...@digitalmars.com... Lionello Lunesu wrote: "Chad J" w

Re: While we're lynching features, how bout' them omittable parens?

2009-05-19 Thread Jérôme M. Berger
Robert Fraser wrote: Chad J wrote: Nevermind properties. Any chance we can forbid the omittable parentheses, at least in the lhs of an assignment expression? In the more general case, any value type that gets modified but never read or copied elsewhere is probably either dead code, a bug, or a

Re: While we're lynching features, how bout' them omittable parens?

2009-05-19 Thread Ary Borenszweig
Jérôme M. Berger escribió: Robert Fraser wrote: Chad J wrote: Nevermind properties. Any chance we can forbid the omittable parentheses, at least in the lhs of an assignment expression? In the more general case, any value type that gets modified but never read or copied elsewhere is probably e

Re: While we're lynching features, how bout' them omittable parens?

2009-05-19 Thread Christopher Wright
Ary Borenszweig wrote: That's what I said it's a contract on the semantic of properties. :) But now I'm curious: what kind of properties do you write? A getter that does calculations and caches the results (rarely). A proxied getter that does lazy loading from a database table (like NHiberna