[plt-scheme] Renaming of contract names

From: Jens Axel Søgaard (jensaxel at soegaard.net)
Date: Sat Apr 28 12:10:36 EDT 2007

Hi all,

I working on random access lists. I'd like to implement all
operations from srfi 1 including "any". Since (lib "contract.ss")
contains a contract called "any", I tried  renaming it on import:

(module a-module mzscheme
   (require (all-except (lib "contract.ss") any)
            (rename (lib "contract.ss") obj? any))

   (provide/contract
    [empty? (obj? . -> . boolean?)])

   (define empty? null?)

   (define (any pred xs)
     (cond [(null? xs) #f]
           [(pred (car xs)) #t]
           [else            (any (cdr xs))]))

   (display (any even? (list 1 2 3 4 5 6)))
   (newline))

But nevertheless I get the error:

    any: Use any out of an arrow contract in: obj?

Is this supposed to happen?

-- 
Jens Axel Søgaard



Posted on the users mailing list.