Re: debugging "MyClass cannot be cast to MyClass" exceptions

2014-12-06 Thread Ambrose Bonnaire-Sergeant
Perhaps this issue is biting you http://dev.clojure.org/jira/browse/CLJ-979 Thanks, Ambrose On Sat, Dec 6, 2014 at 5:22 PM, Brian Craft wrote: > Yes, I know. ;) In this case it's happening with an uberjar, not with the > repl. I do "java -jar myapp.jar", and later, while it is processing data,

Re: Zelkova: Elm-style FRP for Clojure and ClojureScript

2014-12-06 Thread eric
On Sunday, December 7, 2014 5:37:20 PM UTC+11, James MacAulay wrote: > > Along those lines, I had previously explored using core.async with JS > promises [1] and "async futures" [2]. > Interesting, I think this here goes along the same lines: https://github.com/logaan/promise-stream > I decid

Re: Zelkova: Elm-style FRP for Clojure and ClojureScript

2014-12-06 Thread James MacAulay
What prompted me to write Zelkova? The short answer is curiosity and gut feeling. The long answer: I consider core.async (and CSP in general) to be an excellent low-level abstraction for coordinating concurrency, but I feel like it relies way too much on mutating operations for me to want to us

Re: Zelkova: Elm-style FRP for Clojure and ClojureScript

2014-12-06 Thread Raoul Duke
i guess "big projects" at the bottom of http://elm-lang.org/Examples.elm -- 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 w

Re: atoms, memoize, future-s and CAS

