This page is not created by, affiliated with, or supported by Slack Technologies, Inc.
2019-05-19
Channels
- # announcements (5)
- # beginners (7)
- # boot (1)
- # calva (1)
- # cider (7)
- # circleci (2)
- # clara (5)
- # clj-kondo (1)
- # clojure (19)
- # clojure-chicago (1)
- # clojure-dev (3)
- # clojure-europe (1)
- # clojure-spec (1)
- # clojure-sweden (5)
- # clojure-uk (25)
- # clojurescript (4)
- # cursive (2)
- # data-science (1)
- # datomic (44)
- # graphql (9)
- # hoplon (2)
- # klipse (2)
- # luminus (1)
- # nrepl (1)
- # off-topic (38)
- # planck (1)
- # precept (1)
- # quil (1)
- # re-frame (3)
- # reagent (5)
- # shadow-cljs (12)
- # spacemacs (13)
- # sql (2)
- # xtdb (10)
I see the word "reified" come up a lot and sometimes in ways that makes me think i dont understand how its used, at least in the clojure community. 1. its a verb, so it acts on something and that action is to make it less abstract. I reified my health and wellness plan by signing up for the local gym. 2. reify, in clojure, does just that, it defines an anonymous type and creates an instance of that type. so when i see it used like this: > X uses a global singleton for the fact base; I wanted something reified I can pass around. I get confused. because im not sure how to interprate this, maybe they are saying that X only had the idea of a singleton, but they flushed out the implementation?
In the phrase "I wanted something reified I can pass around", it sounds like they want X to be a value that can be bound to a parameter, or returned as a value from a function call.
It would surprise me if everyone used the word "reify" identically to each other, BTW.
reify
does not "define an anonymous type". It creates an object that satisfies one or more interfaces or protocols.
im out of my depth, but i am quoting the clojure docs directly: https://clojure.org/reference/datatypes#_reify
Yeah, I think the "defines an anonymous type" is secondary to what it does. I mean, it has to "Because Java", but that's not really the point of reify
. The important part is "creates an instance of ..." something that implements the specified protocols and interfaces (and IObj
and IMeta
).
yep makes sense, thanks sean
(if that has to create a Java class that implements a bunch of things, that's an implementation detail)
user=> (reify Runnable (run [this]))
#object[user$eval140$reify__141 0x546621c4 "user$eval140$reify__141@546621c4"]
user=> (type *1)
user$eval140$reify__141
user=> (ancestors *1)
#{java.lang.Runnable clojure.lang.IObj java.lang.Object clojure.lang.IMeta}
user=>
It hadn't occurred to me that it would implement IObj
and IMeta
but that makes sense...
interesting, thanks @seancorfield, that makes sense. i think @andy.fingerhut is right here and it might have been a slight mis-use on the original authors part. Normally i dont get tripped up on such things but I wasnt comfortable with reify yet so its hard to see where the misconception is.
I think their usage is correct if you read it as reified as a value.
I’m trying to call a server from my clojure
app using http-kit + enlive
. I’m basically trying to scrape a single page daily, but that page is JS rendered. Is there a way to somehow wait for javascript to render the page?
I believe there’s a Clojure library for doing this: https://github.com/igrishaev/etaoin