Skip to main content

Questions tagged [clojure]

Clojure is a general-purpose language supporting interactive development that encourages a functional programming style, and simplifies multithreaded programming.

-3 votes
2 answers
159 views

Let's say, that we keep track of students entering the auditorium using their IDs(Key) and their check-in time(Value) in a Map. We delete the entries once they move out of the auditorium. I want to ...
Vicky's user avatar
  • 399
0 votes
1 answer
119 views

I have the following pair of functions used for searching upwards for a configuration file: (defn has-config? [path] contains? (set (.list path)) "my-config") (defn find-config-path [path] (cond ...
pob's user avatar
  • 119
-2 votes
1 answer
506 views

I am planning to improve my knowledge of Clojure and algorithms at the same time by implementing some known data structures in Clojure (e.g. linked lists, skip lists, bloom filter, etc.). However, I ...
Attilio's user avatar
  • 487
1 vote
0 answers
87 views

Using Functional language, How can 2 different parties achieve the result of increment/decrement operations concurrently? For the below scenario, Let's say, I've 2 quantities in stock and 2 users in ...
Vicky's user avatar
  • 399
1 vote
2 answers
921 views

Using Functional language, How can 2 different parties achieve the result of increment/decrement operations concurrently? For the below scenario, Let's say, I've 2 quantities in stock and 2 users in ...
Vicky's user avatar
  • 399
37 votes
7 answers
9k views

Let's say, I've the below logic. How to write that in Functional Programming? public int doSomeCalc(int[] array) { int answer = 0; if(array!=null) { for(...
Vicky's user avatar
  • 399
2 votes
3 answers
969 views

This older question tells us that in functional programming "true" randomness cannot be achieved since in FP functions are pure/idempotent and return the same value irrespective of number of ...
Vicky's user avatar
  • 399
3 votes
2 answers
309 views

I am designing a library to wrap an API with Clojure. The API requires user credentials to authenticate user related calls. My first approach was to have functions that do each task the API can do: (...
Moon Cheesez's user avatar
3 votes
1 answer
209 views

I am designing a DSL (in clojure, specifically; though this question is more general than that) in which 'entities' are tracked as immutable hashes/maps, and where the 'concept' membership of an ...
nben's user avatar
  • 345
3 votes
0 answers
441 views

I was reading the post A Modern Architecture for FP that included a code snippet that the author wanted to decompose further. I don't know Haskell but I recognize enough to know that I've written many ...
MonkeyWithDarts's user avatar
12 votes
1 answer
2k views

I've heard that Clojure macros are easier to write but not as reliable as Racket's hygienic macros. My question has 2 parts: How does gensym differ from hygienic macros? What do Racket macros provide ...
Alex's user avatar
  • 284
14 votes
3 answers
6k views

Trying to learn Clojure and you can't help but be told continually how Clojure is all about immutable data. But you can easily redefine a variable by using def right? I get that Clojure developers ...
Evan Zamir's user avatar
2 votes
0 answers
390 views

I'm in the process of making a simple game using re-frame (and thus react and reagent), but I'm stuck at one point. In https://github.com/Day8/re-frame#control-via-fsm they claim Not every app ...
NiklasJ's user avatar
  • 675
3 votes
1 answer
195 views

I am making a neural network in Clojure that can take an array of integers,and return a data structure representing the layers of a neural network: so (make-layers [1 4 5]) would evaluate to: [[0] ...
kurofune's user avatar
  • 290
1 vote
1 answer
222 views

I am new to Clojure and trying to get a handle on organizing a project's namespaces. I am working on a solver for the knapsack problem. Currently, I have broken the modules into files, but everything ...
ben rudgers's user avatar

15 30 50 per page
1
2 3 4 5
7