Drkcore

22 08 2007 SICP Tweet

SICP 3.13

リストの問題

(define (make-cycle x)
  (set-cdr! (last-pair x) x)
  x)

という定義に対し

gosh> (define z (make-cycle (list 'a 'b 'c)))
z
gosh> z
#0=(a b c . #0#)

これに(last-pair z)は無限ループ

About

  • もう5年目(wishlistありマス♡)
  • 最近はPythonとDeepLearning
  • 日本酒自粛中
  • ドラムンベースからミニマルまで
  • ポケモンGOゆるめ

Tag

Python Deep Learning javascript chemoinformatics Emacs sake and more...

Ad

© kzfm 2003-2021