Re: [Vala] Properties == GObject properties?
- From: Luca Bruno <lethalman88 gmail com>
- To: Simon Kågedal Reimer <skagedal gmail com>
- Cc: Vala Mail List <vala-list gnome org>
- Subject: Re: [Vala] Properties == GObject properties?
- Date: Sat, 12 Oct 2013 11:58:21 +0200
We don't put much interest on reporting C naming conflicts to the user.
That's not good, however the compiler needs many (but not major) changes to
achieve this, and there are other priorities: in the sense that now you're
stressing the compiler, but in normal usage you don't.
Also, we don't want to mangle the name in case there's a conflict at the C
level, because you can't otherwise reason on the name you expect: let's say
that void @if() { } was renamed in C as _vala_if() { }, I bet that's not
what you want (other than the fact that you don't want to call a method @if
in general).
On Fri, Oct 11, 2013 at 10:53 PM, Simon Kågedal Reimer
<skagedal gmail com>wrote:
Oh, interesting! I updated the page, hope this is correct:
https://wiki.gnome.org/action/info/Vala/Tutorial?action=diff&rev2=242&rev1=241
I also noticed that doing this as a top-level function, i.e naming a
function outside any class or namespace something beginning with a
digit, generates faulty C code. This should be reported as a valac
bug, right? What would be the least surprising behavior, that valac
renames the function (adding some prefix) or to disallow this? Same
thing with keywords, this passes valac:
void @if () {
}
Regards, Simon
On Fri, Oct 11, 2013 at 5:58 PM, Florian Brosch <flo brosch gmail com>
wrote:
Hey Simon,
The overview is outdated:
public class Foo : Object {
// Identifier = "0foo"
public string @0foo {get;set;}
}
Regards,
Florian
On 11 October 2013 10:46, Simon Kågedal Reimer <skagedal gmail com>
wrote:
Hi,
On Fri, Oct 11, 2013 at 9:34 AM, Tal Hadad <tal_hd hotmail com> wrote:
First time I hear not all properties are GObject.
Suppose I have this property:
...
public int 1numbered { get; set; }
...
This is not a GObject property, since it's started with a number.
You can't have that at all, see
https://wiki.gnome.org/Vala/Tutorial#Syntax_Overview :
"For identifier names the same rules apply as for C identifiers: the
first character must be one of [a-z], [A-Z] or an underscore,
subsequent characters may additionally be digits [0-9]."
Signal names also must start with a letter:
https://developer.gnome.org/gobject/stable/gobject-Signals.html#g-signal-new
Regards, Simon
_______________________________________________
vala-list mailing list
vala-list gnome org
https://mail.gnome.org/mailman/listinfo/vala-list
_______________________________________________
vala-list mailing list
vala-list gnome org
https://mail.gnome.org/mailman/listinfo/vala-list
--
www.debian.org - The Universal Operating System
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]