Is alias equality inconsistent?

Timon Gehr timon.gehr at gmx.ch
Fri May 13 16:57:20 PDT 2011


> On 5/13/11 5:00 PM, Timon Gehr wrote:
>> Fixed-size arrays are somewhat special, there 'is' actually compares ptr and
>> length. I think that is very practical and makes sense because it allows
>> meaningful 'is' between fixed- and dynamic-size arrays. I guess for value types it
>> is there for completeness and maybe to enable easier generic programming. We do
>> not lose anything by having it.
>
> I think 'is' for static arrays could go either way. If they're to be
> seen as an equivalent of structs, is should yield true. If they're to be
> seen as a close relative of dynamic arrays, is should yield false.
>
> Probably it would be best to disable it :o).
>
>
> Andrei

I think determining the return value should rely on other things than the ref-ness
of the arguments. Maybe you want to clarify.

When you are disabling stuff, also disable templates and all builtin types. Using
the mixin/asm statements they can be implemented entirely in library code.

I will then start patching my compiler. I am serious about that one. =)

When did it stop being useful? I thought D should be a practical language that
gets you stuff done, not a religion.

Now it seems to me that you want to disable 'is' for static arrays just because
there would be another (less useful) way to define it?

Or is the ':o)' an indication that you were just joking? It would be a relief.

Timon


More information about the Digitalmars-d mailing list