This page is not created by, affiliated with, or supported by Slack Technologies, Inc.
2022-05-30
Channels
- # babashka (7)
- # beginners (25)
- # calva (22)
- # cljs-dev (1)
- # clojure (62)
- # clojure-europe (118)
- # clojure-hamburg (4)
- # clojure-israel (2)
- # clojure-nl (2)
- # clojure-uk (6)
- # clojured (1)
- # clojurescript (23)
- # conjure (11)
- # cursive (3)
- # datomic (14)
- # duct (2)
- # emacs (12)
- # figwheel-main (1)
- # gratitude (1)
- # hyperfiddle (4)
- # joyride (72)
- # lsp (46)
- # luminus (1)
- # malli (1)
- # off-topic (54)
- # pathom (19)
- # polylith (11)
- # releases (2)
- # sci (22)
- # shadow-cljs (4)
- # vim (11)
- # xtdb (52)
jo how do I override a function locally? Like in clojure with binding
I can advice it and check the presence of some local variable
let
/ let*
can just do that (like clojure binding
) since emacs traditionally has always had dynamic scope
For the last 10 years the direction has changed, so it's worth checking out the rules for which scope applies when
yea for variables but for functions? Ah does cl-flet work? (nvm-flet makes a special symbol of the input)
normally I override the defun altogether (however I admit it's a bit :face_with_cowboy_hat:ish)
perhaps you can advice it with around
and perform your logic conditionally
e.g. (setq-local foo 'yeah)
and then (if foo ,,,)
in your advice
> how do I override a function locally? it depends on what you're trying to do. I often have to refer to this SO post, because I can't memorize these three things https://stackoverflow.com/questions/39550578/in-emacs-what-is-the-difference-between-cl-flet-and-cl-letf