Add cons' and cons?' as synonyms for make-pair' and pair?' to DMdA.

Requested by Michael Hanus & Peter Thiemann.
This commit is contained in:
Mike Sperber 2010-10-08 15:13:20 +02:00
parent 29a0511439
commit b4493fdab4
2 changed files with 11 additions and 3 deletions

View File

@ -15,7 +15,7 @@
(all-from-except beginner: deinprogramm/DMdA procedures
set! define-record-procedures-2 eq? equal?
quote
make-pair pair? first rest
make-pair pair? cons? first rest
length map for-each reverse append list list-ref fold
symbol? string->symbol symbol->string
apply))

View File

@ -25,8 +25,6 @@
(provide provide lib planet rename-out require #%datum #%module-begin #%top-interaction) ; so we can use this as a language
(provide cons) ; hack, for the stepper
(provide (all-from-out deinprogramm/define-record-procedures))
(provide (all-from-out test-engine/scheme-tests))
(provide signature define-contract :
@ -246,8 +244,12 @@
(empty list "die leere Liste")
(make-pair (%a (list %a) -> (list %a))
"erzeuge ein Paar aus Element und Liste")
((DMdA-cons cons) (%a -> boolean)
"erzeuge ein Paar aus Element und Liste")
(pair? (%a -> boolean)
"feststellen, ob ein Wert ein Paar ist")
(cons? (%a -> boolean)
"feststellen, ob ein Wert ein Paar ist")
(empty? (%a -> boolean)
"feststellen, ob ein Wert die leere Liste ist")
@ -389,6 +391,12 @@
(define (empty? obj)
(null? obj))
(define (cons? obj)
(pair? obj))
(define (DMdA-cons f r)
(make-pair f r))
(define (DMdA-append . args)
(let loop ((args args)
(seen-rev '()))