fix 'append' in ISL+ to disallow a non-list last argument (merge to 4.2.2)
svn: r16166
This commit is contained in:
parent
75a5e0c23a
commit
f3de56f742
|
@ -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"
|
||||
|
|
|
@ -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
|
||||
|
|
Loading…
Reference in New Issue
Block a user