Metaxal / define2

Like lambda and define, but simplifies keyword arguments and wrapper functions
Other
7 stars 0 forks source link

`contract-out` defeats the purpose of `define2` #3

Open Metaxal opened 2 weeks ago

Metaxal commented 2 weeks ago

File A.rkt:

#lang racket
(provide procA  (contract-out [procB (-> any/c any/c boolean?)])

(define (procA x y) (equal? x y))
(define (procB x y) (equal? x y ))

file B.rkt:

(require "A.rkt")

(procB) ; no syntax error :(
(procA) ; syntax error, as required by define2, but exported without contracts
Metaxal commented 2 weeks ago

Fortunately, when using the option #:unprotected-submodule no-contract of contract-out together with (require (submod "A.rkt" no-contract)), the benefits of define2 are kept intact.