Re: [Vala] Question regarding passing a strings as arguments to a method

On Mon, Jul 11, 2011 at 07:10:45AM +0200, Serge Hulne wrote:
If one has a look at the C code generated by Vala for the following
two examples, it appears that the "unowned" keyword has no influence
on the way
the string b (of type gchar*) is passed to f().

In both cases, it is passed as a pointer (without duplication).

Therefore it seems to me that the Vala tutorial is slightly misleading
and should read:

- "In Vala strings are always passed by address".

The documentation is correct, the "value" here is the reference itself.
"By reference" means the address of the variable, not of the object.

-- - The Universal Operating System

[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]