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

A string in Vala is a *reference* type [1] and therefore passed by

Not according to the documentation:

Cf Vala tutorial:

"Reference Types

The reference types are all types declared as a class, regardless of
whether they are descended from GLib's Object or not. Vala will ensure
that when you pass an object by reference the system will keep track
of the number of references currently alive in order to manage the
memory for you. The value of a reference that does not point anywhere
is null. More on classes and their features in the section about
object oriented programming."

That is why I sought to clarify this point


reference. The documentation is correct here, it may just need to
point out clearly that fact.


[1] it is a bit special because it is immutable, and thus copied
whenever there is a new strong reference to it

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