Is it correct that one can write (cons a d) in a pattern, but not empty? Thus,
(define (insert-many ns s)
(match ns
[(? empty?) s]
[(cons a d) (insert a
(insert-many d s))]))
works but
(define (insert-many ns s)
(match ns
[empty s]
[(cons a d) (insert a
(insert-many d s))]))
does not have the intended semantics. This seems unfortunate given
that we've adopted HtDP-style lists, as opposed to traditional Scheme
lists, into Racket wholesale.
Shriram
_________________________________________________
For list-related administrative tasks:
http://lists.racket-lang.org/listinfo/users