Mercurial > repos > other > SevenLanguagesInSevenWeeks
view 3-Prolog/day2-unification.pl @ 73:74976fddd25f
Ignore Erlang binary files and remove existing ones
author | IBBoard <dev@ibboard.co.uk> |
---|---|
date | Sat, 03 Feb 2018 19:52:45 +0000 |
parents | 90c4b7f28690 |
children |
line wrap: on
line source
% Unification works both sides of the equals: % (A, 2, C) = (1, B, 3). % We can't actually run this from a file, because Prolog. We get: % % native code procedure (=)/2 cannot be redefined (ignored) % % But we can run it from the REPL. % % Lists have heads and tails: % % [a, b, c] = [Head|Tail]. % % Underscore is the wildcard variable: % % [a, b, c] = [_|Tail]. % % Note: It's not magic "Head|Tail", it's "[X|Y]" notation