diff options
Diffstat (limited to 'chap5/part3.rkt')
-rw-r--r-- | chap5/part3.rkt | 5 |
1 files changed, 5 insertions, 0 deletions
diff --git a/chap5/part3.rkt b/chap5/part3.rkt index 2fad35d..cf6cc92 100644 --- a/chap5/part3.rkt +++ b/chap5/part3.rkt @@ -143,6 +143,11 @@ (goto (reg continue)) append-done)) +(define (last-pair x) + (if (null? (cdr x)) + x + (last-pair (cdr x)))) + (#%provide append!) (define (append! x y) (set-cdr! (last-pair x) y) |