clojure Questions
3
Solved
I'm a Ruby dev moving over to Clojure and I'm having trouble understanding how to translate the following Java call into Clojure based on the conventions used in the Clojure library Amazonica.
Ama...
Puncture asked 5/2, 2015 at 9:26
4
Solved
So I have this workflow problem:
I'm happily typing away on my clojure project repl and realise that i need another library that is not in my project.clj, say in this case, i needed the tools.cli ...
Backswept asked 25/7, 2012 at 1:8
4
Solved
As I understand it, when I do nrepl-jack-in a REPL is loaded along with all the dependencies defined in project.clj. If I then update project.clj to add a new dependency, do I need to kill the serv...
5
Solved
I'm intrigued in the database service Datomic, but I'm not sure if it fits the needs of the projects I work on. When is Datomic a good choice, and when should it be avoided?
5
Solved
I want to zip a file in clojure and I can't find any libraries to do it.
Do you know a good way to zip a file or a folder in Clojure?
Must I use a java library?
2
Solved
I am implementing an app using Stuart Sierra component. As he states in the README :
Having a coherent way to set up and tear down all the state associated
with an application enables rapid de...
Judkins asked 1/11, 2015 at 0:49
4
Solved
Is there a way to destructure input parameters of a function in Scala (akin to Clojure)?
So, instead of
scala> def f(p: (Int, Int)) = p._1
f: (p: (Int, Int))Int
I'd like to have this (it doe...
11
Solved
How would I create a java.util.UUID from a string with no dashes?
"5231b533ba17478798a3f2df37de2aD7" => #uuid "5231b533-ba17-4787-98a3-f2df37de2aD7"
4
Solved
I wrote a small anonymous function to be used with a map call. The function returns a vector containing a column name and column value from a SQL result set query.
Here is the function (input is t...
Ostrogoth asked 7/2, 2011 at 12:57
12
Solved
if my structure is
{ :a :A
:b :B
:c {
:d :D
}
:e {
:f {
:g :G
:h :H
}
}
}
I would like to get a function called keys-in that returns something like:
[[:a] [:b] [:c :d] [:e :f :g] [:e ...
Kieserite asked 14/2, 2014 at 0:51
10
Solved
Most of the top google hits for "calling clojure from java" are outdated and recommend using clojure.lang.RT to compile the source code. Could you help with a clear explanation of how to call Cloju...
Bicarbonate asked 2/2, 2010 at 3:51
3
Solved
I have a JSON file, which contains JSON from Clojure's data.json library. The data came from Twitter where people seem to smile a lot.
$ cat /tmp/myfile | jq .
I get:
parse error: Invalid \uXX...
7
Solved
With Clojure, how do I find the first index with a positive value in this vector [-1 0 3 7 9]?
I know you can get the first result of something rather elegantly with first and filter:
(first (fil...
Hemichordate asked 27/12, 2011 at 4:54
3
Solved
You know how when you hit the up arrow in bash it will fill in the last command you typed in? Is there any way to do this in nrepl?
So far I've been doing a reverse search (C-r), typing the first ...
9
Solved
Is there a way to remove an item from a vector based on index as of now i am using subvec to split the vector and recreate it again. I am looking for the reverse of assoc for vectors?
2
Solved
How do I convert a Java array into a Clojure sequence data structure, such as a list, or other sequence?
This question shows how to do the inverse; The Clojure docs show how to create, mutate, and...
3
Solved
With the following app:
; src/webapp/core.clj
(ns webapp.core
(:require [compojure.core :refer [defroutes GET]]
[ring.middleware.json :as mid-json]
[clj-time.jdbc]))
(defn foo [request]
{:bod...
9
Solved
I'm looking for the best way to conditionally avoid adding an element to a map when it is being initialized/defined. In this case, I want to avoid adding an element to a map if the value for the ke...
Bignonia asked 24/1, 2012 at 19:40
3
Solved
I have a problem with re-find in clojure. Actually I'm doing
(re-find #"-(?<foo>\d+)-(?<bar>\d+)-(?<toto>\d+)-\w{1,4}$"
"http://www.bar.com/f-a-c-a-a3-spok-ser-2-phse-2-1-6-ti-1...
5
Solved
I am writing my first clojure program, and want to read lines from stdin.
When I try this:
(doall (map #(println %) (line-seq *in*)))
I get this exception:
Exception in thread "main" java.lang...
5
Solved
For Java development, I use Slf4j and Logback.
Logger logger = LoggerFactory.getLogger(HelloWorld.class);
logger.debug("Hello world.");
How to use these two libs in Clojure programs? Majority of...
3
Solved
I have tried to understand the difference between Lisp-1 and Lisp-2 and how this relates to Clojure but I still do not understand properly. Can anyone enlighten me?
3
Solved
I understand keywords in Clojure being :keyword. But what is the :: used for? Why does it look like it has a binding?
user=> :foo
:foo
user=> ::foo
:user/foo
Erythroblastosis asked 24/4, 2011 at 14:47
4
Solved
Let's say I have the following data model, for keeping track of the stats of baseball players, teams, and coaches:
data BBTeam = BBTeam { teamname :: String,
manager :: Coach,
players :: [BBPla...
Avent asked 9/9, 2011 at 17:44
6
Solved
I need to log some events on a Clojure Client-Server scenario, but it seems to me that Clojure does not provide a date/time function. Can any one confirm this or I am missing something here?! If I ...
1 Next >
© 2022 - 2024 — McMap. All rights reserved.