The nim lang tutorial here says -
A procedure that does not have any return statement and does not use the special result variable returns the value of its last expression.
Why does my echo res print 0 ? Shouldn't I expect the last statement a mod b (= 3) to be returned?
proc divmod(a, b: int; res, remainder: var int): int =
res = a div b
remainder = a mod b
var
x, y: int
let res: int = divmod(8, 5, x, y) # modifies x and y
echo res