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

Bill Baxter wbaxter at gmail.com
Tue May 19 06:57:44 PDT 2009


On Tue, May 19, 2009 at 1:15 AM, Nick Sabalausky <a at a.a> wrote:
> "Jesse Phillips" <jessekphillips at gmail.com> wrote in message
> news:gutbro$14ev$1 at 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 C# properties, IMO it is pointless overhead. I agree you can
>> misuse the omittable parentheses, but what is a "real" property syntax?
>> Seems to me both D and C# provide the same syntax they are just set up
>> differently.
>
> 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.
> C# places the responsilibily for that function-syntax/property-syntax choice
> on the callee instead, where it belongs.
>
> D's approach is like saying "You can index an array with 'myArray[5]' *or*
> 'myArray+5', and you can add two numbers with 'myInt+5' *or* 'myInt[5]'.

or 5[myArray] even!  (In C/C++ anyway).

--bb



More information about the Digitalmars-d mailing list