Arc Forumnew | comments | leaders | submitlogin
2 points by rocketnia 4417 days ago | link | parent

"Wart doesn't currently have an easy way to get at the callee scope"

What about this?

  (def get-current-environment ()
    caller-scope)


1 point by akkartik 4417 days ago | link

Lol! Yes, that works :)

-----

3 points by rocketnia 4416 days ago | link

If you define (thunk ...) ==> (fn () ...), then using 'get-current-environment is actually more verbose than writing the implementation directly:

  get-current-environment.
  thunk.caller-scope.
Actually, 'thunk and infix syntax isn't necessary, and Kernel has the same quirk:

  (get-current-environment)
  ((fn () caller-scope))     ; Wart
  (($vau () e e))            ; Kernel

-----