2 ms·
It means I don't understand Prolog very well and really shouldn't have namedropped it :P
by hwayne 9y ago
It means I don't understand Prolog very well and really shouldn't have namedropped it :P
- triska 9y agoProlog is a good example of a language where "=" doesn't mean assignment. In Prolog, "=" means unification: You can read X = Y (which is =(X, Y) in functional notation) as: "True iff X and Y are unifiable". You can think of unification as a generalization of pattern matching. For example, f(X, b) is unifiable with f(a, Y) by the substitution {X → a, Y → b}. I think this aspect would be a valuable addition to the article. Fun fact: If (=)/2 were not available as a built-in predicate in Prolog, you could define it by a single fact: X = X. Thus, you do not even need this predicate as a predefined part of the language.