История изменений
Исправление korvin_, (текущая версия) :
(: a (String -> (Listof String)))
(define (a x)
(cons "x" (cdr (list x))))
(define (b x)
(cons "x" (cdr (list x x))))
(define (c x)
(cons "x" (cdr (list x))))
;;;; --------------------------------
> a
- : (String -> (Listof String))
#<procedure:a>
> b
- : (Any -> (Listof Any))
#<procedure:b>
> c
- : (Any -> (Listof String))
#<procedure:c>
> (a 1)
. Type Checker: Expected String, but got One in: 1
> (b 1)
- : (Listof Any)
'("x" 1)
> (c 1)
- : (Listof String)
'("x")
> cdr
- : (All (a b) (case-> ((Pairof a b) -> b) ((Listof a) -> (Listof a))))
#<procedure:cdr>
> '()
- : (Listof Any) [more precisely: Null]
'()
Исправление korvin_, :
(: a (String -> (Listof String)))
(define (a x)
(cons "x" (cdr (list x))))
(define (b x)
(cons "x" (cdr (list x x))))
(define (c x)
(cons "x" (cdr (list x))))
;;;; --------------------------------
> a
- : (String -> (Listof String))
#<procedure:a>
> b
- : (Any -> (Listof Any))
#<procedure:b>
> c
- : (Any -> (Listof String))
#<procedure:c>
> (a 1)
. Type Checker: Expected String, but got One in: 1
> (b 1)
- : (Listof Any)
'("x" 1)
> (c 1)
- : (Listof String)
'("x")
> cdr
- : (All (a b) (case-> ((Pairof a b) -> b) ((Listof a) -> (Listof a))))
#<procedure:cdr>
Исходная версия korvin_, :
(: a (String -> (Listof String)))
(define (a x)
(cons "x" (cdr (list x))))
(define (b x)
(cons "x" (cdr (list x x))))
(define (c x)
(cons "x" (cdr (list x))))
;;;; --------------------------------
> a
- : (String -> (Listof String))
#<procedure:a>
> b
- : (Any -> (Listof Any))
#<procedure:b>
> c
- : (Any -> (Listof String))
#<procedure:c>
> (a 1)
. Type Checker: Expected String, but got One in: 1
> (b 1)
- : (Listof Any)
'("x" 1)
> (c 1)
- : (Listof String)
'("x")
>