-
Notifications
You must be signed in to change notification settings - Fork 123
Constraints & modes
David Nolen edited this page Jan 5, 2013
·
8 revisions
core.logic unfortunately to this day continues to emphasize operating on sequence-like data structures due to its Prolog & Scheme roots. This often leads to much worse performance than one would like. Now that we have constraints it should be possible to write constraint versions of Clojure functions.
Currently we have a pretty useless experimental defc
in the master branch. It requires all arguments to be completely ground before it executes. What about a defc
with support for "mode" declarations?
(defc assocc
[^:partial m ^:ground k v o]
...
[m ^:ground k v ^:partial o]
...)
The body of the constraint would run when one of the modes have been satisfied. We could probably use the mode information to automatically generate the body of the IRunnable
implementation.