Lisp’s Influence on Ruby
Once I wrote users.select { |u| u.admin? }.map(&:email) and realized I’d written Lisp. Not literally. The parentheses are gone, the prefix notation is gone, the lambdas are syntactic blocks. But the shape of the code (chain a filter onto a transform, ask each element a yes-or-no question with ?, build the result without mutating anything) is Lisp. Ruby just put it in business casual. Matz has said as much. He’s described Ruby’s design as starting from a simple Lisp, stripping out macros and s-expressions, t
评论
?
参与讨论