UNB/ CS/ David Bremner/ teaching/ htdp+emacs

Summary

images as output test results signature report
bsl 1 2
bsl+ 3 4
isl
isl+ 5
asl

Tests are with racket-mode 20230628git0-1, Emacs 29.1 and racket 8.10 on Debian.

Signature report test

#lang htdp/isl+

(: Foldr ((%a %a -> %a) String (ListOf %a) -> %a))
(define (Foldr combine base lst)
  (cond
    [(empty? lst) base]
    [else (combine
            (first lst)
            (Foldr combine base (rest lst)))]))

(define (sum-list lst) (Foldr + 0 lst))

(sum-list '(1 2 3))

  1. evaluating (circle 10 'outline "red") displays as #<image>↩︎

  2. line wrapping interacts a bit weirdly with the boxes, but it remains legible, and recovers if window is widened.↩︎

  3. evaluating (circle 10 'outline "red") displays as #<image>↩︎

  4. line wrapping interacts a bit weirdly with the boxes, but it remains legible, and recovers if window is widened.↩︎

  5. signature violations are not reported in racket-mode by default. With prefix argument racket-test reports the somewhat cryptic
    ; got 0
    ; Context (errortrace):
    ;    /home/bremner/sigtest.rkt:11:23: (Foldr + 0 lst)
    

    for the Signature report test code.↩︎