Created
September 13, 2016 21:12
-
-
Save dsbw/90ac0018f388088e1cdee0ba3743c88a to your computer and use it in GitHub Desktop.
How to recurse in logic...?
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
(defn allowed-values [constraints] | |
(cond | |
(nil? constraints) (run* [q]) | |
(coll? constraints) (run* [q] (membero q constraints)) ;;<--works but not recursively | |
;;(coll? constraints) (run* [q] (first constraints)) | |
(keyword? constraints) (allowed-values (translate-symbol constraints)) | |
:else (run* [q] (== constraints q))) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment