From: Mathieu Bouchard Date: 2002-08-12T02:05:13+09:00 Subject: Re: automagic On Thu, 8 Aug 2002, Tom Sawyer wrote: > here's the basic problem. if your are trying to bind to an array, for > example, in the model, how are you going to "trap" changes to that > array? a model may alter the array via #<< or #sort! or the like, and > such changes are indifferent to accessor_methods. indeed, you can alter > an array in this way via an attr_reader method! MetaRuby (http://artengine.ca/matju/MetaRuby/) does what you want. It contains a program that allows making arrays and hashes that have #undo and #redo methods. That program is ~100 lines. I think one can write a program for observable arrays and hashes (using MetaRuby too) in less than 50 lines. ________________________________________________________________ Mathieu Bouchard http://artengine.ca/matju