[Gambas-user] Pass arguments by reference?

Rob sourceforge-raindog2 at ...94...
Sat May 15 19:39:04 CEST 2004


On Saturday 15 May 2004 13:34, Grahame White wrote:
> > Object types, as far as I can tell, are always passed by
> > reference.  I think this may be true of arrays as well, so
> > maybe try putting the stuff you want to pass by reference
> > into an array?
> That seems a little over the top, it'd make more sense to just
> pass arguments by value and have an option to pass by
> reference. Heh, I suppose that's just because I'm more used to
> coding with by reference :)

I think most modern languages kind of discourage you from passing 
by reference, though since objects are passed by reference 
already it shouldn't be such a big deal to maybe add a "by 
reference operator" to Gambas, maybe the backslash or, dare I 
say it, a ByRef keyword? ;)

Of course, you could also just declare the variable as public 
and/or static and then it's kinda moot.

Rob





More information about the User mailing list