Clay language

Stanislav Blinov stanislav.blinov at gmail.com
Tue Dec 28 04:51:53 PST 2010


On 12/28/2010 03:26 PM, bearophile wrote:
> Stanislav Blinov:
>
>> ...which quickly expands to a lot of *long* import lines, with "don't
>> forget to add another" constantly pushing the door-bell.
>
> That's redundancy is "making your subsystems interfaces explicit". I see that you and other people here fail to understand this, or just value a bit of typing more than a tidy way of coding. To interested people I suggest to read papers about this part of the Ada design (and generally about module system design).
>

What I do fail to understand is what should these explicit interfaces 
bring *into D*. Until now, you didn't demonstrate anything they would 
give that D doesn't already have.

BTW, I forgot to mention one more point: explicit qualification has 
significant impact on generic code:

void foo(T)(T t) if (__traits(compiles, bar(t))
{
	bar(t);
}

How would that be scalable to new types if bar would have to be 
explicitly qualified?

void foo(T)(T t) if (__traits(compiles, pkg.modbar.bar(t))
{
	pkg.modbar.bar(t);
}

Now, to extend the range of types accepted by foo(), you *have to* 
change pkg.modbar module to introduce bar() for new types, which isn't 
always possible or desirable.


More information about the Digitalmars-d mailing list