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 <d...@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 > >
____________________ Racket Users list: http://lists.racket-lang.org/users