From: twifkak@... Date: 2005-06-11T00:07:03+09:00 Subject: Re: duck-typing allows deeper polymorphism > > Not entirely true... The argument 'x' must also respond to whatever > > parseargs wants from it (respond_to?, I assume), whatever the 'pa.x' method > > wants from it (well, nothing, I assume), and whatever 'p' wants from it > > (to_s, I assume). > > sure - everything in :ducktype=>list AND what parseargs needs - quite true. Not just parseargs, but any other methods that the method calls. In your case, it was simply p, but in some other case, I might be passing a parameter all around the system, in which case, who knows what it'll need. (Is that bad design? If so, that's precisely one of the things I want to flesh out as an extra restriction we need to place on ourselves because we're using Ruby.) > >> note that this could be parsed via rdoc quite easily. > > Only if it's an Array literal being passed to parseargs. > huh? def method(*argv) pa = parseargs(argv){ arg :x, :ducktype => File.new('methods.txt').readlines.each { |line| line.chomp } } p pa.x.upcase.downcase end > we're all friends here so i assume people will offer up any criticisms come to > mind. Ok. Thanks! Devin