From: Charles Oliver Nutter Date: 2008-12-03T02:54:27+09:00 Subject: [ruby-core:20216] Re: Proposal: deferred blocks Yehuda Katz wrote: > Example: > > Article.select(defer {|a| a.title =~ /Some title/ }) > > class Article > def self.select(sexp) > # sexp is: s(:defer, s(:lasgn, :a), s(:match3, s(:lit, /Some > title/), s(:call, s(:lvar, :a), :title, s(:arglist)))) > end > end > > I understand that this would require a more explicit definition of the > parse tree, but it seems like UnifiedRuby has provided a viable starting > point for that work. It would have to be a keyword to be portable, since e.g. 1.9 and JRuby will have different (or no) ASTs to present. But I like the idea of an expression tree trigger keyword in principal (similar to how LINQ uses "from" as its trigger, I believe). - Charlie