handful and interval

David Nadlinger see at klickverbot.at
Mon Sep 3 16:07:28 PDT 2012


On Monday, 3 September 2012 at 22:37:30 UTC, Andrei Alexandrescu 
wrote:
> "among" is a simple function, not a special case.

I was more thinking of the »in … handful« proposal here, 
which would entail creating a new type (presumably just with a 
single method, opIn_r) just to get a somewhat spiffy syntax for a 
single use case, even if other more conventional designs (like 
among) work just as well. In this case, I think it is 
questionable if the "more interesting" syntax justifies the 
additional cognitive overhead induced by adding such single-use 
types over just using familiar concepts.

As for among, I'm not really opposed to it, even though I'm still 
not quite sure whether template arguments vs. runtime arguments 
are the right design – but maybe I'm just overestimating the 
optimization potential gained by being able to access the 
parameters at compile time (if they are actually evaluatable at 
compile time, that is).

David


More information about the Digitalmars-d mailing list