type
MyType* = ref object
a*: int32
b*: int32
c*: int32
proc myProc*() = discard
I don't understand why it is placed on the right side. Is there any reason for this design? Feel good on the left side.
type
*MyType = ref object
*a: int32
*b: int32
*c: int32
proc myProc*() = discard
And why is the following not allowed?
dumpTree:
mytype MyType:
a*: int
Error: expression expected, but found ':'I definitely agree. Variable visibility should be secondary. Not to mention that having it on the left side, just for SOME object fields for example, would make the whole thing ugly (at least for me):
type
MyType = ref object
a: int32
*exported: int32
not_exported: int32
No difference at all guys. Moving it will achieve nothing.
I am not sure it was mentioned before I want this to be heated by Araq. I find export marker especially useful in the following way: I search a function name and I find too many result because it is used in too many places. I add export marker and I find exactly where the function is defined.
And why is the following not allowed?
dumpTree:
mytype MyType:
a*: int
I'm a bit perplexed that several people are saying this should be OK. Why should a type's field be visible outside a module if the type itself is not visible outside a module?