On Wednesday,  8 January 2003 at 23:30:51 +0900, Martin Weber wrote:
> Quick shot, suppose ruby wizards can make this still better.
> 
> def use_block?(invoke)
> 	catch (:block) do
> 		eval "#{invoke} do
> 			throw :block, true
> 		end"
> 	end or false
> end
 
 What about functions that take an optional block?

 def optblock(&block)
   return 5 if block_given?
   4
 end

 optblock {} #=> 5
 optblock    #=> 4
 use_block?("optblock") #=> 5

-- 
Jim Freeze
----------
If only one could get that wonderful feeling of accomplishment without
having to accomplish anything.