You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Alas, I cannot, because parametric->/c does not support ... or
any other mechanism for binding arbitrarily many type parameters.
It seems that I have to ignore the domain completely, as shown below.
It seems to me that this pseudo-contract has two problems:
The ellipsis ... actually identifies
the number of arguments the procedure accepts, and
the number of elements in the list;
(list/c src ...) cannot make sense (remember that list/c is nothing more than a procedure).
Put these together, it doesn’t seem possible to make sense of what the ellipsis ... means. What exactly is the pseudo-contract trying to express, anyway? That if we have a list with n elements, then we should wrap those elements in opaque structs (negative position), and unwrap them when they are supplied to the procedure (positive position), as well as checking that the procedure accepts n arguments? If arity checking is all you need, then I think doing that alone is fine, otherwise you’re checking in extra that apply is, well, applying.
The short answer is that contracts are not types, that’s it.
I would like to endow
apply
and other such procedureswith more precise contracts, as seen below.
Alas, I cannot, because
parametric->/c
does not support...
orany other mechanism for binding arbitrarily many type parameters.
It seems that I have to ignore the domain completely, as shown below.
Is this the best I can do right now?
Could support for ellipses be added in the future?
The text was updated successfully, but these errors were encountered: