Wishlist: a way to define function types as contracts (researchy)

Bug #1750456 reported by Paul F. Dietz
6
This bug affects 1 person
Affects Status Importance Assigned to Milestone
SBCL
Incomplete
Undecided
Unassigned

Bug Description

The standard CL FTYPE declaration is a description of usage: in all calls to the function, the arguments will have these types and the return value(s) this type.

It would be interesting to instead have a contract-like declaration for types of functions: rules of the form IF the arguments have these types, THEN the value returned has this type. This could then be hooked into type propagation by checking, at each call, which of the rules have preconditions that are definitely true.

Other declarations of function behavior that could be useful: that a function has no side effects, the set of conditions a function might signal, the set of special variables a function may depend on, the set of special variables a function might modify, and catch values the function could throw to (and the types of the values thrown.)

Revision history for this message
Douglas Katzman (dougk) wrote :

Internally this exists. Anything for external usage should probably be proposed and discussed on the mailing list. Nobody's looking at it otherwise.

Changed in sbcl:
status: New → Incomplete
To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.