Define `any' signature differently.
... to actually enable the subtyping check. Also, make named signatures work for signature variables.
This commit is contained in:
parent
615d8f1329
commit
f3191ff4d6
|
@ -921,8 +921,8 @@
|
|||
(define symbol (signature/arbitrary arbitrary-symbol (predicate symbol?)))
|
||||
(define empty-list (signature (one-of empty)))
|
||||
|
||||
(define unspecific (signature (predicate (lambda (_) #t))))
|
||||
(define any (signature (predicate (lambda (_) #t))))
|
||||
(define unspecific (signature unspecific %unspecific))
|
||||
(define any (signature any %any))
|
||||
|
||||
;; aus collects/lang/private/teach.ss
|
||||
|
||||
|
|
|
@ -94,10 +94,10 @@
|
|||
(?id
|
||||
(identifier? #'?id)
|
||||
(with-syntax ((?stx (phase-lift stx))
|
||||
(?name name))
|
||||
(?name (or name (syntax->datum #'?id))))
|
||||
(let ((name (symbol->string (syntax->datum #'?id))))
|
||||
(if (char=? #\% (string-ref name 0))
|
||||
#'(make-type-variable-signature '?id ?stx)
|
||||
#'(make-type-variable-signature '?name ?stx)
|
||||
(with-syntax
|
||||
((?raise
|
||||
(syntax/loc #'?stx
|
||||
|
|
|
@ -85,10 +85,10 @@
|
|||
(?id
|
||||
(identifier? #'?id)
|
||||
(with-syntax ((?stx (phase-lift stx))
|
||||
(?name name))
|
||||
(?name (or name (syntax->datum #'?id))))
|
||||
(let ((name (symbol->string (syntax->datum #'?id))))
|
||||
(if (char=? #\% (string-ref name 0))
|
||||
#'(make-type-variable-signature '?id ?stx)
|
||||
#'(make-type-variable-signature '?name ?stx)
|
||||
(with-syntax
|
||||
((?raise
|
||||
#'(error 'signatures "expected a signature, found ~e" ?id)))
|
||||
|
|
|
@ -2916,9 +2916,9 @@
|
|||
(define Symbol (signature/arbitrary arbitrary-symbol (predicate symbol?)))
|
||||
(define Empty-list (signature (one-of empty)))
|
||||
|
||||
(define Any (signature (predicate (lambda (_) #t))))
|
||||
(define Any (signature Any %Any))
|
||||
|
||||
(define Unspecific (signature (predicate (lambda (_) #t))))
|
||||
(define Unspecific (signature Unspecific %Unspecific))
|
||||
|
||||
(define (cons-of car-sig cdr-sig)
|
||||
(make-pair-signature #t car-sig cdr-sig))
|
||||
|
|
Loading…
Reference in New Issue
Block a user