Consistency
Andrei Alexandrescu via Digitalmars-d
digitalmars-d at puremagic.com
Mon Feb 16 12:50:11 PST 2015
On 2/16/15 5:10 AM, Daniel Murphy wrote:
> "Marc Schütz" " wrote in message
> news:iftpzvhoyxxqhbfsxull at forum.dlang.org...
>
>> To be really consistent,
>> x in arr
>> would need to be equivalent to:
>> (x >= 0) && (x < arr.length)
>>
>> `in` tests for the presence of a _key_ in AAs, and the equivalent
>> notion of a key for arrays is an index.
>
> It's called 'in', not 'haskey'. Is 3 in the array? Is 7 in the map?
> Everybody understands what it means and the whole argument is nonsense.
Yah, I agree. FWIW many times "consistency" is used, well,
inconsistently. In a consistency argument the choice of benchmark (=
what's the standard that new stuff must be consistent with?) is crucial.
Oftentimes in entities as complex as programming languages, it's easy to
make consistency arguments for numerous artifacts depending on the
choice of benchmark. This is painfully evident in C++ -
consistency-based arguments got diluted quite a bit since it became
obvious they're so easy to make in favor of anything.
> Next somebody will be arguing that float/float and int/int aren't the
> same operation and should have different syntax.
I guess you just got taken downtown over that :o).
Andrei
More information about the Digitalmars-d
mailing list