Hello,<div><br></div><div>I'm trying to take an arbitrary item from a set, but I couldn't find a documented way to do so.</div><div>I'd have something like this for example:</div><div><br></div><div>> (set-item (set 2 1 3))</div>
<div>3</div><div><br></div><div><br></div><div>The best implementation I could come up with for set-item is:</div><div><br></div><div>; return one arbitrary item of the set</div><div>;</div><div>; set -> any/c</div><div>
(define (set-item s)</div><div> (for/first ([item (in-set s)]) item))</div><div><br></div><div><br></div><div>Would anyone recommend better ways?</div><div><br></div><div>Thanks,</div><div><br clear="all">Rodolfo Carvalho<br>
</div>