I've written a version of `set-choose', and also `set-first' and
`set-rest' (with the obvious meanings) a few times. They can be useful.
(I always waffled about whether to use just `set-choose', or `set-first'
along with `set-rest'. Mathematically, `set-first' and `set-rest' don't
make sense,
I think a function named set-choose should return just the chosen
element. I would call the function below set-split, maybe.
Also, beware that for/first returns #f if the sequence is empty.
Ryan
On 11/11/2010 01:38 PM, Jay McCarthy wrote:
I think it is a good idea. Any objectors?
Jay
On Wed
I think it is a good idea. Any objectors?
Jay
On Wed, Nov 10, 2010 at 12:40 PM, David Van Horn wrote:
> The set library is missing a convenient way of selecting an element from a
> set, making it hard to write recursive functions matching the inductive
> structure of a set.
>
> Could you add thi
The set library is missing a convenient way of selecting an element from
a set, making it hard to write recursive functions matching the
inductive structure of a set.
Could you add this function, or something like it?
(define (set-choose s)
(let ((x (for/first ([x (in-set s)])
x
4 matches
Mail list logo