Closed erikkaplun closed 3 years ago
The documentation on dicts has this example (5.4.1.2 Predefined functions on dicts):
?- write(t{a:t{b:x}}.get(a/b)). x
however, on SWI Prolog 8.2.0, I get instead:
?- write(t{a:t{b:x}}.get(a/b)). ERROR: Type error: `dict-key' expected, found `a/b' (a compound) ...
The docs document the current development version. Key-paths are a new addition. .get(a).get(b) should work fine, as well as simply .a.b which will raise an error rather than failing if a key is missing.
.get(a).get(b)
.a.b
The documentation on dicts has this example (5.4.1.2 Predefined functions on dicts):
however, on SWI Prolog 8.2.0, I get instead: