2017-10-01から1ヶ月間の記事一覧

3.3.1 可変リスト構造

Exercise 3.12 appendとappend!の挙動の違い 手続きの定義 ; xの一番最後の要素にyを付け加える (define (append x y) (if (null? x) y (cons (car x) (append (cdr x) y)) ) ) ; xの最後の要素をとってきて、そこに追加する (define (append! x y) (set-cdr…