2014-12-06 Thread Andy L
or even better (using future themselves as a "marker" in the atom): (defmacro map-future-swap! [a k f] `(locking ~a (when (not (contains? @~a ~k)) (swap! ~a assoc ~k (future (swap! ~a assoc ~k (~f ~k ) ) ) -- You received this message because you are subscribed t

Re: Zelkova: Elm-style FRP for Clojure and ClojureScript

2014-12-06 Thread eric
Any "real things" that have been achieved that you'd want to highlight? I'd be interested in porting them to Clojure, possibly using Zelkova, as an exercise in FRP coding. On Sunday, December 7, 2014 12:29:19 PM UTC+11, raould wrote: > > > From what I understand it's conceptually not ready for a

For review: Clojure Namespace Isolation

2014-12-06 Thread Ralph Ritoch
Hello, I have created a way to create namespace isolation within clojure. The code is available on github @ https://github.com/rritoch/clojure . What this new code does is it replaces the clojure.lang.Namespace/namespaces static property with a clojure.lang.NamespaceContainer object that is

Re: atoms, memoize, future-s and CAS

2014-12-06 Thread Andy L
> The SoftCache uses a ConcurrentHashMap, but that caching option isn't used > in core.memoize. Are you building a custom memoizer? > > WRT ConcurrentHashMap, it was an incorrect conclusion on my part. In any case, I fail to see "thread safety" in the cache implementation, but again I could be wron

Re: Nightcode problem

2014-12-06 Thread Laurent PETIT
It's probably the DEX creator which is installed in "Program Files .." Le dimanche 7 décembre 2014, Julio Berina a écrit : > Here's all the text associated with my error: > > Running... > Generating manifest... > Generating R.java... > Compiling 1 source files to > C:\Programming\Clojure\Android

Re: atoms, memoize, future-s and CAS

2014-12-06 Thread James Reeves
On 7 December 2014 at 01:13, Andy L wrote: > > Thanks for looking into that. This indeed would solve a "semantics" > problem of memoize, as it returns a value now. However, it seems that > clojure.core.memoize, > or rather clojure.core.cache memoize is based of, is not thread safe. > > It uses C

Re: what do you think about this code?

2014-12-06 Thread David Della Costa
Whoops, re-reading my post I realized that I simply linked to my own gist again when talking about separating out pure from side-effecting code. I meant to link here: https://github.com/philipschwarz/diamond-problem-in-clojure/blob/7efbc472632dced5e173084672ad76687e39dd1f/src/diamond_problem_in_cl

How to look up required arguments for Amazonica?

2014-12-06 Thread Hesen Peng
Hi everybody, I know this question might sound very rudimentary. But I did quite a few digging and couldn't quite find a good answer. Your help is highly appreciated. I'm trying to use a few functions with Amazonica (https://github.com/mcohen01/amazonica), for example, the describe-spot-pric

Re: Zelkova: Elm-style FRP for Clojure and ClojureScript

2014-12-06 Thread Raoul Duke
> From what I understand it's conceptually not ready for anything other > than toy problems yet. Like Elm's restriction on static flow graphs. It's > like programming without 1st class functions, you don't get very far. I am not an Elm user, but I am on the mailing list :-) and I see real things

Re: atoms, memoize, future-s and CAS

2014-12-06 Thread Andy L
> (defn memoized [f] > (comp deref (memoize (fn [& args] (delay (apply f args) > > Thanks for looking into that. This indeed would solve a "semantics" problem of memoize, as it returns a value now. However, it seems that clojure.core.memoize, or rather clojure.core.cache memoize is based of,

Re: Nightcode problem

2014-12-06 Thread Julio Berina
Here's all the text associated with my error: Running... Generating manifest... Generating R.java... Compiling 1 source files to C:\Programming\Clojure\Android\sample\target\debug\classes Compiling Clojure files... Build type: debug, dynamic compilation: enabled, remote REPL: enabled. Compiling n

Open html file in Clojure

2014-12-06 Thread Priyanka Goel
I created a desktop application with Clojure showig different places of the world. I want to include google maps to show the location and to make it more interactive. I wrote down the .html code which works in the web browser and shows the location correctly. I want to use that .html file in my

Re: atoms, memoize, future-s and CAS

2014-12-06 Thread James Reeves
It sounds like you want a delay. Delays are guaranteed to execute their body only once, so we can combine a delay with an atom: (defn memoized [f] (comp deref (memoize (fn [& args] (delay (apply f args) In theory that should produce a memoize that executes the function only once for each se

CFP dev.Objective() 2015 (mid-May, Minneapolis)

2014-12-06 Thread Sean Corfield
(disclaimer: I’m a member of the Steering Committee, posting here to solicit more diversity of topics) dev.Objective() is a language-agnostic (but web-focused) tech conference being held next May 12-15, 2015 at the Radisson Blu in Bloomington, MN. For the last few yea

Re: Nightcode problem

2014-12-06 Thread Laurent PETIT
For this exact reason, I develop CCW with the ccw codebase in a path containing spaces, and my test development environment also contains spaces in it. Saved me numerous numbers of time with Windows Users, for instance. 2014-12-06 23:32 GMT+01:00 Sean Corfield : > Don’t store Nightcode or your pr

Re: Status of lean runtime?

2014-12-06 Thread Andy Fingerhut
As far as people making their own modified versions of Clojure to try these things out, the clojure-android Google group is probably a good place to find out, e.g. this thread: https://groups.google.com/forum/#!topic/clojure-android/dJYfcRHekDw I am not in the loop on Clojure core's precise plans

Re: Status of lean runtime?

2014-12-06 Thread Ken Restivo
Update: I'm already aware of http://dev.clojure.org/display/design/%27Lean%27+Runtime but it hasn't been updated since May, hence, I'm asking if maybe that link is not the best place to look for current information. Also, context: http://www.youtube.com/watch?v=8NUI07y1SlQ Thanks. -ken -- --

Status of lean runtime?

2014-12-06 Thread Ken Restivo
I recall that at CljWest there was a talk regarding lean Clojure JVM runtimes for faster startup on Android and other embedded platforms. During the Q&A Rich endorsed the effort to create one, and to integrate it into Clojure core. I also recall hearing that there might have been a GSoc effort t

Re: Nightcode problem

2014-12-06 Thread Sean Corfield
Don’t store Nightcode or your projects on a path that has spaces in it. A lot of tools don’t support spaces in paths. Sean On Dec 6, 2014, at 12:06 PM, Julio Berina wrote: > I'm trying to do Android development on a Clojure IDE called Nightcode, and > clicked 'Run' in order to simply run the s

Re: debugging "MyClass cannot be cast to MyClass" exceptions

2014-12-06 Thread Brian Craft
Yes, I know. ;) In this case it's happening with an uberjar, not with the repl. I do "java -jar myapp.jar", and later, while it is processing data, get this exception. No repl involved. On Saturday, December 6, 2014 2:02:01 PM UTC-8, juan.facorro wrote: > > Hi Brian, > > This problem usually hap

Re: debugging "MyClass cannot be cast to MyClass" exceptions

2014-12-06 Thread juan.facorro
Hi Brian, This problem usually happens when working on the REPL and you redefine a record or type (derecord and deftype), but there are still some existing instances lying around, that belong to the previous definition of that same type. See this thread for more information: https://groups.g

Re: perform action after events stop for some period

2014-12-06 Thread Juan Martín
Hey Brian, Yes you are absolutely right, my bad, futures *do* run on a thread pool since they use the *clojure.lang.Agent/soloExecutor* created here

atoms, memoize, future-s and CAS

2014-12-06 Thread Andy L
Hi, Here is the situation. There is a function "f" retrieving some data from various sources (including reading files, a lot of io, e.g. map-reduce) expected by design to return the same result for given input. Results of "f" invocation from parallely running futures are stored in an atom wrapped

Re: perform action after events stop for some period

2014-12-06 Thread Brian Craft
I'm confused on the thread issue. Don't futures run from the agent thread pool? So they don't really create a thread? Also found climatecorp's claypoole library, which has a 'future' call that works with a thread pool, further confusing me. Not sure how that's different from the agent thread po

Re: perform action after events stop for some period

2014-12-06 Thread juan.facorro
Hi Brian, I had the same requirement while building an application, it included a GUI and I wanted to perform some actions only after the user was done editing some text. I also first implemented a solution using an atom, Thread/sleep and a future. It didn't seem right though, since I was creat

Re: Nightcode problem

2014-12-06 Thread Fluid Dynamics
On Saturday, December 6, 2014 3:06:53 PM UTC-5, Julio Berina wrote: > > I'm trying to do Android development on a Clojure IDE called Nightcode, > and clicked 'Run' in order to simply run the sample application and see if > my compiler works. I get this error along the way: > > 'C:\Program' is no

debugging "MyClass cannot be cast to MyClass" exceptions

2014-12-06 Thread Brian Craft
I'm experimenting with jwrapper, and am getting runtime exceptions like this, due to some jar manipulation that it's doing. I know one of the steps is pack200, however running pack200 manually doesn't create these issues. Anyone have suggestions for debugging this? I've seen this type of error

Nightcode problem

2014-12-06 Thread Julio Berina
I'm trying to do Android development on a Clojure IDE called Nightcode, and clicked 'Run' in order to simply run the sample application and see if my compiler works. I get this error along the way: 'C:\Program' is not recognized as an internal or external command, operable program or batch file

Re: Need advice on algorithm performance

2014-12-06 Thread juan.facorro
Hi Dmitriy, There's also an alternative zipper implementation called *fast-zip* [1] which seems to be 5 times faster than *clojure.zip*. Although if *clojure.walk* is faster in an order of magnitude or more than *clojure.zip*, then *fast-zip* won't be much of an improvement. Cheers, Juan [1]

Re: Server Sent Events under Http-Kit

2014-12-06 Thread Colin Yates
Have you looked at sente? On Saturday, 6 December 2014 17:03:41 UTC, Lars Ole Avery Simonsen wrote: > > Hi guys > > I am trying to implement Server Sent Event support in a small hobby > project based on the http-kit server framework and compojure. > > I am still quite new to clojure in general, s

Re: what do you think about this code?

2014-12-06 Thread Colin Yates
Excellent question and I will be watching this thread with interest. Similar to David Della Costa, I find a bit difference between Clojure and Java for example is that there is much less naming-of-concepts. Clojure code tends to be much more about the shape of transformations than the semantics

Server Sent Events under Http-Kit

2014-12-06 Thread Lars Ole Avery Simonsen
Hi guys I am trying to implement Server Sent Event support in a small hobby project based on the http-kit server framework and compojure. I am still quite new to clojure in general, so it may very well be that I am missing something obvious, but this SSE detail has me stumped. What I have trie

[ANN] letterpress: locally-configurable Clojure data printers

2014-12-06 Thread Marshall Bockrath-Vandegrift
Clojure's tagged literals and `clojure.edn` namespace functions allow hyper-local (per call) specification of tagged-literal data readers during deserialization. The letterpress library provides a similar capability for printing, allowing per-call specification of print methods and general rec

Re: what do you think about this code?

2014-12-06 Thread David Della Costa
Hi Philip, I read your message and immediately wanted to try it myself--I intended to leave it at that but I realized I would be remiss if I did not give you a little bit of feedback based on my experience. I should add that I was kind of fast and loose with my solution (that is, I didn't really

Re: Zelkova: Elm-style FRP for Clojure and ClojureScript

2014-12-06 Thread eric
Hi, May I ask what prompted you to write this? A coding exercise or some real-world need? I'm asking because I've been keeping an eye on FRP for a while. From what I understand it's conceptually not ready for anything other than toy problems yet. Like Elm's restriction on static flow graphs. I

what do you think about this code?

2014-12-06 Thread Philip Schwarz
Hello, can you please review my first solution to the diamond kata [1] and tear it to bits: let me know all the ways in which YOU would improve the code. I am not so interested in a better algorithm for solving the kata. I am learning Clojure and what I want to know is what YOU would do to make

Re: ANN: ClojureScript 0.0-2411

2014-12-06 Thread David Nolen
That's an issue with core.async. Make sure you have the latest. If you do, please file an issue for core.async. On Friday, December 5, 2014, David James wrote: > I'm getting the following warnings from `lein cljsbuild auto`. Anybody > else? > > WARNING: Use of undeclared Var cljs.core.async/do-a