Why does concat on vectors evaluate to a list?

concat returns a lazy sequence. user=> (doc concat) ————————- clojure.core/concat ([] [x] [x y] [x y & zs]) Returns a lazy seq representing the concatenation of the elements in the supplied colls. you can convert it back to a vector with into: user=> (into [] (concat [1 2] [3 4] [5 6])) [1 2 3 … Read more

= and == in Clojure

== is for comparing numbers. If either of its arguments is not a number, it will always return false: (== :a :a) ; => false As you can see by saying (clojure.contrib.repl-utils/source ==) at the REPL (with repl-utils require‘d, of course), == calls the equiv method of clojure.lang.Numbers. The relevant bit of clojure/lang/Numbers.java (from the … Read more

clojure when macro

core.clj is built from top to bottom, starting with just what Java provides and building up all the requirements for Clojure as it goes. When when is defined the syntax quote does not yet exist. The when macro is defined on line 456 of core.clj and the requirements for syntax-quote are not available until line … Read more

Display complete dependency tree with Leiningen

You can generate Maven’s POM out of Leiningen’s project definition and then use Maven’s dependency:tree plugin with a verbose option, like this: $ lein pom $ mvn dependency:tree -Dverbose=true This will list dependencies omitted for various reasons, e.g.: | +- ring:ring-core:jar:1.4.0:compile | | +- (org.clojure:clojure:jar:1.5.1:compile – omitted for conflict with 1.7.0) | | +- (org.clojure:tools.reader:jar:0.9.1:compile … Read more

Symbols in Clojure

General intro: Symbols in any Lisp are used as identifiers. If you’re going to refer to the value of a variable, say, you need to have a way of naming it; that’s what symbols are for. Remember that all Lisp code gets translated at read time to Lisp data structures; identifiers must also be represented … Read more

Hata!: SQLSTATE[HY000] [1045] Access denied for user 'divattrend_liink'@'localhost' (using password: YES)