On 03/09/2015 15:45, Juvenn Woo wrote:
> Hi all,
>
> I am writing a function that'll take a java class name as an arg,
> wherein I'll make instance of the class. Several approaches did I try:
>
> (let [klass Integer] (new klass 42)) ; this raises exception "unable to
> resolve symbol: klass"
>
>
Hi,
I would like to announce from-scala, an experimental Scala interop
library for Clojure.
Its main feature is the $-macro, a version of Clojure's
.-form. The $-macro uses Java reflection and a series of heuristics,
so that you will be able to write code like
($ ($ scala.collection.immutable
> then the error is on the (schema.core/defn) call. But notice the fully
> qualified 'create' - I want 'create' to be a literal in the namespace of
> the caller, not the namespace the macro is defined in.
>
> Any ideas?
Quote-unquote the symbol: ~'create
Example:
`(defn create []) => (clojure
In judge try changing
(let [out async/chan] ...)
to
(let [out (async/chan)] ...)
On Wednesday, July 9, 2014 5:57:53 AM UTC+2, endbegin wrote:
>
> Just tried it with Clojure 1.6.0. Still no luck!
>>
>
--
You received this message because you are subscribed to the Google
Groups "Clojure"
That `lein midje` runs your expectations is just a side effect of
expectations' behavior to run its tests on JVM shutdown. Use
`(expectations/disable-run-on-shutdown)` to disable that feature.
> Just need to confirm that the behaviour is intentional and not just by
chance.
I guess it's a lit
Hi,
you need to syntax-quote the list you return from your macro.
(defmacro some-record
[some-name]
`(defrecord ~some-name ['in 'out]))
Note the backtick `. You then also have to explicitly quote your record
field names (see 'in and 'out, try to remove the quotes to see why).
Also s
Using map and sets:
(defn days-number-maker
[all-days day-string]
(let [day-set (set day-string)]
(map (fn [day]
(if (day-set day)
1
0))
all-days)))
(defn days-to-numbers
"Change string like MTTH to (1 1 0 1 0 0 0)"
[day-string]
(let [d
I hope I understood you correctly. You basically don't want to use
println if you want to print data in such a way that it can be read in
again. For that you need to use pr, prn or pr-str.
Example:
(println {:a "hi there"}) will print {:a hi there}
(prn {:a "hi there"}) will print {:a "hi the
java.util.TimerTask is an abstract class, which you cannot instantiate
directly. You can use proxy to create a subclass:
(proxy [java.util.TimerTask] []
(run [] ...))
Instead of (new java.lang.Boolean ...) use true or false directly.
There is syntactic sugar for new, just append a dot to the
Yes, you can tag your facts, and then only run the facts with a specific
tag.
See https://github.com/marick/Midje/wiki/Lein-midje under the :filter
section.
--
You received this message because you are subscribed to the Google
Groups "Clojure" group.
To post to this group, send email to clojure
I've changed the Leiningen installer, so that it uses wget instead of
curl. That should fix the problems you were having. I've only only
tested this on my Windows 7 VM, so please try it out.
Download it here: https://github.com/t6/leiningen-win-installer/releases
--
You received this message b
On 12/31/2014 18:56, rogergl wrote:
> To make this work I had to replace the symbol 'topic in the body with
> the gensym symbol. Is this the right way to do this ?
Your macro is too complicated. You don't need to gensym a symbol in this
case. Instead just quote a symbol before unquoting it (note
Move membero to the beginning (just after fresh, like in succo), it runs
in < 100 ms on my machine then.
--
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 ar
I have just uploaded some code I wrote earlier this year, where I
originally set out to generate some useful docstrings for Java classes and
methods.
It currently uses javadoc on all Java source files on the classpath and
creates a map with the extracted information. I never finished it, but
thi
14 matches
Mail list logo