This page is not created by, affiliated with, or supported by Slack Technologies, Inc.
2017-01-17
Channels
- # aws (2)
- # beginners (34)
- # boot (39)
- # cider (28)
- # cljs-dev (2)
- # cljsrn (30)
- # clojure (195)
- # clojure-austin (6)
- # clojure-dev (6)
- # clojure-dusseldorf (1)
- # clojure-france (1)
- # clojure-russia (139)
- # clojure-spec (25)
- # clojure-uk (66)
- # clojurescript (125)
- # community-development (1)
- # core-async (42)
- # cryogen (1)
- # cursive (22)
- # datascript (6)
- # datomic (67)
- # docker (1)
- # emacs (7)
- # events (1)
- # garden (3)
- # hoplon (15)
- # jobs (3)
- # lein-figwheel (10)
- # leiningen (3)
- # luminus (4)
- # mount (2)
- # nginx (1)
- # off-topic (101)
- # om (42)
- # om-next (6)
- # onyx (7)
- # proton (1)
- # protorepl (4)
- # re-frame (15)
- # reagent (30)
- # remote-jobs (1)
- # ring (8)
- # ring-swagger (17)
- # rum (1)
- # spacemacs (2)
- # sql (1)
- # yada (50)
@tbaldridge thanks, do you have other suggestions written up else? I see you have a profiling video so will check that out in the meantime!
@tbaldridge Thanks, I've moved to an unordered pipeline and that seems to have done the trick.
Am I understanding :require
correctly here:
(:require [clojure.browser.repl :as repl])
means I am using the clojure.browser.repl
library in it's entirety, aliased as repl
(:require [cljs.core.async :refer [<!]])
means I am using asynchronous take (`<!`) from within cljs.core.async
without requiring the entire cljs.core.async
library.
Is this correct?
the first one is just aliasing the namespace, the second one is importing a specific function from the namespace
How does something like (:require [clojure.some.namespace :refer :all])
differ?
it differs because it's putting all the function of that namespace in the current file
Okay, so if I'm using the alias :as
form, this is calling functions from within the original namespace, whereas :refer :all
imports all those functions into my current namespace and I can reference them directly as if they'd been defined within my namespace?
e.g. repl.somefunction
vs somefunction
=> (:require [clojure.string :as s])
=> s/split
=> (:require [clojure.string :refer [split]])
=> split
=> (:require [clojure.string :refer :all])
=> split
the 2nd one can only call split from the clojure.string namespace, because that's what it only referred the 3rd one can call all the keywords (whre split also comes from) of the clojure.string, because it referred all of its keywords
Perfect. Thanks @ejelome :thumbsup:
@yogidevbear use the first two though if you can, :refer :all
can make code harder to read, since you have no clue where a given symbol is imported from.
about the only time I use it is when I'm testing [clojure.test :refer :all]
Will do. I remember seeing it in Living Clojure (which I'm working through at the moment) and just wanted to make sure I grokked the differences
hello, i’m wondering what folks in this channel recommend in the way of resources to introduce someone to programming generally and to programming in clojure in particular
i was thinking that The Little Schemer might be a good first book since it seems to be good at introducing the habits of thinking of programming
@seako I've heard good things about The Little Schemer, another option would be SICP (also teaches Scheme)
I think FP in general maybe harder to grasp if you have years of OOP behind you. But if your mind is free I guess it would be easier to start with clojure. That said, why should it be easy in general? Programming can make a rocket fly to the moon, I dont see how that should be easy 😉
^ right, I even remembered looking for variable when I started learning Lisp, fun times 😄
yeah, there is just so much that is different from “regular” programming that it might just confuse a beginner
when you are learning, I think you should just focus on trying out stuff and not care too much about best practices
that's true, by experience, I actually learn faster and understand better if I build something that interests me, than mere following tuts
@ejelome that’s How to Design Programs, right? i’ve never read it but i like that it’s from one of the authors of the Little books. kind of fun that they start you out with an algebra of pictures. very different from the usual introduction.
yes, same author, but I think the main goal of his books is geared towards how to solve problems (how to think), rather than teaching you how to code; and as I have not come from a compsci background but merely a self taught individual, I find that I'm going into that direction, how wonderful if a newbie will start from that actual point I will go into, after some years of coding, kinda sad for me and ironic to them