playing around with dicts

Michael Hendricks <[email protected]>
Newsgroups gmane.comp.ai.prolog.swi
Message-ID <CAFHuXuZNHHwthoWDjDEpuPu3L45XHrVekOjC2t==8Z-8xRa9yA@mail.gmail.com>
I've been playing with dicts in V7.  Here are some observations/questions.
 This is all done with V7.1.3 on OS X Mavericks.

?- assert(person{name:john}).

gives a segfault.  Full trace is at https://gist.github.com/mndrix/7947317

I was glad to see that dicts are allowed as facts and clause heads.
 However, calling listing/0 on such programs gives an error about
sub_atom/5.  See https://gist.github.com/mndrix/7947389

Section 5.4 of the manual says, "If a dict is written, the keys are written
according to the standard order of terms".  Do we want to commit to that
behavior so early in the design?  If the implementation changes to
something based on hashing, it could be expensive to generate sorted
output.  We can always commit to sorted output later.

-- 
Michael
-------------- next part --------------
HTML attachment scrubbed and removed
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.