Vision for the D language - stabilizing complexity?

Andrew Godfrey via Digitalmars-d digitalmars-d at puremagic.com
Fri Jul 8 21:39:31 PDT 2016


On Friday, 8 July 2016 at 21:23:24 UTC, Timon Gehr wrote:
> On 08.07.2016 04:25, Andrew Godfrey wrote:
>>
>> Another example is "return" used for monads in eg Haskell - 
>> even if it
>> only has one meaning in Haskell, it is too mixed up with a 
>> different
>> meaning in other common languages. D's "static if" - which is 
>> a killer
>> feature if I ignore the keyword - gives me a similar feeling 
>> (though
>> it's much less egregious than "return" in monads).
>
> 'return' in Haskell is perfectly fine.

This (long) talk does a good job of explaining the problem with 
using the name 'return' in monads.

https://www.infoq.com/presentations/functional-pros-cons#downloadPdf

Others have said it shorter. I took this example because it 
crosses languages. Of course we can't avoid clashing with other 
languages, there are only so many keywords to use. But there's 
definitely a principle here worth considering, that is if you 
care about D adoption.

C# vs C++ have an example of a keyword clash too ("volatile" I 
think?)



More information about the Digitalmars-d mailing list