This page is not created by, affiliated with, or supported by Slack Technologies, Inc.
Is there a function version of conda
like or*
is for conde
? If not, how would one go about creating one?
Context: I’m working on a logic program where the number of clauses depends on the input data, I’m trying to avoid doing all the data processing in macros
Actually, it turns out conda
doesn’t work anyways. What I think I’m looking for is the ability to define a “default match” for when other clauses in a conde
(or or*
) don’t match. For example:
(conde
[(membero x [1 2 3]) (membero y [4 5 6])]
[(membero x [4 5 6]) (membero y [10 11 12])]
[#_(otherwise? x) (membero y [100 101 102])])
I’ve tried specifying the inverse of the other matches, but it seems like core.logic doesn’t have much in the way of negation except nafc
, which doesn’t work with fd/in
afaict (and fd/in
is required for my actual problem). And because fd
requires finite ranges, I can’t invert the ranges (e.g. 100–120 -> 0–99, 121–∞)