Questions tagged [cljx]

cljx is a Leiningen plugin and nREPL middleware that produces Clojure and ClojureScript code from a single annotated codebase.

cljx is a Leiningen plugin and nREPL middleware that produces Clojure and ClojureScript code from a single annotated codebase.

6 questions
33
votes
1 answer

Is it possible to use :refer :all in a ClojureScript :require?

I'm just trying out ClojureScript, starting out by converting something I wrote in Clojure into cljx. When I try to compile it I get: clojure.lang.ExceptionInfo: :refer must be followed by a sequence of symbols in :require I'm finding some oblique…
interstar
  • 26,048
  • 36
  • 112
  • 180
9
votes
2 answers

Clojure / ClojureScript Crossovers and cljx

I'm trying to figure out the relationship between ClojureScript crossovers and the cljx pre-processor. Are they designed to be used together? Or rival solutions to the same problem? Is one becoming the preferred or more standard way to do things? In…
interstar
  • 26,048
  • 36
  • 112
  • 180
4
votes
2 answers

Is there any support for RPC in ClojureScript?

I have a ClojureScript application and I want to make RPC calls to the server which would look like normal function core.async calls on the client side. In order to do this for the moment I wrote the code below based on cljx. In the RPC definitions…
vidi
  • 2,056
  • 16
  • 34
3
votes
2 answers

Target-dependent macros with cljx

Problem Description I have a project that targets both Clojure (JVM) and ClojureScript via CLJX. I have a macro that takes a thunk and creates an IDeref instance to execute that thunk every time it is dereferenced (with deref or @). Since it's a…
DaoWen
  • 32,589
  • 6
  • 74
  • 101
1
vote
0 answers

How do I get cljx to compile clojure files into classes during uberjar?

I'm using cljx to build cli / cljs applications but haven't for the life of me been able to create a self packaged compiled jar. Here's my project file -> https://gist.github.com/chrispwood/4db33e53555a8e8787d1 When I run lein jar or lein uberjar I…
chris.wood
  • 253
  • 2
  • 10
1
vote
1 answer

Using Clojure macros with cljx

I have a code-base for a graphics program in cljx that gets compiled to Clojure and ClojureScript. I now want to introduce my first macro. (defmacro optional-styled-primitive [args body] (let [extra (conj args 'style)] `(fn (~extra…
interstar
  • 26,048
  • 36
  • 112
  • 180