From: ts Date: 2005-01-14T00:07:50+09:00 Subject: Re: Duck Typing as Pattern Matching >>>>> "i" == itsme213 writes: i> My claim is this: If you redefine #method_missing so your object handles i> x.foo as the caller would expect, then you _should_ define i> x.respond_to?(:foo) to return true. I do not claim that Ruby should prohibit i> code that does not do this. well, difficult, for me, to reply because you must see the underlying C++ interface (DbXml) to see why bdbxml do this. Normally the code must be written p txn.manager.create_modify i.e. `txn.create_modify' is *exactly* the same than `txn.manager.create_modify' but, to give you, another example uln% cat b.rb #!/usr/local/bin/ruby $LOAD_PATH.unshift("../src") require 'bdbxml' txn = BDB::Env.new("tmp",BDB::CREATE|BDB::INIT_TRANSACTION).manager. transaction p txn.respond_to?(:create_container) p txn.create_container("aaa") txn.commit uln% uln% b.rb true # uln% in this case `txn.create_container' is *really* different from `txn.manager.create_container' Transaction#create_modify is just a convenient method. Guy Decoux