Arc Forumnew | comments | leaders | submitlogin
1 point by eds 6051 days ago | link | parent

Thanks, that is exactly what I wanted. Although it might be nice to have a macro wrapper around 'thread-local for initializing variables

  (w/uniq void
    (mac w/thread-local (var (o val void))
      (if (is val void)
	  `(= ,var (thread-local))
	  `(do (= ,var (thread-local))
	       (= (,var) ,val)))))
then you could do

  (w/thread-local foo 0)
instead of the two step initialization

  (= foo (thread-local))
  (= (foo) 0)