spir:
> Andrej Mitrovic:
>
> > constraint
> > {
> > isDynamicArray(a);
> > isIterable(a);
> > }
> > body
> > {
> > ...
> > }
> I like very much the idea of constraint blocks. Much better than expanding
> func header line, reuses an existing syntactic construct, and far cleaner.
But I'd like that syntax to allow for an error message for each constraint. So
it becomes like contract programming, done at compile-time on types and
compile-time constants, and the "in" keyword is enough:
in {
static assert(isDynamicArray!T, "err msg 1");
static assert(isIterable!T, "err msg 2");
...
} body {
...
}
Bye,
bearophile