Re: [Vala] Cannot have field and method with the same name

2010-12-05 Thread Jan Hudec
On Fri, Dec 03, 2010 at 15:38:38 -0800, Anatol Pomozov wrote: > I have a class that contains a field and method with the same name, > and Valac does not like it. What is the reason? Other languages > (C#/Java) allow it. Pardon me. C# does NOT allow that: test.cs(3,17): error CS0102: The type `Foo

Re: [Vala] Cannot have field and method with the same name

2010-12-04 Thread Jiří Zárevúcky
Anatol Pomozov píše v So 04. 12. 2010 v 11:22 -0800: > Sorry for stubbornness - I learn Vala and trying to illuminate all > dark corners. I am looking for an example that clearly shows why we > cannot have field/method with the same name. > In Vala, you can access any method as if it was a const

Re: [Vala] Cannot have field and method with the same name

2010-12-04 Thread Anatol Pomozov
On Fri, Dec 3, 2010 at 5:08 PM, Evan Nemerson wrote: > On Fri, 2010-12-03 at 15:38 -0800, Anatol Pomozov wrote: >> Hi, >> >> I have a class that contains a field and method with the same name, >> and Valac does not like it. What is the reason? Other languages >> (C#/Java) allow it. You have to use

Re: [Vala] Cannot have field and method with the same name

2010-12-04 Thread Anatol Pomozov
2010/12/3 Aleksander Wabik : >>I have a class that contains a field and method with the same name, >>and Valac does not like it. > > Generally Vala does not have any usable symbol mangling engine. It's > good, because Vala generates a C api and you obviously don't want to > have obfuscated symbols

Re: [Vala] Cannot have field and method with the same name

2010-12-03 Thread Evan Nemerson
On Fri, 2010-12-03 at 15:38 -0800, Anatol Pomozov wrote: > Hi, > > I have a class that contains a field and method with the same name, > and Valac does not like it. What is the reason? Other languages > (C#/Java) allow it. You have to use () for method so you know whether > you access method or fi

Re: [Vala] Cannot have field and method with the same name

2010-12-03 Thread Aleksander Wabik
One more note (sorry for flood): >You have to use () for method so you know whether >you access method or field. It's not so simple, because you can assign this function as a callback (delegate or signal) somewhere: object1.delegate_instance = object2.stop; object1.signal_instance.connect(object

Re: [Vala] Cannot have field and method with the same name

2010-12-03 Thread Aleksander Wabik
>I have a class that contains a field and method with the same name, >and Valac does not like it. Generally Vala does not have any usable symbol mangling engine. It's good, because Vala generates a C api and you obviously don't want to have obfuscated symbols there (the way that C++ does it is jus

[Vala] Cannot have field and method with the same name

2010-12-03 Thread Anatol Pomozov
Hi, I have a class that contains a field and method with the same name, and Valac does not like it. What is the reason? Other languages (C#/Java) allow it. You have to use () for method so you know whether you access method or field. public class Foo { public boolean stop = true; public bool