|How to build your own stack frames? (interpreter questions) email@example.com (1995-08-20)|
|Re: How to build your own stack frames? (interpreter questions) firstname.lastname@example.org (1995-08-21)|
|Re: How to build your own stack frames? (interpreter questions) Lassi.Tuura@hut.fi (1995-08-21)|
|Re: How to build your own stack frames? (interpreter questions) email@example.com (1995-08-22)|
|Re: How to build your own stack frames? (interpreter questions) firstname.lastname@example.org (1995-08-22)|
|From:||email@example.com (Antoun Kanawati)|
|Date:||Tue, 22 Aug 1995 11:37:52 GMT|
> If your code is strictly C++, you could use a bunch of templates. For
> each exported function and method, you create either template function
> or a template class based object. The template function itself can
> then do any conversion required (through compiler's type unification).
> All the required conversion get compiled into the program -- no
> run-time cost and if you design it well, not too much code bloat.
In fact, all you need is a template per signature. That is, you can
deal with all the procedures and member functions that have the same
signature using the same template. For example:
template<class retType, class thisType, class arg1>
retType externalCall(retType (thisType::*func)(thisType *thisArg, arg1 a1))
> This scheme cannot handle varargs, of course. You would have to write
> special coverters or your own varargs stubs.
Varargs remain a problem, and will need assembler assistance, unless you
have valist equivalents for them, such as printf and vprintf.
Antoun (Tony) Kanawati
Return to the
Search the comp.compilers archives again.