From: matz@... (Yukihiro Matsumoto) Date: 2002-04-22T11:50:18+09:00 Subject: Re: blocks vs. Procs, closures as objects? Hi, In message "blocks vs. Procs, closures as objects?" on 02/04/21, foo@bar.null writes: |{ |x| x * x }.type => Proc, or Block, or Method, or something... | |a block is apparently not an object in ruby, which i guess means that |it's not an expression, either... A block is not. a Proc object is. You can get a Proc by lambda{|x| x * x} proc{|x| x * x} Proc.new{|x| x * x} |anyone care to explain the rationale behind this? Several reasons: * performance: you can avoid object creation. It used to hinder performance. * simplicity: blocks are mostly used for iterators or control structures, so that I felt it was better to make them look like other control structures. matz.