in reply to Re^4: what difference between eval and do ?
in thread what difference between eval and do ?

But your code already perfectly show the difference and the underlining reason between eval and do: they both return the value of the last statement in the block, eval is sub-call, so it copy the last value and return it; and do is a bit like a named block. that's it.
  • Comment on Re^5: what difference between eval and do ?

Replies are listed 'Best First'.
Re^6: what difference between eval and do ?
by ikegami (Patriarch) on Apr 24, 2018 at 14:14 UTC

    Nope, it only illustrates an inconsequential difference I didn't even know about before the OP posted it.