This page is not created by, affiliated with, or supported by Slack Technologies, Inc.
2022-07-22
Channels
- # announcements (7)
- # babashka (17)
- # beginners (45)
- # biff (2)
- # cider (16)
- # clj-on-windows (3)
- # cljs-dev (12)
- # clojure (27)
- # clojure-austin (1)
- # clojure-europe (18)
- # clojure-norway (5)
- # clojurescript (36)
- # conjure (35)
- # core-async (2)
- # datascript (4)
- # datomic (4)
- # emacs (15)
- # fulcro (23)
- # holy-lambda (12)
- # hyperfiddle (1)
- # introduce-yourself (5)
- # nbb (11)
- # off-topic (37)
- # pathom (34)
- # pedestal (9)
- # reitit (4)
- # releases (1)
- # remote-jobs (1)
- # sci (5)
- # scittle (3)
- # shadow-cljs (88)
- # tools-build (4)
A bug in (defmethod parse 'set! ...)
prevents (set! x -y false)
from working - it treats false
in there as a flag saying that there are just 2 arguments instead of 3. Given that false
could also be nil
, perhaps the (if alt ...)
check should be replaced with an explicit check for the amount of arguments to set!
.
https://clojurians.slack.com/archives/C03S1L9DN/p1658434779619089
Looks like set!
has always expected the target to be a paren-wrapped thing https://clojure.org/reference/java_interop#set
(defmethod parse 'set!
[_ env [_ target val alt :as form] _ _]
(let [[target val] (if alt
;; (set! o -prop val)
[`(. ~target ~val) alt]
[target val])]
...))
I've always wanted the other syntax though... maybe because I've seen it and so just intuitively thought it should be possible
Set! With symbol Also works in deftype with mutable fields. Sorry for capitals, from iPhone
probably should take it to http://ask.clojure.org. IMHO (set! ctx -imageSmoothingEnabled false)
should work and is just confusing if false-ish values don't work. no brainer change if you ask me