Re: Simulations in Clojure/Clojurescript

2018-01-27 Thread Tiago Antão
Hi, Have a look at Vega and Vega lite for visualization... Amazing chart library On Jan 27, 2018 11:48 AM, "Michael Nardell" wrote: > Tiago ::Thanks, for your input. Worth more considerably more than $00.02 > for me right now. Since the last week or so, I have been diving into > ClojureScript.

Re: Simulations in Clojure/Clojurescript

2018-01-15 Thread Tiago Antão
My $0.02, I was a very early Clojure adopter, but I stopped using it when Oracle bought Sun (I left the JVM completely at that time). I am currently using ClojureScript a lot - for the last 6 months or so, thus not the most experienced programmer. Most of my usage is doing scientific simulations

Re: Consistency of the API

2009-11-09 Thread Tiago Antão
On Mon, Nov 9, 2009 at 10:20 PM, John Harrop wrote: > It seems to treat strings as it does vectors, seeing if an index is in > bounds or not. It doesn't treat symbols as anything though. > The clojure.contrib.seq-utils/includes? function gives true for "foo" and I did not want to make this a di

Re: Consistency of the API

2009-11-09 Thread Tiago Antão
On Mon, Nov 9, 2009 at 8:31 PM, Mark Engelberg wrote: > I imagine the rationale is efficiency.  Every core function could > conceivably do a number of runtime checks to make sure that each input > is the right kind of type, and then Clojure might feel more sluggish. > So instead, the core functio

Re: Consistency of the API

2009-11-09 Thread Tiago Antão
On Mon, Nov 9, 2009 at 8:08 PM, Kevin Downey wrote: > > I don't understand, the error message you get is the error that occurred. Both of them honor their documentation - no doubt. My point is not that, my point is that the behavior is different between the 2 functions for the same kind of issue

Consistency of the API

2009-11-09 Thread Tiago Antão
Hi all, Just a question about the consistency of the API: When one passes a "strange" (ie, wrong type) object to contains?, say (contains? 'blab 'a) the result is a false. But if one passes the wrong type to, e.g., even?, like (even? 'a) The result is: java.lang.ClassCastException: clojure.lang.

Re: Constructing Java Interop calls

2009-10-30 Thread Tiago Antão
On Thu, Oct 29, 2009 at 1:38 PM, Meikel Brandmeyer wrote: >> All good here, but, if I do the eval variation, >> user=> (eval (list (symbol ".setFileSelectionMode") jfc 1)) > > Another example which shows that eval is not worth the trouble. It is > better to use reflection. You cannot embed the JF

Re: Constructing Java Interop calls

2009-10-29 Thread Tiago Antão
On Thu, Oct 29, 2009 at 2:15 AM, Alex Osborne wrote: > > Using eval (which will also work for dynamically calling Clojure functions): > >   (let [obj "some string" >         fname ".substring"] >     (eval (list (symbol fname) obj 2))) Thanks a lot. I was trying to avoid reflection (ie, looking

Re: Constructing Java Interop calls

2009-10-28 Thread Tiago Antão
On Wed, Oct 28, 2009 at 7:34 PM, Wilson MacGyver wrote: > > Is there a reason you don't want to use doto? > > http://clojure.org/java_interop#toc15 > > ie (doto Bla (.setProperty "x" 1)) I really want to do something different: (def x (new StringBuffer "")) (doto x (.setLength 2)) But my p

Constructing Java Interop calls

2009-10-28 Thread Tiago Antão
Hi, Sorry for the newbie question, but I am trying to understand how to construct and call java dynamically from clojure. As an example, imagine that there is a bean property called "Bla" and one wants to set Bla to 1 on object x, which has that property. So, the objective would be to construct,