pzel / mkr

An implementation of µKanren in Lisp Flavored Erlang.
MIT License
18 stars 5 forks source link

The form (= ...) is used in LFE #1

Open oubiwann opened 9 years ago

oubiwann commented 9 years ago

Hey man,

Just wanted to give a heads-up: the form (= ...) is used in LFE when pattern matching; it allows one to set the whole data structure being matched to a value while still matching parts of it to other variables.

Maybe (unif ...)? I haven't spent enough time with The Reasoned Schemer to offer a good alternative ...

pzel commented 9 years ago

Yeah, originally that operator was called equalo, but it felt somehow off, because it had the name of a relation (non-primitive) while actually being the basic language primitive.

My line of thinking was that since µKanren is a DSL, then it's OK to shadow host language constructs while 'inside' the DSL, so to speak.

It sems that prolog uses the ?- operator for unification. I'm willing to forgo = (despite its elegance and adherence to mini-/mircoKanren syntax), but let's think a while about a good replacement. (Too bad can't be typed easily on the keyboard..)