[Xotcl] info method behaviour
Gustaf Neumann
neumann@wu-wien.ac.at
Mon, 13 Aug 2001 19:46:28 +0200
On Monday 13 August 2001 18:15, Kristoffer Lawson wrote:
> On Mon, 13 Aug 2001, Gustaf Neumann wrote:
> > what is it, that would fit your needs best? what are you doing exactly?
>
> Well for me even more important are the "info args" and "info body" parts.
> As mentioned, I'm doing some meta-programming at the moment.
meta-programming is a wonderful thing. actually, several years ago, i wrote
a book about it (in the context of Prolog, see my homepage) covering
meta-interpreters and partial evaluation in particular....
> I have a method which generates more methods based on a template method (an
> example of this can be found
> at: http://mini.net/cgi-bin/wikit/401.html). Right now
> the method-generators assumes that the template is inherited from a class
> (so checks "args" and "body" from there), but really it should not care
> whether a method is inherited or not. It should just be given the name of
> the method, and it can ask the information regardless of inheritance.
hmm. you mentioned here twice "args" and "body"; you should not use
these for inherited methods, use instead "instargs" and "instbody".
i am still confused. Are you trying to use the instprocs as templates
for procs? if i paraphrase the example from the wiki, this would be
Class C
C instproc fooTemplate <argument> <body>
C c1
useTemplate c1 fooTemplate foo -msg1 Hi -msg2 bye
where the object c1 has afterwards a proc foo, and fooTemplate could
be a proc or an instproc.
i do not think, that this is a good solution, but this is an example
where i would like to ignore the differences between procs and instprocs.
is this similar to what you are working on?
-gustaf