[racket] prop:dict question

From: Carl Eastlund (cce at ccs.neu.edu)
Date: Thu Feb 16 15:23:53 EST 2012

The -count field of dict properties is there to support dict-count; the
-iterate-{first,next,key,value} fields are there to support in-dict,
in-dict-keys, and in-dict-values.  Those functions need to produce
sequences; they may or may not be the same as using the dict itself as a
sequence.  Some dictionaries are not sequences, and some are sequences with
different behavior than in-dict applied to themselves.

Carl Eastlund

On Sun, Feb 12, 2012 at 5:24 PM, Danny Yoo <dyoo at cs.wpi.edu> wrote:

> I was looking at trying to implement a structure that represents a
> dictionary, but some of the elements of the interface don't make too much
> sense to me yet: there are elements corresponding to ref/set as I expected,
> but what I didn't expect were iteration as well..  Since there's a separate
> protocol for sequences in the form of prop:sequence, the prop:dict elements
> corresponding to count, iterate-first, ... seem superfluous.  Why does
> prop:dict include these methods?
>
> Thanks!
> ____________________
>  Racket Users list:
>  http://lists.racket-lang.org/users
>
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.racket-lang.org/users/archive/attachments/20120216/cb49f5c2/attachment.html>

Posted on the users mailing list.