Re: Ann: SWI-Prolog 7.1.13

rlaanemets <[email protected]> Sat, 19 Apr 2014 00:19:08 -0700 (PDT)
Newsgroups gmane.comp.ai.prolog.swi
Message-ID <[email protected]>
Does the sematic issue come from the need to support nondet mode when the Key
is unbound? As this has the usual (for anything that involves exceptions?)
order-dependent semantics:

?- D = _{ a: 1 }, X = b, get_dict_ex(X, D, 1).
ERROR: get_dict_ex/3: key `b' does not exist in _G2711{a:1}

?- D = _{ a: 1 }, get_dict_ex(X, D, 1), X = b.
false

Anyway, I have never used get_dict_ex/3 with an unbound Key, never even
thought about that :)

Now the question is: will the dot (.) operator keep throwing exception on
the missing key or is that going to be changed? The documentation for
http://swi-prolog.org/pldoc/doc_for?object=get_dict/3 says:

"This predicate is normally accessed using the functional notation Dict.Key"

which hints that it might not.

By the way, the comment on top of '.'/3 still looks wrong:
http://www.swi-prolog.org/git/pl-devel.git/blob/dec32b691ac0ca322456a4734f7c01d908ce2d32:/boot/dicts.pl

"fails if the first argument is not a dict or the second is not a valid key
or unbound"

Not sure how many here use Kate but I also attempted to fix their warnings
for the Swi dict syntax:
https://bugs.kde.org/show_bug.cgi?id=333608



--
View this message in context: http://swi-prolog.996271.n3.nabble.com/Ann-SWI-Prolog-7-1-13-tp14825p14838.html
Sent from the SWI Prolog mailing list archive at Nabble.com.