バイナリアンになる

スラッシュドットジャパン: Binary Dayに寄せて(2008年11月11日 高田 浩和) - Binary Day 2008 より。

それでは、最後に、Binary Dayにちなんで、あの名言を引用しておきます。


0101010001101000011001010111001001100101001000000110000101110010
0110010100100000011011110110111001101100011110010010000000110001
0011000000100000011101000111100101110000011001010111001100100000
0110111101100110001000000111000001100101011011110111000001101100
0110010100100000011010010110111000100000011101000110100001100101
0010000001110111011011110111001001101100011001000011101000001010
0101010001101000011011110111001101100101001000000111011101101000
0110111100100000011101010110111001100100011001010111001001110011
0111010001100001011011100110010000100000011000100110100101101110
0110000101110010011110010010000001100001011011100110010000100000
0111010001101000011011110111001101100101001000000111011101101000
0110111100100000011001000110111101101110001001110111010000101110

スラッシュドットジャパン: Binary Dayに寄せて(2008年11月11日 高田 浩和) - Binary Day 2008
$ cat binary-day.scm
(use rfc.http)
(use gauche.generator)
(receive (_ _ html)
  (http-get "slashdot.jp" "/sp/binary2008/bin2008_takada.shtml")
  (do-generator [m (grxmatch #/[01]{8}/ html)]
    (display (integer->char (string->number (m) 2)))))
$ gosh binary-day.scm
There are only 10 types of people in the world:
Those who understand binary and those who don't.

正規表現がマッチする限り繰り返して何かする場合、今までは明示的にループを書いていたけど、grxmatchは簡潔に書けていいですね。