This page is not created by, affiliated with, or supported by Slack Technologies, Inc.
2018-09-02
Channels
- # announcements (3)
- # aws (3)
- # bangalore-clj (1)
- # beginners (88)
- # boot (7)
- # braveandtrue (10)
- # cider (6)
- # cljdoc (8)
- # cljsrn (3)
- # clojure (33)
- # clojure-germany (2)
- # clojure-italy (1)
- # clojure-spec (44)
- # clojure-uk (8)
- # clojurescript (14)
- # datomic (5)
- # emacs (6)
- # events (1)
- # figwheel-main (8)
- # fulcro (9)
- # leiningen (11)
- # lumo (3)
- # off-topic (119)
- # parinfer (2)
- # pedestal (1)
- # re-frame (11)
- # reagent (12)
- # shadow-cljs (162)
- # unrepl (4)
Good morning, folks.
I'm a bit confused about spec.
See, I have a protocol, say Datastore
. I want to s/fdef
protocol methods. And can't figure out how.
Could anyone point a finger to any documentation or article on speccing protocols?
Can't do it. I've solved this problem in the past by making functions that call down to the protocol and putting specs on those
The generics are erased in the jvm - you can just pass a vector (which is a Collection) of the correct objects and it should work
Any standard book recommendations for new clojure programmers? I'm pretty new to FP and totally new to Lisp, I know the JVM and Java fairly well.
Also: - Programming Clojure (3rd edition) - Getting Clojure - Living Clojure
I'd recommend starting with Clojure for the Brave and true if you don't mind silly puns
Clojure brave and true also helps with setting up a development environment in the popular ides as well. I started with it but I find more seriously toned books easier to follow.
Oh that does sound good - understanding the development environment is what I'm struggling with most now to be honest.
I'm not sure how it all works myself lol, I treat it like magic. But generally the repl is essentially a shell for clojure, allowing you to execute clojure commands.
To de-mystify the REPL, you may want to look at this: https://clojure.org/guides/repl/introduction
Dang the docs are pretty much answering all my questions - RTFM was the right answer again. Altho I like your way of putting it better @U06GS6P1N :>
Hello Clojurians 😛 I got a shared container of rabbitmq. Bunch of my application uses the container and as a host the containers alias is used (in that case 'rabbitmq'). Of course when I change the host to 'localhost' the connection is successful. My question is how do you handle connecting to the shared container via the REPL? Is there some common strategy to that problem in Clojure world?
I think that I will create a special fn for that case that tries to connect and if errors occurs then try to connect to localhost. And if it fails then app fails 😜
wouldn't you want to use config so that it knows which host to look for, and publish the port from the container so that you could find it by name even if the two apps aren't on the same container?
I’m assuming your REPL is running on the host machine (localhost). One thing you can do is to put something like this into your hosts
file
127.0.0.1 rabbitmq
which tells your local machine to resolve hostname ‘rabbitmq’ to localhost. Then you don’t need different configuration for your app that runs in docker network.Ooo great 😉
That's something I was looking for 🙂
Thank you
No problem! Btw if you are Mac user you also need to flush your dns cache after adding entry to hosts
@noisesmith using config is lame 😜 because I would have to maintain separate configuration for repl and application.
Well now you’re exchanging config for OS-level ‘hack’ to apply same rules inside/outside docker. 😉 (I do this also myself)
How are people (particularly freelancers/consultants with high project churn/turnover) handling repeated project overhead (e.g., defining user account tables/datomic schemas, authentication workflows, etc)? I’m beginning to pine for the time-saving convenience of things like meteor add accounts
, for the every-project repeated components.