Questions tagged [clojurescript]

ClojureScript is a dialect of Clojure that compiles to JavaScript.

Filter by
Sorted by
Tagged with
2
votes
1answer
17 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
1answer
43 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 ...
4
votes
1answer
45 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
2answers
77 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. ...
3
votes
1answer
58 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 ...
1
vote
0answers
135 views

Prototype of an idle game (very early, but you can try it)

I am currently fiddling with ClojureScript and Reagent, and I'm trying my hands at an Idle game. I'm somewhat familiar with FP, and pretty new to Clojure/ClojureScript and Reagent/React. I'd like a ...
1
vote
0answers
22 views

Retrieve compilation files of smart contracts asynchronously via Ajax and add to database

I need to retrieve two files that are labeled :abi and :bin from a server. I then want to add these files to a database in a ...
0
votes
1answer
136 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 ...
1
vote
0answers
159 views

Transforming between hiccup and enlive/clojure.xml data structures using spec

I've made functions that transform hiccup <-> enlive Example: [:div [:p {:class "foo"} "bar"]] <-> ...
1
vote
0answers
51 views

Point utilities in ClojureScript and Reagent

As one of my first "real" projects in Clojure(Script), I took one of the programming exercises from my Algebra II textbooks. The goal is to receive two 2D coordinates from the user and calculate the ...
2
votes
2answers
251 views

Filtering a data structure using regex predicates

Assume we have a data-structure like this: ...
2
votes
3answers
163 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
3answers
137 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
1answer
44 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
0answers
94 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
2answers
1k 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
1answer
349 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 ...