I am new with Functional Programmin and Clojure, so I am not really sure
about what to do.
Instead of connecting to a database, can I do this?
1 - define initial data, like a matrix of Refs
1 - generate random operations to execute: [ random-account-source-id(0,
N_MAX) , random-account-destinat
Hi guys, I am wondering why this does not work:
(.containsKey {:one 1} :one)
;=> ClassCastException clojure.lang.PersistentArrayMap cannot be cast to
clojure.lang.PersistentHashMap
The map is a:
(class {:one 1})
;=> clojure.lang.PersistentArrayMap
And a PersistentArrayMap does have a containsKe
not sure why, but this works:
user=> (.containsKey ^clojure.lang.Associative {:one 1} :one)
true
2012/3/3 Alf Kristian Støyle
> Hi guys, I am wondering why this does not work:
>
> (.containsKey {:one 1} :one)
> ;=> ClassCastException clojure.lang.PersistentArrayMap cannot be cast to
> clojure.
Looks like the type inferencer inserts a cast to PersistentHashMap,
where it should only cast to clojure.lang.Associative (the interface
on which .containsKey is defined).
Also, the type inferencer picks up the wrong type from the literal,
but that wouldn't matter, if it would always cast to the mo
Also keep in mind, that in (.something obj), the compiler doesn't see a
call to .method, but the whole thing is desugared into a call to the dot
form: (. obj something). Since . is a special form, it is always defined.
So when trying to analyze a call to the dot special form, keep in mind that
the
Is this a reader bug?
;user=> *clojure-version*
{:major 1, :minor 4, :incremental 0, :qualifier "alpha5"}
;user=> (.getProtocol
#java.net.URL["file:/home/hara/dj/usr/src/clojurescript/src/cljs/cljs/core.cljs"])
MalformedURLException no protocol:
/home/hara/dj/usr/src/clojurescript/src/cljs/cljs/
Any advice?
--
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 with your
first post.
To unsubscribe from this group, send em
Tim Cross writes:
> My guess is that lein run does something different wrt *in*, but I've
> no idea what and cannot find anything obvious in the docs.
Try using "lein trampoline run" to get around the subprocess issues with stdin.
-Phil
--
You received this message because you are subscribed
I noticed in clojurescript/src/clj/cljs/closure.clj that the function build
calls -compile and binds the return value to compiled. compiled is then
checked if it is a collection, and if not, wraps it in a []. The problem is
sometimes compiled is a hash-map, and this counts as a collection. In my
I'm not sure what it is, but here is another transcript that may provide
additional clues, and with a slightly later version of Clojure:
user=> (clojure-version)
"1.4.0-beta1"
user=> (def x
#java.net.URL["file:/home/hara/dj/usr/src/clojurescript/src/cljs/cljs/core.cljs"])
#'user/x
user=> x
#
use
And another transcript that might help narrow this down:
user=> (clojure-version)
"1.4.0-beta1"
user=> (def x
#java.net.URL["file:///home/hara/dj/usr/src/clojurescript/src/cljs/cljs/core.cljs"])
#'user/x
user=> (printf "(class x)=%s x='%s'\n" (class x) x)
(class x)=class java.net.URL
x='file:/ho
I'm a vim guy. :P Maybe I could work on a port for vim or something.
I've never written a vim plugin though.
On Mar 2, 5:04 pm, Moritz Ulrich wrote:
> I might have something for you. It's a small personal (and currently
> unpublished) project involving Emacs, Clojure and ClojureScript. It
> isn't
Frinj is a practical unit-of-measure calculator DSL for Clojure.
Key features;
* Tracks units of measure through all calculations allowing you to mix
units of measure transparently
* Comes with a HUGE database of units and conversion factors
* Inspired by the Frink project (http://futureboy.us/fr
Hi Phil,
thanks, lein trampoline run seems to get around the problem.
BTW, spotted a minor error in the .lein/bin/swank-clojure script. The
CLASSPATH setting at the top of the script appears to have a hard coded
path instead of one based on $HOME. For example, after installing the swank
plugi
If I understand Clojure's dynamic vars correctly, in a context where some
var *bar* is already thread-bound, the following code:
(binding [*bar* new-val]
(foo))
is semantically equivalent to:
(let [old-val *bar*]
(set! *bar* new-val)
(try
(foo)
(finally
(set! *bar* ol
On Sat, Mar 3, 2012 at 12:47 PM, Antonio Recio wrote:
> Any advice?
>
This is an odd library. My first shot would be to try something like:
(def myCallback
(fn []
(let [t (vtkTransform.)]
(.GetTransform t)
(-> boxWidget .GetProp3D (.SetUserTransform t)
; A
16 matches
Mail list logo