Hi
Is it possible to transfer code from "intermediate student with lamnda" to
"Pretty big"
for exmple :
(require 2htdp/image)
(require 2htdp/universe)
(define (join-together ls1 ls2)
(local
[; help : [ListOf X] -> [ListOf X]
; (help ls1) drops the invariant argument ls2
(define (help ls1)
(cond
[(empty? ls1) ls2]
[else (cons (first ls1)
(help (rest ls1)))]))]
(help ls1)))
(check-expect (join-together '() '(a b c d e f)) '(a b c d e f))
(check-expect (join-together '(a) '(b c d e f)) '(a b c d e f))
(check-expect (join-together '(a b) '(c d e f)) '(a b c d e f))
(check-expect (join-together '(a b c ) '(d e f)) '(a b c d e f))
(check-expect (join-together '(a b c d) '(e f)) '(a b c d e f))
(check-expect (join-together '(a b c d e) '(f)) '(a b c d e f))
(check-expect (join-together '(a b c d e f) '()) '(a b c d e f))
Thanks,
Or
p.s. I get the error
check-expect: undefined;
cannot reference an identifier before its definition
--
You received this message because you are subscribed to the Google Groups
"Racket Users" group.
To unsubscribe from this group and stop receiving emails from it, send an email
to [email protected].
For more options, visit https://groups.google.com/d/optout.