The JavaFX workaround consist of creating a javafx.embed.swing.JFXPanel
statically in a namespace that is loaded before any other namespace that
import problematic JavaFX classes as in [1,2].
This initializes the JavaFX platform.
[1]
https://github.com/halgari/fn-fx/blob/master/src/fn_fx/render
Following the convention not to use `def` in non-top-level positions, you
should use `intern` instead of `def`.
--
You received this message because you are subscribed to the Google
Groups "Clojure" group.
To post to this group, send email to clojure@googlegroups.com
Note that posts from new mem
I spot the following problems in your code with respect to primitive
functions:
1. You declare functions (ModAdd, ...) with primitive arguments but without
primitive return values. So you get boxing on the return values.
2. You pass those primtive functions as argument to EulerPowNonMemoized,
In Java 7 you would use ThreadLocalRandom you said in another thread. Well,
in Java 6 you already have ThreadLocal [1] and thus you are able to build a
thread local Random yourself to keep Java 6 as minimum requirement.
[1]
http://docs.oracle.com/javase/6/docs/api/index.html?java/lang/ThreadLoc
Once you notice that you usually need a fast solution. The easiest solution
is to just pass around an instance of java.util.Random which you create
with the desired seed. Another options is to have a constructor function
returning a "rand" function.
(defn prng [seed]
(let [rnd (java.util.Rand
Program B will be released as source. So in this case I can choose the
license of program B independently since it is no "derivative work" of
library G? As far as I read a hint that program B is not "derivative work"
of library G is that I could exchange library G with a different library
which
I have written a Clojure library A which is licensed under Eclipse Public
License (EPL) as usual which depends on other Clojure libraries with EPL
license.
In a different program B I use library A and another library G which is
licensed under GPLv3.
Now, the question arises which license I am a
`def` does not handle `:macro true` metadata on the provided symbol. But
you can work around that like clojure.core does, e.g. for the macro
`defmacro` after the `(def ... defmacro ...)` call the following is called:
`(. (var defmacro) (setMacro))`
--
--
You received this message because you
You can also checkout whether my library [1] suits you. Passing option maps
to other functions with options and managing doc strings for these options
(transitively) are the features it was written for. It will simplify
functions with options in your own code but the calls to functions of third
You might be interested in https://github.com/guv/clojure.options/
--
--
You received this message because you are subscribed to the Google
Groups "Clojure" group.
To post to this group, send email to clojure@googlegroups.com
Note that posts from new members are moderated - please be patient wit
It is not broken. It fulfills the discussed goal of having independent
parallel calls in a "let"-like macro. Thus the name plet.
Using a previous binding in another binding of plet was no goal. Therefore
you can use the normal "let" macro.
In a library one should add the intention to use it onl
Some time ago I dug into primitive type hints and how the Clojure compiler
uses them.
When the compiler finds primitive type hints on a function, say (defn f
[^long n] ...), the generated class for that function implements a
primitive interface, IFn$LO in this case,
and generates appropriate cod
I wanted to point you to the developer instructions over here:
http://code.google.com/p/counterclockwise/wiki/HowToBuild
But apparently they changed 4 days ago. The previous description there
worked for me.
Try the new description there and if it fails, report an issue on that
google code proje
You can checkout clojure.options (https://github.com/guv/clojure.options/).
One of its main features is documentation for options (even transitive ones
in calls to other functions with options).
--
--
You received this message because you are subscribed to the Google
Groups "Clojure" group.
To
Of course. You are right. I did forget about the long constant.
I hope your patch will be included in Clojure 1.5.
--
You received this message because you are subscribed to the Google
Groups "Clojure" group.
To post to this group, send email to clojure@googlegroups.com
Note that posts from new m
I think Cristophe is on the right path. But it is possible that there is
another Bug concerning primitive functions.
Consider the following two functions:
(defn fib ^long [^long n]
(if (<= n 1) 1 (+ (fib (dec n)) (fib (- n 2)
(defn fib2 ^double [^double n]
(if (<= n 1) 1 (+ (fib2 (dec n)
I can add some additional information. I compiled the fibonacci example
with double and long type hints:
(defn fib ^long [^long n]
(if (<= n 1) 1 (+ (fib (dec n)) (fib (- n 2)
(defn fib ^double [^double n]
(if (<= n 1) 1 (+ (fib (dec n)) (fib (- n 2)
The one with ^long works as expe
I have written a primitive function for exponentiation with integers as
power using the multiply-and-square algorithm.
For performance reasons I used primitive type hints for the arguments and
the return value.
Profiling the whole application I noticed that there are a lot of
java.lang.Double/va
In case you are primarily interested in clojure functions with keyword
arguments (or "optional arguments"), you might check if clojure.options
(https://github.com/guv/clojure.options/) suits you.
--
You received this message because you are subscribed to the Google
Groups "Clojure" group.
To po
Hello David.
I have a very similar scenario according to named parameters liker you.
Therefore I have written the library clojure.options which can be found
here:
https://github.com/guv/clojure.options
The latest version is also on clojars.
Greetings,
Gunnar
--
You received this message becaus
My first try to get JPPF to work from REPL is changing the
ContextClassLoader to an implementation derived from
clojure.lang.DynamicClassLoader which caches the class bytes on definition.
That did not work so far. Sometimes (.setContextClassLoader
(Thread/currentThread) cacheClassLoader) does no
JPPF is a Java framework to perform distributed execution of computation
jobs.
In my experiment to use JPPF (http://www.jppf.org) in Clojure I noticed a
class loading problem.
A JPPFTask implemenation created via 'proxy could not be loaded by the JPPF
framework.
As a result I got the following C
22 matches
Mail list logo