Constant relationships between non-constant objects

w0rp via Digitalmars-d digitalmars-d at puremagic.com
Wed Jun 18 12:56:44 PDT 2014


On Wednesday, 18 June 2014 at 05:40:48 UTC, Sebastian Unger wrote:
> On Wednesday, 18 June 2014 at 04:38:25 UTC, Meta wrote:
>> On Wednesday, 18 June 2014 at 01:31:33 UTC, Sebastian Unger 
>> wrote:
>> There's no head const in D, but you can emulate it. This is a 
>> *very* basic example that you can expand upon.
>>
>> http://dpaste.dzfl.pl/55cb22153fcc
>
> Thanks for that link. Yes, that is close. I'd even feel 
> reasonaly well about it if it was in phobos so everybody can 
> use the mechanism consistently.
>
> It does not however, quite meet the mark of "with ease". But it 
> is possibly an acceptable hack around a shortcoming in the 
> language. Comming from C++, it's not as though I'm not used to 
> those. Just a shame to have to resort to it when D is so pretty 
> close to getting rid of dirty hacks more or less completely.
>
> Cheers,
> Seb

I wish people would not call library solutions to problems "dirty 
hacks." I often think the opposite. Changes in syntax can be 
hacks because a language doesn't allow you to define the 
semantics yourself.


More information about the Digitalmars-d mailing list