From: Robert Feldt Date: 2001-03-06T01:02:00+09:00 Subject: [ruby-talk:12033] Re: ANN: Memoize 0.1.2 On Tue, 6 Mar 2001, Avi Bryant wrote: > It could be written in Ruby, in the same style as the current incarnation > of AspectR - doing a lot of fragile, special-cased syntax generation and > calling instance_eval. What doing it in C allows is to have one, > generalized dispatcher that can still easily find out > a) which method was called to get to the dispatcher, and > b) which object it was called on. > Ok. But this also gives us a hint that something might be "missing" from current Ruby (as you said below). Maybe this info should be accessible by calling 'caller'? Or 'call_info'? > In Ruby, you could have a generalized dispatcher using define_method with > a block, but then the block has the wrong context (no knowledge of "self" > or of which method was called). > > I don't see having a very short C extension of the runtime on which to > build more complex AOP structures as being that evil, personally... after > all (for now) we still depend on a C interpreter. > No, I agree. Just want to be a critic to probe this issue so that I fully understands it, sorry... ;-) > The ideal, really, would be to have built in support for alternate > dispatchers - that is, to truly be able to redefine send, whether in C or > in Ruby. > Yes, maybe this is the way to go. With your knowledge from advice.c what would be a sensible API/naming? Maybe this can grow into a RCR? /Robert