Arc Forumnew | comments | leaders | submitlogin
2 points by Pauan 4444 days ago | link | parent

One other benefit: the environment argument is local, rather than a global hard-coded "caller-scope". This not only lets you write it shorter (such as "env") but also avoids collisions in the case of nested $vau's:

  ($vau ... env1
    ($vau ... env2
      ...))
I suppose in that one case, $vau is more well-behaved. You can emulate that behavior with let, though:

  (fn '...
    (let env1 caller-scope
      (fn '...
        (let env2 caller-scope
          ...)))
Which is admittedly verbose.


1 point by akkartik 4444 days ago | link

Yeah, those are great examples.

For all my rhetoric about "give the programmer absolute powa!!1!" I'm uncomfortable making caller-scope too easy to use ^_^. It'll just be the next case of, "when I understand why I need this power, I'll mix it in."

-----