Created
March 31, 2015 10:51
-
-
Save nothingrealhappen/380e72a71f28e3ea9300 to your computer and use it in GitHub Desktop.
20150331「每日一题」怕了么?
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
(= (car (funny-number-stream)) 1)
(= (car ((cdr (funny-number-stream)))) 2)
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
使用 lisp 或 js 写一个 stream
注: 永远返回一个 pair,
(car (s))
返回一个数,(cdr (s))
则返回下一个 stream,(car ((cdr (s))) 会返回第二个数, 可以无限的取下去.