[This message was originally sent on June 28, 1997, when I was temporarily acting as a moderator for comp.lang.c.moderated. It mentions, without going into too much detail, two more-recent ideas I've received on the subject.]

Subject: Re: Interpreter -- Calling functions
Date: Sat, 28 Jun 1997 10:44:03 -0700 (PDT)
Message-Id: <199706281744.KAA07952@solutions.solon.com>
X-scs-References: <199612161422.OAA02621@goday.ac.upc.es> <9701171704.ZM25160@collie.hpl.hp.com>

Besides the ideas I passed along in that other message, here are two I've received more recently from other netters. Fermin Javier Reig had a variation on the idea of using an interface like


	Push(arg1);
	Push(arg2);
	...
	Call(func);

, although his idea ran into several problems of its own, and anyway it addresses the part of the problem that you've already solved, so I won't say more about it here. Jonathan Thompson had the idea of "creating a very large structure of chars", filling in that structure with an image of the argument list (i.e. the stack frame) to be built, and then passing what looks like a single argument, i.e. that one structure, to the called function, which could -- with luck -- interpret it as multiple arguments. I think this trick could be made to work on some machines, although I haven't experimented with it yet, and it obviously assumes a pure stack calling model, i.e. it wouldn't work at all on a register-passing machine.

Steve Summit
comp.lang.c.moderated co-moderator
scs@eskimo.com