Confusing use of parentheses
Posted: Fri Jun 21, 2013 1:35 am
Hi to all, I'm a new user of Cobra. Like many of you I was unhappy with some aspects of other languages and now I believe I have found THE language that will ultimately surpass all others.
As much as I love it, though, there is one thing that really got me confused for a while. Since you don't have to use parentheses if you're calling a parameterless method, I obviously assumed that you don't have to do so when using a parameterless constructor.
So when I wrote the code bellow, it didn't work, because I actually assigned myTypeInstance the Type of MyType.
myTypeInstance = MyType
myTypeInstance.doSomething
I really see no way around this, so maybe a warning for newbies that may commit the same error?
Thanks a lot for the amazing language!
As much as I love it, though, there is one thing that really got me confused for a while. Since you don't have to use parentheses if you're calling a parameterless method, I obviously assumed that you don't have to do so when using a parameterless constructor.
So when I wrote the code bellow, it didn't work, because I actually assigned myTypeInstance the Type of MyType.
myTypeInstance = MyType
myTypeInstance.doSomething
I really see no way around this, so maybe a warning for newbies that may commit the same error?
Thanks a lot for the amazing language!