Re: some thoughts on the meta handling
Hi,
On 21/07/05, Dierk Koenig <dierk.koenig@...> wrote:
> a) provide an own Groovy Stack(-trace)
> most of the time, the Java Stacktrace is pretty useless
> for the Groovy programmer as it contains lots of
> "invokeMethod" calls but you cannot see the sequence
> of groovy method calls easily. How about managing our
> own stack, e.g. inside MetaClass?
> This could be used for nice Stacktraces but also for
> Logging-, Tracing-, Profiling-, and Debugging-Support.
That's an interesting idea. We need to see if that's possible.
Moreover, we have to make sure we're creating those custom stacktraces
lazily, since that's pretty expansive to build AFAIK.
> b) allow isTrue() analogous to isCase()
> isCase() allows objects to decide how they
> work in the switch conditional. It would be parallel to
> also allow them control over the general boolean test.
isTrue() is a pretty good idea, I like that!
> c) provide onMethodMissing(name, params)
> to allow objects to more conveniently implement Decorators,
> Adapters, etc. (even methods like curry() with arbitrary
> parameter length, hehe). Default would be implemented in
> Object and throws MissingMethodException.
In fact, our invokeMehtod() already intercepts non-existing methods.
(Continue reading)