From: James Edward Gray II Date: 2007-06-06T05:19:44+09:00 Subject: Re: [ANN] prototype-2.0.0 On Jun 5, 2007, at 3:03 PM, ara.t.howard wrote: > > On Jun 5, 2007, at 12:55 PM, Victor Zverok Shepelev wrote: > >> * Does anybody uses it in real projects? I mean, does prototype-based >> approach in not prototype-based language have proved to be useful? >> The >> question is not about "throw the library away", but about "who can >> say, what >> features in library are useful", "who can recommend library for >> some tasks?" > > example > > Config = Object.prototype{ > YAML.load(IO.read('config')).each do |key, value| > attribute key => value > end > } > > p Config.host > p Config.port Which is significantly better than: require "ostruct" Config = OpenStruct.new( File.open("config") { |file| YAML.load(file) } ) ? I guess the difference comes in how they are used, right? Can you show an example of that? I realize I'm just not prototype enlightened yet. No offense intended. James Edward Gray II