On 28/11/05, David Lee david@davelee.com.au wrote:
just to complicate matters, I much prefer the curlybrace style expansion. It's also more robust:
items.collect { |i| i.children }.reject{|c| c.children.empty? }
with your regex macro becomes
items.collect do |i| i.children end.reject{|c| c.children.empty? }
which is illegal Ruby; with a curly-style expansion your macro holds up admirably.
Ummm there's nothing illegal about that expression.
Regards,
Matt -- Matt Mower :: http://matt.blogs.it/