On Sun, Aug 5, 2018 at 3:40 PM Matthias Felleisen
wrote:
> I“d write it like this:
>
> (struct tree (val left right) #:transparent)
> ;; Tree = '() | (tree X Tree Tree)
>
> (define (printer t0)
> (local (;; from-t0 : the path from t0 to t
> (define (printer/acc t from-t0)
>
I“d write it like this:
(struct tree (val left right) #:transparent)
;; Tree = '() | (tree X Tree Tree)
(define (printer t0)
(local (;; from-t0 : the path from t0 to t
(define (printer/acc t from-t0)
(cond
[(empty? t)
(map display (reverse
I have this tree[1]:
(tree
'(game A B)
(tree '(game A C) '() (tree '(game C B) '() (tree '(game B A) '() '(
(tree '(game B C) '() (tree '(game C A) '() (tree '(game A B) '() '()
This is how I'd like to print it out:
;; (game A B) --> (game A C) --> end
;; (game A B) --> (game A C)
3 matches
Mail list logo