CS2613/labs/L04/functions-as-values.rkt
2022-09-22 16:16:55 -03:00

16 lines
346 B
Racket

#lang slideshow
(define (series mk)
(hc-append 4 (mk 5) (mk 10) (mk 20)))
(define (series2 mk)
(apply hc-append 4 (map mk '(5 10 20))))
(define (series3 mk)
(apply hc-append 1 (build-list 100 mk)))
(module+ test
(require rackunit)
(require racket/serialize)
(check-equal? (serialize (series circle)) (serialize(series2 circle))))