This page is not created by, affiliated with, or supported by Slack Technologies, Inc.
2017-04-22
Channels
- # beginners (114)
- # boot (10)
- # cljs-dev (18)
- # clojure (57)
- # clojure-russia (12)
- # clojure-spec (2)
- # clojure-uk (1)
- # clojurescript (62)
- # cursive (49)
- # datomic (3)
- # emacs (2)
- # mount (1)
- # off-topic (25)
- # onyx (58)
- # pedestal (5)
- # re-frame (5)
- # ring-swagger (1)
- # specter (8)
- # unrepl (2)
- # untangled (4)
- # vim (10)
- # yada (39)
< is not generic
it only works on Number
try using compare
(also there's a #beginners channel)
I see it doesn't work on other stuff, I just don't understand the syntax. Like what is 0 and 1 supposed to be in this case, is it a reference to the arguments?
0 means equal, less than or greater than 0 tells you which arg is larger https://docs.oracle.com/javase/7/docs/api/java/lang/Comparable.html
it works on anything implementing the above interface
You mean less than or greater than 0 :)
oh yes, of course, thanks
I was thinking 0 and typed 1
what's a good shorthand for "combinator" i.e. something that takes two or more things and creates a new thing out of it
@qqq reducer?
How do I import Incanter properly? I have this in my profiles.clj [incanter "1.9.1"] and I get this error: Could not transfer artifact org.clojure:clojure:pom:1.3.0-alpha2 from/to clojure (http://build.clojure.org/releases): Ac cess denied to: http://build.clojure.org/releases/org/clojure/clojure/1.3.0-alpha2/clojure-1.3.0-alpha2.pom , ReasonPhra se:Forbidden. This could be due to a typo in :dependencies or network issues. If you are behind a proxy, try setting the 'http_proxy' environment variable.
@harkonnen My first guess would be that there is a transitive dependency somewhere in incanter to clojure-1.3.0-alpha2 which cannot be accessed. You can check that by showing all dependencies with leiningen. You could try to exclude clojure-1.3.0-alpha2 from the incanter dependency. I only wonder, you say you have the dependency in your profiles.clj and not project.clj?
What does the _
mean in anonymous function in this code:
clojure
(clojure.string/replace "mississippi" #"(.)i(.)"
(fn [[_ b a]]
(str (clojure.string/upper-case b)
"--"
(clojure.string/upper-case a))))
;;=> "M--SS--SS--Ppi"
In this case, the first parameter in the vector (`[1 2 3]` for example) is being dropped. So to continue the example, it's assigning b to 2, and a to 3, but ignoring the 1.
@U28FF36Q4 ^^ 🙂
Thanks
So in this case, _
is used for the regex sequence like:
clojure
(re-seq #"he(ll)o,.*" "hello, world") ;=> (["hello, world" "ll"])
important to notice that _
is a variable name like any other, it's just conventionally used for ignored arguments but it doesn't have any special meaning
@sveri I assumed that if I put it in there I don't have to have it in every single project.clj... 😄
@harkonnen :dependencies [[clj-time "0.8.0" :exclusions [org.clojure/clojure]] [org.clojure/clojure "1.9.0-alpha14"] [incanter "1.9.1" :exclusions [clj-time joda-time org.clojure/clojure org.clojure/clojure-contrib org.clojure/core.cache org.clojure/math.combinatorics]] ] :pedantic? :abort
Doesn't seem to work... when I just use this :dependencies [ [org.clojure/clojure "1.8.0"] [incanter "1.9.0" :exclusions [clojure-1.3.0-alpha2]] ] then lein deps works
Hi, advise the development ide or editor with plugin for clojure, thanks
@fantomofdoom Cursive is a good IDE. ProtoREPL+Atom is good. Vim+Fireplace is good. Emacs+Cider is good.
@dominicm I thought it was the reader, but I after @alexmiller said I was I wrong I looked at the code and the only string interning that happens is in the compiler
Is that possible? Theres a lot in HTML that doesn't match directly to markdown
@vitruvia (< 0 1) is always true, so the function is your snippet is equivalent to (fn [a b] b), and reducing it over a sequence will always return the last item.
The metadata on function vars I'm currently seeing. Is that part of clojure core? Cider nrepl? Something else? Curious in it's availability for tooling.
it's something clojure.core does and the basis of most of the useful editor tooling
it's also useful directly in the repl, it's how clojure.repl/source, clojure.repl/doc etc. work