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


3 points by almkglor 6124 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 6080 days ago | link

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

-----