Re: [Vala] Question regarding passing a strings as arguments to a method
- From: Luca Bruno <lethalman88 gmail com>
- To: Serge Hulne <serge hulne gmail com>
- Cc: vala-list <vala-list gnome org>
- Subject: Re: [Vala] Question regarding passing a strings as arguments to a method
- Date: Mon, 11 Jul 2011 08:34:02 +0200
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.
--
http://www.debian.org - The Universal Operating System
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]