Hi Matthias,
Thanks.
Very nice backward compatible suggestion.
I'll look into the source code of check-duplicates.
I should be able to modify it according to your suggestion.
I'll let you know as soon as I have it.
Thanks again, Jos.

-----Original Message-----
From: Matthias Felleisen [mailto:matth...@ccs.neu.edu] 
Sent: viernes, 27 de mayo de 2016 1:24
To: Jos Koot
Cc: Racket Users
Subject: Re: [racket-users] check-duplicates


You can add a keyword argument that changes the not-found result for such a
case: 

(define special (gensym))
(check-duplicates+ '(#f #f) #:not-found special)

Its signature would have to look like this then: 

;; check-duplicates : (listof X)
;;                    [(K K -> bool)]
;;                    #:key (X -> K)
;;                -> X or #f
(define (check-duplicates items
                          [same? equal?]
                          #:not-found [default #f]
                          #:key [key values])
  .)

This way the existing interface works but someone who needs it for a list of
Booleans (or something else I can't think of right now) can get a distinct
answer. 


[[ Racket's universal type lacks true option types, and we tend to
approximate it with (U #f X). ]]

- Matthias



> On May 26, 2016, at 4:35 PM, Jos Koot <jos.k...@gmail.com> wrote:
> 
snip

-- 
You received this message because you are subscribed to the Google Groups 
"Racket Users" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to racket-users+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Reply via email to