fix 'append' in ISL+ to disallow a non-list last argument (merge to 4.2.2)

svn: r16166
This commit is contained in:
Matthew Flatt 2009-09-29 15:28:44 +00:00
parent 75a5e0c23a
commit f3de56f742
2 changed files with 10 additions and 1 deletions

View File

@ -19,7 +19,7 @@
)
("Lists"
(append ((listof any) ... -> (listof any))
((intermediate-append append) ((listof any) ... -> (listof any))
"to create a single list from several, by juxtaposition of the items"))
("Higher-Order Functions"

View File

@ -183,6 +183,14 @@ namespace.
(check-last 'append (cons a (cons b x)))
(apply append a b x)))
(define-teach intermediate append
(lambda x
(if (null? x)
null
(begin
(check-last 'append x)
(apply append x)))))
(define-teach beginner error
(lambda (str)
(unless (string? str)
@ -340,6 +348,7 @@ namespace.
beginner-cons
beginner-list*
beginner-append
intermediate-append
beginner-error
beginner-struct?
beginner-exit