> At one stage I seriously thought about implementing ButFirst.pm in
> Ruby. I couldn't think of a nice way that would make it work as nicely
> as in Perl, but who knows, maybe in 1.9.

How about:

class Proc
   def but_first(&block)
     block.call
     self.call
   end
end

# in action:

proc do
   puts "there"
end.but_first do
   puts "hello"
end



--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups "Ruby 
or Rails Oceania" group.
To post to this group, send email to [email protected]
To unsubscribe from this group, send email to 
[email protected]
For more options, visit this group at 
http://groups.google.com/group/rails-oceania?hl=en
-~----------~----~----~----~------~----~------~--~---

Reply via email to