Re: Help understanding proc()

2020-04-16 Thread lscrd
Sorry, but your second example is no more valid than the first one. In both cases, as @Hlaaftana said, you need to declare the proc before referencing it.

Re: Help understanding proc()

2020-04-16 Thread Hlaaftana
You can forward declare procs to reference them before they are defined. type Something = object act*: proc() name*: string proc someaction*() var something = Something(act: someaction) proc someaction*() = something.name = "boo"

Help understanding proc()

2020-04-16 Thread Pixeye
## INVALID type Something = object act* : proc() name*: string var something = Something(.act : someaction) proc someaction*()= something.name = "boo" Run ## VALID type Something = object act* : pro