Fork me on GitHub
#emacs
<
2018-09-22
>
vxe00:09:21

random thought, if there was a wrapper around a C STM system, eg http://www.tmware.org/tinystm.html , could one implement clojure like concurrency primitives and load them as dynamic modules https://github.com/emacs-pe/emacs-modules ?

richiardiandrea02:09:32

I don't see why not

vxe03:09:38

asked on irc, general consensus is that STM isn’t that beneficial without accompanying immutable data structures

theeternalpulse18:09:58

hey, question. I'm doing this so that a plugin that expects a single symbol actually picks one from a random list, it seems to work but was wondering if this is the proper way. I basically want a function to be evaluated where a variable is expected.

(defun pick-random (list)
    (nth (random (length list)) list))

  (use-package circadian
    :ensure t
    :config
    (let ((dark-themes '(spacemacs-dark material-dark sanityinc-tomorrow-eighties))
          (light-themes '(spacemacs-light material-light gandalf sanityinc-tomorrow-day otmos-softer soft-morning)))
      (setq circadian-themes `(("8:00" . ,(pick-random light-themes))
                               ("19:00" . ,(pick-random dark-themes))))
      (circadian-setup)))

vemv18:09:42

can you paste a failed attempt?

theeternalpulse18:09:27

this seems to work, though i'm pretty sure it doesn't evaluate each time since it evaluates only once at startup

vemv18:09:42

Ah, I got you now. I don't think want a function to be evaluated where a variable is expected is feasible. You'd have to open a PR against circadian to make things more dynamic

theeternalpulse18:09:41

I figured, I thought elisp had some magic hybrid function/variable