Simple and effective approaches to constraint error messages
Meta via Digitalmars-d
digitalmars-d at puremagic.com
Tue Apr 26 09:07:48 PDT 2016
On Tuesday, 26 April 2016 at 15:56:55 UTC, Andrei Alexandrescu
wrote:
> On 04/26/2016 11:35 AM, Meta wrote:
>> The nice part about 1 is that every constraint gets it for
>> free.
>
> Only if in CNF, otherwise needs changed. -- Andrei
True, but I bet the majority of template constraints are in this
form. The wiki page you linked also says that clauses that are
not in CNF can be rewritten in CNF, but doing that automatically
in the compiler would probably be difficult, bug-ridden, and
annoying for end users.
Are you familiar with Nim's implementation of concepts? I think
somebody actually implemented something close to this in D using
inheritance and introspection.
http://nim-lang.org/docs/manual.html#generics-concepts
More information about the Digitalmars-d
mailing list