[Gambas-user] ByRef and JIT

Benoît Minisini g4mba5 at gmail.com
Mon Jan 20 23:15:06 CET 2020


Le 20/01/2020 à 23:08, Jussi Lahtinen a écrit :
> Is there going to be support for byfer?
> 
> Jussi

'ByRef' in Gambas is a mix of syntactic sugar (done by the compiler) and 
stack trick (done by the interpreter).

Calling Func(ByRef A, ByRef B) does that:
- Enter function Func
- Run the function
- Put the value of local A et B on the stack
- Leave the function
- Get from stack the new values of A and B.

I don't know how to do it cleanly in C at the moment. This is not the 
same thing as pointers!

-- 
Benoît Minisini


More information about the User mailing list