yaotti's diary

Software is Eating the World

SICP勉強会#3

ざっくりまとめ.
範囲は1.2.5最大公約数〜1.3高階手続きによる抽象の前まで.


R5RSより,condの説明

If the selected ⟨clause⟩ contains only the ⟨test⟩ and no ⟨expressions⟩,
then the value of the test is returned as the result.

条件式しかない場合はその値を返す.

sys-randomは

`sys-random' returns a random
number between 0 and a positive integer RAND_MAX,

srfi-27のrandom-integerは

Returns a random exact integer between [0, n-1], inclusive, using the default random source.


特定の範囲の連続した自然数からなるリストを返す関数

(use srfi-42)
(list-ec (: i 2 10) i)
;; => (2 3 4 5 6 7 8 9)
|<<
iotaでもいいけど,これは便利そう.
(list-ec (: i 1 10) (* i i))とか.



数学的な部分が多かった.というか全部数学.Fermat's Little Theoremとか.
勉強会中に28が解けなかったのが残念.