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"
|
("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"))
|
"to create a single list from several, by juxtaposition of the items"))
|
||||||
|
|
||||||
("Higher-Order Functions"
|
("Higher-Order Functions"
|
||||||
|
|
|
@ -183,6 +183,14 @@ namespace.
|
||||||
(check-last 'append (cons a (cons b x)))
|
(check-last 'append (cons a (cons b x)))
|
||||||
(apply append a 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
|
(define-teach beginner error
|
||||||
(lambda (str)
|
(lambda (str)
|
||||||
(unless (string? str)
|
(unless (string? str)
|
||||||
|
@ -340,6 +348,7 @@ namespace.
|
||||||
beginner-cons
|
beginner-cons
|
||||||
beginner-list*
|
beginner-list*
|
||||||
beginner-append
|
beginner-append
|
||||||
|
intermediate-append
|
||||||
beginner-error
|
beginner-error
|
||||||
beginner-struct?
|
beginner-struct?
|
||||||
beginner-exit
|
beginner-exit
|
||||||
|
|
Loading…
Reference in New Issue
Block a user