Fork me on GitHub
#clara
<
2021-09-09
>
ishodge16:09:46

i have a question about the order of s-expressions that follow a fact type. from what i understand, variables have to be bound before they can be used in a predicate so i’m puzzled as to why this happens: [P (> ?x 5) (= ?x *)] , where P is a record with field *, produces an execution error as expected, but [P (= ?x 5) (= ?x *)] executes fine.

ethanc18:09:26

The first fails, as mentioned, because of the unbound binding. The second succeeds because ?x would be bound to the value 5

ethanc18:09:15

Then checking if * equals ?x

ishodge03:09:55

right, thank you! i was confused by the syntax overloading

mikerod01:09:34

I often have wished there was alternative syntax for binding. But = does make some sense anyways. I understand it sometimes being confusing though.