Questions tagged [clojure]
Clojure is a general-purpose language supporting interactive development that encourages a functional programming style, and simplifies multithreaded programming.
91 questions
-3 votes
2 answers
157 views
How can we handle inserts/delete cases using Map like data structures in FP?
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 ...
-2 votes
1 answer
505 views
Is Clojure a wrong choice for implementing Data Structures?
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 ...
1 vote
2 answers
921 views
How Functional Programming addresses concurrent increment/decrement operations invoked by different users?
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 ...
2 votes
3 answers
968 views
Can functional programming used for solving problems which require randomness?
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 ...
3 votes
1 answer
208 views
Efficient algorithm for deducing object type dynamically based on members
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 ...
12 votes
1 answer
2k views
What practical problem results from lack of hygienic macros in Clojure?
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 ...
2 votes
0 answers
390 views
Implement FSM explicitly in re-frame/reagent/react?
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 ...
1 vote
1 answer
222 views
Clojure NameSpace Design
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 ...