Hi,

At Fri, 26 Jul 2002 04:16:39 +0900,
Tom Sawyer wrote:
> then i thought maybe this:
> 
>  mygui.bind(name, :value)        { fruitapp.fruit.isa }
>  mygui.bind(name, :value=)       { |x| fruitapp.fruit.isa = x },
>  mygui.bind(name, :items)        { fruitapp.fruitbasket.contains },
>  mygui.bind(name, :event_change) { fruitapp.pickafruit }
> 
> a friend suggested this:
> 
>  mygui.bind(name,
>    :value        => Proc.new { fruitapp.fruit.isa },
>    :value=       => Proc.new { |x| fruitapp.fruit.isa = x },
>    :items        => Proc.new { fruitapp.fruitbasket.contains },
>    :event_change => Proc.new { fruitapp.pickafruit }
>  )

I guess these two syntaxes can be consistent, the former when a
block (or an proc as third argument) is given, or the latter.

> or i could do this using #missing_method
> 
>  mygui.bind(name) {
>    value        { fruitapp.fruit.isa }
>    value=       { |x| fruitapp.fruit.isa = x }

This can't work as you expect.  Assign to local variable (maybe
in the block).

And which method_missing will you modify?  I don't guess it's
good idea to modify caller's methods.

-- 
Nobu Nakada