Re: Object Variants and some issues

2019-12-23 Thread FernandoTorres
Thanks @araq, how about allowing that pragma {.fieldChecks: on|off.} in the prog header, so that it would only affect its own scope?

Re: Object Variants and some issues

2019-12-23 Thread Araq
> So my question is, can that pragma be documented? Consider it done.

Re: Object Variants and some issues

2019-12-23 Thread solo989
proc `$`(mo: MyObj): string = Run doesn't need to be surrounded by field checks off. You have a bug in your code. of mk2: result &= "u:" & $mo.x & ", v:" & $mo.y & ", w:" & $mo.z Run should be of mk2: result &= "u:" & $mo.u & ", v:"

Object Variants and some issues

2019-12-22 Thread FernandoTorres
It sounds reasonable that the discriminator of an object variant should be kept invariable to keep the object's data structure safe; I found, however, some scenarios in which it can be done. One way was to use the compiler directive --fieldChecks:off. I also attempted the same, but using the