port-tests.scm

来自「Scheme跨平台编译器」· SCM 代码 · 共 36 行

SCM
36
字号
(use srfi-1)(define *text* #<<EOFthis is a test<foof> #;33> (let ((in (open-input-string ""))) (close-input-port in)       (read-char in)) [09:40]<foof> Error: (read-char) port already closed: #<input port "(string)"><foof> #;33> (let ((in (open-input-string ""))) (close-input-port in)       (read-line in))<foof> Error: call of non-procedure: #t<foof> ... that's a little odd<Bunny351> yuck. [09:44]<Bunny351> double yuck. [10:00]<sjamaan> yuck squared! [10:01]<Bunny351> yuck powered by yuck<Bunny351> (to the power of yuck, of course) [10:02]<pbusser3> My yuck is bigger than yours!!!<foof> yuck!<foof> (that's a factorial)<sjamaan> heh<sjamaan> I think you outyucked us all [10:03]<foof> well, for large enough values of yuck, yuck! ~= yuck^yuck [10:04]ERC> EOF)(define p (open-input-string *text*))(assert (string=? "this is a test" (read-line p)))(assert (string=?   "<foof> #;33> (let ((in (open-input-string \"\"))) (close-input-port in)"  (read-line p)))(assert (= 20 (length (read-lines (open-input-string *text*)))))

⌨️ 快捷键说明

复制代码Ctrl + C
搜索代码Ctrl + F
全屏模式F11
增大字号Ctrl + =
减小字号Ctrl + -
显示快捷键?