This page is not created by, affiliated with, or supported by Slack Technologies, Inc.
2018-10-26
Channels
- # 100-days-of-code (1)
- # aleph (4)
- # beginners (112)
- # boot (2)
- # business (4)
- # calva (3)
- # cider (37)
- # clara (26)
- # cljs-dev (6)
- # cljsrn (1)
- # clojars (4)
- # clojure (89)
- # clojure-brasil (1)
- # clojure-conj (1)
- # clojure-dev (81)
- # clojure-dusseldorf (8)
- # clojure-italy (41)
- # clojure-nl (3)
- # clojure-spec (11)
- # clojure-uk (14)
- # clojurescript (73)
- # cursive (1)
- # data-science (3)
- # datomic (2)
- # dirac (9)
- # duct (6)
- # emacs (4)
- # figwheel-main (1)
- # fulcro (47)
- # incanter (3)
- # jobs-discuss (43)
- # leiningen (18)
- # luminus (6)
- # lumo (4)
- # mount (4)
- # off-topic (31)
- # portkey (8)
- # protorepl (5)
- # re-frame (9)
- # reagent (15)
- # reitit (2)
- # ring-swagger (7)
- # shadow-cljs (28)
- # specter (4)
- # tools-deps (8)
- # uncomplicate (1)
harking back to a discussion about the #<
dispatch in the reader, I found something that still prints that way: (with-local-vars [v 42] v)
Wow, with-local-vars has remarkably few usages found by CrossClj. It is kind of a strange name for something that can so easily return the "local" thing.
I have literally never heard of anybody using it ever
user=> (let [v (with-local-vars [v 42] v)] (var-set v 12) @v)
Evaluation error (IllegalStateException) at clojure.lang.Var.set (Var.java:226).
Can't change/establish root binding of: null with set
in case you're curious what you can do with it after returning italso
user=> (let [v (with-local-vars [v 42] v)] (push-thread-bindings {v 12}) @v)
12
Out of a dozen or so uses I have found by CrossClj, every one of them uses it to create and return an anonymous Var 🙂
And about 4 of those are copies of tools.reader
shaded copies
can we call it a feature used by @bronsa then?
There are other hackers using it to create unnamed Vars, too. He isn't the only one.
but I want to believe he is
Looks like this clown named gfredericks has a project that uses it.
is the only difference between var-set
and set!
whether or not you have to hash-quote?
...meaning the obvious ones that relate to any macro?
and it could be one since var-set
exists, eh?
you could get rid of every special form except interop and just put everything in RT, is that right?
I think it should be renamed with-local-vars-but-here-is-the-exit-door-thanks-for-visiting
@gfredericks hmmmmm no
weeeeeeeeellllllllllllllllllll okay
sorry I've had a couple beers
okay but interop and fn
would be enough
dagnabbit
Difficult to win an argument with the author of tools.analyzer on corner cases.
I've misplaced my inhibitions
our three weapons are interop, fn
, and recur
and try
that's four weapons
Reminds me of one of the weird cases bronsa has fixed in tools.analyzer - someone redefining catch as a macro
(defmacro do [& forms] `((fn [] ~@forms)))
also try
could make a couple fn
s and pass them to RT
it's not cheating, I'm assuming fn
is a special form
Not high priority -- if I don't file something, I will probably have forgotten about it within 2 days.
Which should be obvious by the number of times I have filed different variations on the same bug 🙂
@gfredericks if
would probably be the other one, although I guess if you want to be really nasty you can macro it and thunkify the arguments
... reinventing Church numerals in 3... 2... 1....
Testing how to make Greek letters: lambda
:lambda:
λ
this & that & the other
Dang it. I so totally should have written those as church numerals.
(defmacro if [c t e] `(({true (fn [] ~t) false (fn [] ~f)} (boolean ~e))))
the problem with clojure is doing all the classical lambda calculus stuff breaks recur
me and @bronsa know all the standard pitfalls with implementing if
using maps
my favorite way to do do
would be something like
(defmacro do [it & more] (if (seq more) `((fn [_#] (do ~@more)) ~it) it))
which also still breaks recurI'm not letting you break my mind.... Averting eyes....
OK, reinventing Church numerals in λf.λx. f (f (f x)) … λf.λx. f (f x) … λf.λx.f x …
Yes, I have spent the last few minutes very productively.
That could qualify as the nerdiest pun I've ever seen