(続)Gaucheで「カブらない数字を4桁だすの」をやる

引数のリストと同じメンバーがいないような数字をランダムで出力するyを使用。
なんかletだらけになるのが気持ち悪い。

>> (let me ((x ())) (define y (lambda (x) (let me ((a x)) (let ((b (random-integer 10))) (if (memq b a) (me a) b))))) (if (> (length x) 3) x (me (cons (y x) x))))

=> (0 6 8 9)