3 ms·
> That isn't true, you need parentheses for procs with no arguments, else it's interpreted as a proc pointer. Try `echo` vs `echo()`. My bad, I meant 0 argumen
by jdrek1 4y ago
> That isn't true, you need parentheses for procs with no arguments, else it's interpreted as a proc pointer. Try `echo` vs `echo()`.
My bad, I meant 0 argument member functions (or rather 0 additional argument functions, apart from the this pointer). So `foo: Foo` and then `i = foo.len()` directly shows me that I'm calling a function, `i = foo.len` looks like I just access a member variable. len is obviously not the best example but I still don't think hiding the fact that a function is being called is a good idea at all.
> It's used for declaring variables of an object. `type Foo = object` and `var foo: Foo`.
Good point, I didn't consider that. So far never came up in my code but I can see that it sometimes can be useful to do something like that.
> So it's not uncommon or weird. Just programming languages are overly restrictive.
Natural languages have been case sensitive long before programming languages existed. Again, I'm not saying it's a bad feature - on the contrary, definitely appealing in some case - it's just not what we're used to and hence a bit "weird".