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.<br>
<br clear="all">Carl Eastlund<br>
<br><div class="gmail_quote">On Sun, Feb 12, 2012 at 5:24 PM, Danny Yoo <span dir="ltr"><<a href="mailto:dyoo@cs.wpi.edu">dyoo@cs.wpi.edu</a>></span> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">
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?<br>
<br>Thanks!
<br>____________________<br>
Racket Users list:<br>
<a href="http://lists.racket-lang.org/users" target="_blank">http://lists.racket-lang.org/users</a><br>
<br></blockquote></div><br>