From: David Alan Black Date: 2001-08-18T00:10:17+09:00 Subject: [ruby-talk:19948] Re: [ANN] Ruby Behaviors, v. 0.0.2 Hello -- On Fri, 17 Aug 2001, Chris Moline wrote: > On Fri, Aug 17, 2001 at 11:08:59AM +0900, David Alan Black wrote: > > Hello -- > > > > Quick announcement: > > > > Ruby Behaviors, v. 0.0.2, is now available at: > > Well I don't know how you feel about this but I was wondering if we could have a > slightly different way of adopting behaviours? The way I would like is a new > behviour is defined similar to modules Hey -- as author of this package, how do you *think* I feel about the possibility of doing things in Ruby slightly differently from the way they're shipped? :-) > behaviour DavidsWay > def to_h > etc ... > end > > and then it is adopted similar to the way modules are included > > require "behaviour" > adopt DavidsWay > > What do you think?? This design is a bit higher-level, and actually could probably be implemented as a wrapper around the Behaviors engine, if you liked this style better. I don't have a "contrib" directory yet, but it's certainly a possibility :-) You'd have to consider, though, how to unload the changes you've loaded. Maybe if you bit the bullet on having the middle layer (the definition of your changes) not be too transparent, you could do something simple, like what you've got, at the top level. That's kind of what the whole package does: your definitions have to conform to certain wrapper/call requirements (and it shows) but then in the top level program, it's all very unobtrusive. David -- David Alan Black home: dblack@candle.superlink.net work: blackdav@shu.edu Web: http://pirate.shu.edu/~blackdav