Re: Ann: SWI-Prolog 7.1.13
Jan Wielemaker <[email protected]> Fri, 18 Apr 2014 09:23:06 +0200
| Newsgroups | gmane.comp.ai.prolog.swi |
|---|---|
| Message-ID | <[email protected]> |
On 04/18/2014 08:58 AM, rlaanemets wrote: > What should be now used instead of get_dict_ex/3. The use of '.' is > mandatory? Changelog mentions '$get_dict_ex'/3 but it's not documented in > the manual. I need this to fix most of my packs. I didn't really anticipate on that. Sorry. I've always expected that get_dict_ex/3 is just an weird name to support ./3. The semantics was quite clean, but I discovered that a definition with a bit odd semantics would make ./3 a lot faster for the typical case. I see some ways out. One is to re-add get_dict_ex/3 with the old semantics. I don't really like this. get_dict/3 is much like get_assoc/3. The other is to add a deprecated get_dict_ex/3 to library(backcomp) (the usual way to deal with such changes in a way to break as little as possible), like this: get_dict_ex(Key, Dict, Value) :- ( get_dict(Key, Dict, V0) *-> Value = V0 ; existence_error(key, Key) ). My preference is to just leave it as is. If there is enough support that this breaks too much code, I'll add it to library(backcomp). If there is enough support to keep get_dict_ex/3, I'll re-add that. > Also, please check the current implementation of '.'/3: (latest commit so > far) > http://www.swi-prolog.org/git/pl-devel.git/blob/81f173a103d346048e7b46584aeee2e22b38aa19:/boot/dicts.pl > > The comment about '$get_dict_ex' looks wrong and the body of '.'/3 has the > call is_list(KV) with KV being unbound. Oops, one shall have more test cases ... Fixed and added a couple of tests. Thanks --- Jan