Questions tagged [clojurescript]
ClojureScript is a dialect of Clojure that compiles to JavaScript.
13 questions
2
votes
1
answer
165
views
Invert bits of a number in clojurescript
Doing a challenge to print the number that you would get if you convert a given number to binary, invert its bits, then convert back to decimal.
I decided to give it a run in clojurescript (which I ...
2
votes
1
answer
72
views
Table of employee with end of mission visual clue
to learn Reagent, re-frame and spec I made a little personal project.
Description:
Given a ...
3
votes
1
answer
91
views
Langton's ant in Clojurescript
The weekly coding challenge in Eric Normand's newsletter this week involves implementing Langton's ant.
I wanted something on my screen so I put together a simple re-frame app. The core functions ...
4
votes
2
answers
169
views
Extract indices of visible nodes in a tree where only some nodes are expanded
A program that I work on constantly updates and modifies program state containing an arbitrarily deep and wide tree. The data looks something like this.
...
4
votes
1
answer
99
views
n-puzzle in Clojurescript
I'm in the process of creating a n-puzzle solver in Clojurescript. I have the basic model up and running and can move tiles on the screen. I plan to implement A* or such an algorithm to solve a given ...
0
votes
1
answer
296
views
Drawing circles with the mouse using Quil+Clojure
I've recently begun using Clojure, and I wanted to translate a project that I wrote with p5.js to us Clojure and quil. Unfortunately, the code resulting from a direct translation is bad enough to make ...
2
votes
2
answers
483
views
Filtering a data structure using regex predicates
Assume we have a data-structure like this:
...
4
votes
3
answers
380
views
Generate a deck of cards in Clojure / Clojurescript
I would like to generate a deck of cards:
{:card-id 1 :suit :spade :rank 1}
{:card-id 2 :suit :spade :rank 2}
...
{:card-id 52 :suit :club :rank 13}
And here is ...
5
votes
3
answers
414
views
Haversine Formula in Clojure
I implemented the Haversine formula to calculate the distance between two (latitude, longitude) coordinates.
I was wondering if it looks natural to Clojure programmers. What could be improved?
...
1
vote
1
answer
77
views
Nesting elements in a shallow hierarchy
I wrote some code to generate list items for a menu in Clojurescript. The intention is that the code takes parsed Markdown (Hiccup) that has been filtered down to h2...
2
votes
0
answers
117
views
Handling async in Clojure
I've defined myself a function for caching requests and their responses in a browser environment; I'm using ClojureScript.
...
1
vote
2
answers
3k
views
Formatting a date in ClojureScript
I want to convert strings with the iso date format (2015-08-02) to the default format of our app (2 Aug 2015) in ClojureScript. ...
1
vote
1
answer
502
views
Simple POST function in ClojureScript and Node.js
Node's HTTP library provides a handy shorthand function for GET requests. Something similar doesn't exist for POST requests. I'm trying to write one in ClojureScript that compiles to node-readable ...