Reddit: why aren't people using D?

Bill Baxter wbaxter at gmail.com
Thu Jul 23 14:35:06 PDT 2009


On Thu, Jul 23, 2009 at 2:25 PM, Steven
Schveighoffer<schveiguy at yahoo.com> wrote:
> On Thu, 23 Jul 2009 17:13:13 -0400, Bill Baxter <wbaxter at gmail.com> wrote:
>
>> In any event I think a problem with this is that for D's simple
>> grammar to remain simple and context free, get and set would both have
>> to be made keywords in the language.  Can a compiler guru confirm
>> that?  Not a big issue, but introducing 3 keywords for this one
>> feature will be a tough sell.   Perhaps just
>>
>> property int length {
>>    () { return this.len; }
>>    (newLen) { this.len = newLen; }
>> }
>>
>> would be enough.  Maybe I'm wrong about get/set being an issue, though.
>
> I think you might be wrong.  operator functions like opAdd are not keywords,
> but are treated specially by the compiler.  The compiler would probably just
> change the get and set functions into mangled symbols that would never be
> generated from a normal function, so no keywords would be required.

That makes sense.

Maybe Walter would like to take this opportunity to plug his upcoming
compiler building seminar for us compiler ignoramuses.  :-)

--bb



More information about the Digitalmars-d mailing list