Re:Why Does “=” Mean Assignment?
by icebraining on Tuesday April 10, 2018 @04:08PM
(#16804815)
Prolog's unification:
--
[ Parent
| on HN ]
Yeah, Prolog's unification operator really blows your mind the first few times you experience it. You left the best part out of that last example:
?- append(X, Y, [1,2,3]).
X = [],
Y = [1, 2, 3] ;
X = [1],
Y = [2, 3] ;
X = [1, 2],
Y = [3] ;
X = [1, 2, 3],
Y = [] ;
false.
(a few newlines added for clarity)