|
|
@ -1,5 +1,5 @@
|
|
|
|
#lang racket/base
|
|
|
|
#lang racket/base
|
|
|
|
(require racket/list racket/set)
|
|
|
|
(require racket/list)
|
|
|
|
(require "define/contract.rkt" "len.rkt" "coerce/values.rkt")
|
|
|
|
(require "define/contract.rkt" "len.rkt" "coerce/values.rkt")
|
|
|
|
|
|
|
|
|
|
|
|
(define+provide/contract (trim items test-proc)
|
|
|
|
(define+provide/contract (trim items test-proc)
|
|
|
@ -39,7 +39,7 @@
|
|
|
|
(define+provide/contract (members-unique? x)
|
|
|
|
(define+provide/contract (members-unique? x)
|
|
|
|
(any/c . -> . boolean?)
|
|
|
|
(any/c . -> . boolean?)
|
|
|
|
(cond
|
|
|
|
(cond
|
|
|
|
[(list? x) (= (len (apply set x)) (len x))]
|
|
|
|
[(list? x) (= (len (remove-duplicates x)) (len x))]
|
|
|
|
[(vector? x) (members-unique? (->list x))]
|
|
|
|
[(vector? x) (members-unique? (->list x))]
|
|
|
|
[(string? x) (members-unique? (string->list x))]
|
|
|
|
[(string? x) (members-unique? (string->list x))]
|
|
|
|
[else (error (format "members-unique cannot be determined for ~a" x))]))
|
|
|
|
[else (error (format "members-unique cannot be determined for ~a" x))]))
|
|
|
|