Entries from 2008-02-23 to 1 day

論理回路

http://arton.no-ip.info/diary/20080222.html#p01久しぶりに論理回路を勉強した. x y not_x not_y not_x and not_y not(not_x and not_y) (x or y) T T F F F T T T F F T F T T F T T F F T T F F T T T F F require 'test/unit' def _and(x, y) x and y …

explicit DSLとimplicit DSL

先輩のブックマーク経由で. http://www.infoq.com/news/2008/02/presentation-ruby-art-of-dslexplicitだと、通常のブロックを使う。storeの記述が重複して単調. when_shopping do |store| store.buy :popcorn store.buy :soda, @soda_amount end implicit…