<div dir="ltr"><span style="font-family: arial,sans-serif;">I'm probably doing something really dumb. When I run this program:</span><br><br><span style="font-family: courier new,monospace;">#lang scheme</span><br style="font-family: courier new,monospace;">
<br style="font-family: courier new,monospace;"><span style="font-family: courier new,monospace;">(define (counts lst)</span><br style="font-family: courier new,monospace;"><span style="font-family: courier new,monospace;"> (let ([tbl (make-hasheq)])</span><br style="font-family: courier new,monospace;">
<span style="font-family: courier new,monospace;"> (for ((item (in-list lst)))</span><br style="font-family: courier new,monospace;"><span style="font-family: courier new,monospace;"> (hash-set! tbl item (add1 (hash-ref tbl item 0))))</span><br style="font-family: courier new,monospace;">
<span style="font-family: courier new,monospace;"> tbl))</span><br style="font-family: courier new,monospace;"><br style="font-family: courier new,monospace;"><span style="font-family: courier new,monospace;">(define x '(2 2 3 3 2))</span><br style="font-family: courier new,monospace;">
<span style="font-family: courier new,monospace;">(define c (counts x))</span><br style="font-family: courier new,monospace;"><span style="font-family: courier new,monospace;">(define c> (counts (sort x >)))</span><br style="font-family: courier new,monospace;">
<span style="font-family: courier new,monospace;">(define c< (counts (sort x <)))</span><br style="font-family: courier new,monospace;"><br style="font-family: courier new,monospace;"><span style="font-family: courier new,monospace;">(for/or (((k v) (in-hash c))) (= v 2))</span><br style="font-family: courier new,monospace;">
<span style="font-family: courier new,monospace;">(for/or (((k v) (in-hash c<))) (= v 2))</span><br style="font-family: courier new,monospace;"><span style="font-family: courier new,monospace;">(for/or (((k v) (in-hash c>))) (= v 2))</span><br>
<br><div><span style="font-family: courier new,monospace;"></span>the result is<br><br><span style="font-family: courier new,monospace;">Welcome to DrScheme, version 4.0.2 [3m].</span><br style="font-family: courier new,monospace;">
<span style="font-family: courier new,monospace;">Language: Module.</span><br style="font-family: courier new,monospace;"><span style="font-family: courier new,monospace;">#t</span><br style="font-family: courier new,monospace;">
<span style="font-family: courier new,monospace;">#t</span><br style="font-family: courier new,monospace;"><span style="font-family: courier new,monospace;">#f</span><br style="font-family: courier new,monospace;"><span style="font-family: courier new,monospace;">> </span><br>
<br>Why does the last loop evaluate to <span style="font-family: courier new,monospace;">#f</span>? <br><br>-mike<br style="font-family: courier new,monospace;"></div><div><br></div></div>