logiccomp / lsl

4 stars 2 forks source link

Fall-through predicate case for define-contract doesn't work for contracts with parameters #16

Closed dbp closed 9 months ago

dbp commented 9 months ago

(define Foo (lambda (x) ...) works, but (define (Foo x) (lambda (y) ...)) errors with literal clause must occur within Flat; obviously wrapping the lambda with Flat works, but would be nice to have the shorthand.

camoy commented 9 months ago

Do you have a more complete example of this behavior? This works for me:

(define-contract (Equal x) (lambda (y) (= x y)))

(: f (-> (Equal 1) (Equal 1)))
(define (f x) x)

(f 1)
dbp commented 9 months ago

Oh, it was my mistake; I had (check (lambda ...)). Sorry!