Arc Forumnew | comments | leaders | submitlogin
Faux dynamic binding of globals for Arc (smuglispweeny.blogspot.com)
3 points by kennytilton 5908 days ago | 2 comments


3 points by almkglor 5908 days ago | link

  (mac prog1 (f1 . ofs)
    (w/uniq (f1v)
    `(let ,f1v ,f1
       (do ,@ofs) ; do wrapper unnecessary?
       ,f1v)))

  (from "arc.arc")
  [mac] (do1 . args)
   Performs the body in sequence, then returns the value of the
      first expression.
      See also [[do]] 
(normallispweeny mode!!!)

Also, you might be interested in 'after

  (from "arc.arc")
  [mac] (after x . ys)
   Ensures that the body is performed after the expression `x',
      even if it fails.
      See also [[do]]
Especially since you want to assuredly revert the values of the variables.

-----

1 point by jazzdev 5863 days ago | link

Nice, but not thread-safe. You'd need to add thread-local variables.

-----