This page is not created by, affiliated with, or supported by Slack Technologies, Inc.
2017-09-11
Channels
- # aleph (4)
- # beginners (68)
- # boot (21)
- # chestnut (1)
- # cljs-dev (72)
- # clojure (64)
- # clojure-austin (9)
- # clojure-dusseldorf (16)
- # clojure-gamedev (2)
- # clojure-italy (32)
- # clojure-russia (80)
- # clojure-spec (9)
- # clojure-uk (20)
- # clojurescript (105)
- # cursive (5)
- # data-science (5)
- # datomic (23)
- # defnpodcast (3)
- # emacs (22)
- # fulcro (2)
- # graphql (63)
- # hoplon (7)
- # lein-figwheel (17)
- # lumo (63)
- # mount (2)
- # nrepl (4)
- # off-topic (66)
- # om (6)
- # onyx (3)
- # portkey (54)
- # re-frame (12)
- # reagent (12)
- # specter (42)
- # uncomplicate (1)
- # unrepl (38)
- # vim (9)
- # yada (3)
greetings! Something looks terribly wrong to me with my environment. I ran lein new compojure-app httpbis
and I can't seem to get anything worthy out of the REPL. By that I mean, when I (in-ns 'httpbis.repl)
then (start-server)
, I get a CompilerException java.lang.RuntimeException: Unable to resolve symbol: start-server in this context, compiling:(/tmp/form-init9088880558428708437.clj:1:1)
the common issue here is that you have no :init-ns
defined, or there was a startup compilation error you missed.
when in-ns
is run, it doesn’t require the namespace or ensure it’s valid, if the ns specified doesn’t exist (for any reason) it creates a new one but makes none of the default bindings (eg. putting clojure.core into scope with refer-clojure
which ns does implicitly)
the solution is two part: you can use (clojure.core/in-ns 'user)
to get back to a sane place, then (require 'httpbis.repl :reload)
and then switch to the ns but only if there are no errors on the require
I also tried with the Cursive NREPL - same results. Also tried with Emacs' CIDER (jacked in, moved to NS using a fancy elisp fn, didnt work either)
I’m also experiencing that… can’t use docs
, for instance, on my proto-repl on Atom
if by docs
you mean doc
AKA clojure.repl/doc
this is only available if you use
clojure.repl
which is done by default by clojure for your first namespace, but can be done by hand in other namespaces later (use 'clojure.repl)
Got it! Thanks
@lvbarbosa is your project using ring as well ?
Yes, same thing
mmh. I suspect this has to do with either the generated project.clj
being wonky or it's the lein-ring
plugin's fault
so you are making do without a REPL ? do you run lein ring server
and hope it reloads code correctly ?
Well, the only thing I can’t access is those handy functions like docs
I can load my namespace and test the functions I am writting
Let me show you
when you lein repl
, can you just invoke code from your project ? I can't believe this is not working for me 😒
I can’t but it works if I require the .clj
module
like (require 'tasks-api.core)
should this be automagic?
maybe there’s a quicker way to setup the project.clj
I mean, maybe there’s a way to setup the project.clj
file in order to make it automatically import our namespaces
I didn’t try that yet. Giving it a try soon
but they wouldn't show up until I did the (require ...
- which is why I wasn't suspecting this at all
now with regards to my project fiels being magically required when I start the REPL ... well I probably got spoiled
in this case I notice the repl starts in home
NS, where presumably nothing is loaded by default
@lvbarbosa I found :repl-options {:init-ns httpbis.repl}
in project.clj - that helps a lot with regards to requiring my stuff when REPL starts
Hello there. Anyone using spectrum?
I was hooked by it after using ocaml for awhile. Only need to know how to use it automatically without having to type 'check ns fn everytime
https://github.com/arohner/spectrum - I hadn’t heard of it, but it looks very promising - I think I’ll use it when I start using spec
There's a #datomic channel
I suspect that's one of those "It Depends" questions... better for what? Better in which way?
I'm playing with clojure.. making online games (backend).. and to comunicate between client <-> server I will use TCP/UDP of course, but I'm not sure which should I use
So you're going to be communicating server to server, rather than web browser client to server @rcustodio ?
There is server to server (the mainframe like)... and there is client to server (game like)
Howdy ClojureFolks. Ive been inspired to check out Clojure from a blog article about Functional Programming in JavaScript being an anti-pattern.. they recommended ClojureScript.. and then someone recommended Clojure instead of that, to begin with. Any good “hello world” resources I have to check out?
Not sure what I'd suggest for that. If you were building a web app game, the obvious answer would be "use web sockets" and I'd probably point you at Sente which uses core.async to provide channels that communicate back and forth between web client and server in a really nice way.
I'd probably avoid direct server-to-server comms if possible -- and use a message queue instead...
@bengineer the most popular introductory clojure book is free online, it's called "Clojure for the Brave and True"
I see... but I dunno if the game will be browser.. The "front" developer says he prefer to use scala to make for mobile
@bengineer Getting up and running with Clojure on the JVM is a lot easier than ClojureScript in the browser -- so I'd "learn Clojure" on the back end first, so you can avoid a lot of the tooling complexity.
i’m already liking it 👍
@bengineer I agree with @seancorfield, I think you should get used with clojure before, FP
@rcustodio Ah... so he'll be writing Scala for the client and connecting to your Clojure backend over the Internet. Hmm, not sure what I'd recommend then, sorry.
@bengineer Brave/True is a good place to start. I hear really good things about Carin Meier's "Living Clojure" book too. The http://4clojure.com website is a great way to practice your understanding of Clojure/FP once you're through Brave/True, if you like programming puzzles.