Thanks for the answer!<div><br></div><div>For now I can go with just having &quot;first&quot;, and if needed go for a one/rest approach.</div><div><br></div><div>I couldn&#39;t find more efficient ways to take &quot;one&quot; though, and with your comment I&#39;m confident to use it as it is now.</div>

<div><br></div><div>[]&#39;s</div><div><br></div><div>Rodolfo Carvalho</div><div><br><div><br></div><div><div class="gmail_quote">On Thu, Sep 8, 2011 at 00:36, Shriram Krishnamurthi <span dir="ltr">&lt;<a href="mailto:sk@cs.brown.edu">sk@cs.brown.edu</a>&gt;</span> wrote:<br>

<blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex;">This looks like a reasonable way to get an element, but thinking<br>
ahead, you will probably want something both like &quot;first&quot; (which you<br>
have) and a corresponding &quot;rest&quot;.<br>
<br>
The problem is that which element you get from the &quot;first&quot; operation<br>
is nondetermistic in a set.  Therefore, you have to either<br>
<br>
- pass the returned first element to the rest operation, or<br>
<br>
- accept that<br>
  (set-union (set (set-item S)) (set-rest S))<br>
  is not the same as S<br>
<br>
A better design would be to use a different signature:<br>
<br>
  get-one/rest : (forall (A) (Set A) -&gt; (values A (Set A)))<br>
<br>
This performs the split &quot;atomically&quot;, so it can ensure that the<br>
combination of &quot;one&quot; and &quot;rest&quot; is the same as the original set.<br>
<font color="#888888"><br>
Shriram<br>
</font></blockquote></div><br></div></div>