Re: Dynamic Scope / Continuation Marks

  • From: Peter Cawley <corsix@xxxxxxxxxx>
  • To: luajit@xxxxxxxxxxxxx
  • Date: Sat, 5 Nov 2016 22:37:07 +0000

On Sat, Nov 5, 2016 at 10:26 PM, Brandon Bloom
<brandon.d.bloom@xxxxxxxxx> wrote:

If the withx call itself is not in tail position, that code will fail to
restore the old value of x.

I don't quite follow. If the withx call is not in tail position, then
`debug.getinfo(2, "f").func` will give the function which called
withx. That function will not be equal to withx, and consequently the
withx call will save and restore x.

Other related posts: