Re: docstrings of if-let and when-let incorrect

2012-05-15 Thread Aaron Cohen
Does the principle of least surprise suggest that multiple bindings be combined with AND or OR? --Aaron On Tue, May 15, 2012 at 3:09 PM, Hubert Iwaniuk neo...@kungfoo.pl wrote: I tried using if-let with multiple binding in past as well. Following least surprise principle, I would like to see

Re: why can i not shut-down my pc from Java?

2012-05-07 Thread Aaron Cohen
On Mon, May 7, 2012 at 11:08 AM, Jim - FooBar(); jimpil1...@gmail.comwrote: Hello everyone, I was just messing about with the following function and cannot figure out why it won't work... I know that the command I'm passing to the runtime object is a valid unix command...i can execute it on

Re: why can i not shut-down my pc from Java?

2012-05-07 Thread Aaron Cohen
On Mon, May 7, 2012 at 4:53 PM, Jim - FooBar(); jimpil1...@gmail.comwrote: Following my earlier post, i tried converting the working shutdown function into a multi-method in order to make it cleaner to read... However for some reason the compiler is complaining and i can't pinpoint wheere

Re: why can i not shut-down my pc from Java?

2012-05-07 Thread Aaron Cohen
On Monday, May 7, 2012, Jim - FooBar(); wrote: On 07/05/12 21:59, Aaron Cohen wrote: You invoke your multimethod with 2 arguments. You need to change your dispatch function to take 2 arguments (it can ignore them if you don't need them). Thanks Aaron - it did the trick! I did not realize

Re: clojure call dom4j has a problem

2012-05-06 Thread Aaron Cohen
On Sun, May 6, 2012 at 8:36 AM, 周尧 zysu...@gmail.com wrote: why call DocumentHelper.createDocument(string name) error? According to http://dom4j.sourceforge.net/dom4j-1.6.1/apidocs/, there is no such overload. I have no idea what you're wanting to do, but maybe:

Re: infix-to-prefix macro dead-end!!!

2012-05-02 Thread Aaron Cohen
On Wed, May 2, 2012 at 4:24 PM, Jim - FooBar(); jimpil1...@gmail.comwrote: Hey everyone, I've been trying all morning (more than 3 hours) to improve my macro but with little success...basically what I had before i started fiddling with it was a macro which would take an expression of the

Re: Supporting platform specific code

2012-04-12 Thread Aaron Cohen
On Thu, Apr 12, 2012 at 11:31 PM, Dave Sann daves...@gmail.com wrote: -1 for metadata +1 for file extensions or paths. I don't think metadata or in-file conditional compilation is the right tool for this. My reasons are as follows 1. I don't think it is a good idea to mix multi-platform

Re: How come (`+ 1 2) = 2 ???

2012-04-09 Thread Aaron Cohen
On Mon, Apr 9, 2012 at 7:54 AM, Jim - FooBar(); jimpil1...@gmail.comwrote: Hello everyone... Can somebody please provide some insight as to why (`+ 1 2) = 2 and ('+ 1 2) = 2 ??? Thanks in advance... Jim ps. I understand that symbols are functions that look themselves up in sequences

Re: How come (`+ 1 2) = 2 ???

2012-04-09 Thread Aaron Cohen
On Mon, Apr 9, 2012 at 5:24 PM, Stuart Sierra the.stuart.sie...@gmail.comwrote: This is an undocumented feature for symbols, I think. I wouldn't rely on it too much. -S I don't really like this feature, I wish the not-found version of invoke was only available by explicitly calling get. It

Re: Boolean

2012-04-07 Thread Aaron Cohen
I'm afraid you've managed to convey your emotion, but not what the actual problem you're having is. Care to try that again? --Aaron -- 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

Re: Boolean

2012-04-07 Thread Aaron Cohen
On Sat, Apr 7, 2012 at 11:41 AM, Steven Obua ste...@obua.de wrote: --(defrecord M-Node [leaf content]) (def n (M-Node. false )) (if (:leaf n) boom ok) ;; returns ok

Re: blip clojure videos from roku

2012-04-06 Thread Aaron Cohen
Is your roku able to play video from the rss feed at http://blip.tv/clojure/rss ? On Thu, Apr 5, 2012 at 7:16 PM, Terrance Davis terrance.da...@gmail.comwrote: I love the videos up at blip.tv/clojure. Is there anyway to watch these episodes from my roku? I already explored every option I

Re: Google Summer of Code 2012 Application

2012-04-05 Thread Aaron Cohen
This looks _much_ better, Raphael. My next suggestion would be trying to contact dnolen directly, either via email or (preferably) on IRC so that he can have an opportunity to give you feedback. Tomorrow is the deadline, so I'm going ahead and doing an edit at the moment. I'll send a pull request

Re: Google Summer of Code 2012 Application

2012-04-04 Thread Aaron Cohen
2012/4/4 Raphaël AMIARD raph.ami...@gmail.com: Hi there, I've been a hobbyist Clojure developer for some time now, and a lurker in the community. I'm very interrested in participating to the Google Summer of Code on the Clojure team. Clojure is a language that i love, and i would love

Re: Google Summer of Code 2012 Application

2012-04-04 Thread Aaron Cohen
2012/4/4 Raphaël AMIARD raph.ami...@gmail.com: Hi Aaron ! Those application are intended for submission on the google summer of code site. I think both Clojure developer and google will eventually get them if i understood the system right. Thank you very much for the editing help

Re: Google Summer of Code 2012 Application

2012-04-04 Thread Aaron Cohen
Raph, rather than do an edit pass at this point, there are some larger problems with your proposal you need to take care of. :) In my opinion, your proposals are too informal, Hi, I'm Raphael As I'm not going to be choosing them, I can't guarantee this is the case, but judging from

Re: newb question about idioms, and meta: where should i ask noob questions?

2012-03-27 Thread Aaron Cohen
(top-posting corrected) On Sunday, March 25, 2012 5:49:27 PM UTC-5, Dustin Getz wrote: first a quesiton about idiomatic code: ;; provided by book Fogus Houser, Joy of Clojure (defn index [coll]   (cond (map? coll) (seq coll) (set? coll) (map vector coll coll) :else (map

Re: What is wrong with code

2012-03-18 Thread Aaron Cohen
On Thu, Mar 15, 2012 at 10:36 PM, jayvandal jayvan...@gmail.com wrote: This is the code (ns example.core        (:gen-class)) (defn -main [ args]        (println Hello, World)) ;java -cp classes:clojure.jar com.example Where is com.example coming from? Your namespace is example.core

Re: How I can use InteractionEvent in clojure?

2012-03-07 Thread Aaron Cohen
Unfortunately, I've been unable to get vtk to compile locally. At this point, it's seeming to me that your issue is more vtk-related than clojure, though. Can you put a println in the callback to confirm that it's at least being called? One question, is it significant that your code is slightly

Re: Can Clojure be as readable as Python or Ruby ?

2012-03-07 Thread Aaron Cohen
On Wed, Mar 7, 2012 at 12:39 PM, Leon Talbot leontal...@gmail.com wrote: If so, how ? Thanks ! Isn't it already? -- 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

Re: How I can use InteractionEvent in clojure?

2012-03-07 Thread Aaron Cohen
I meant do: (def myCallback (fn [] (println Invoked!) (let [t (vtk.vtkTransform.)] (.GetTransform t) (- boxWidget .GetProp3D (.SetUserTransform t) -- You received this message because you are subscribed to the Google Groups Clojure group. To post to this group,

Re: How I can use InteractionEvent in clojure?

2012-03-07 Thread Aaron Cohen
On Mon, Mar 5, 2012 at 5:50 PM, Antonio Recio amdx6...@gmail.com wrote:       (.AddObserver interactionEvent myCallback run) I suspect this is mis-capitalized, it need to be InteractionEvent. --Aaron -- You received this message because you are subscribed to the Google Groups Clojure group.

Re: How I can use InteractionEvent in clojure?

2012-03-05 Thread Aaron Cohen
Actually, one last try before I build vtk and try it myself. The problem seems to me that vtk is looking for a method that takes no parameters and return void. invoke returns Object, let's use run instead. So try this: (def myCallback (fn [] (let [t (vtkTransform.)]

Re: How I can use InteractionEvent in clojure?

2012-03-04 Thread Aaron Cohen
On Sun, Mar 4, 2012 at 10:07 AM, Antonio Recio amdx6...@gmail.com wrote: How I can use proxy to set the AddObserver? I'm not sure what you mean, sorry, but I'll take a guess. If for some reason you want to use proxy rather than fn, it's possible. Also note, there's nothing magic about using IFn

Re: How I can use InteractionEvent in clojure?

2012-03-04 Thread Aaron Cohen
On Sun, Mar 4, 2012 at 2:17 PM, Antonio Recio amdx6...@gmail.com wrote: If it is not possible to use AddObserver, how I can use gen-class in this example? Hi Antonio, I can't use vtk on my laptop at the moment and don't want to send you down any more blind alleys with anything I can't

Re: How I can use InteractionEvent in clojure?

2012-03-03 Thread Aaron Cohen
On Sat, Mar 3, 2012 at 12:47 PM, Antonio Recio amdx6...@gmail.com 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

Re: Call static java method specified at runtime

2012-02-29 Thread Aaron Cohen
On Tue, Feb 28, 2012 at 10:40 AM, Bost rostislav.svob...@gmail.com wrote: I have a java class with several static methods: package org.domain.test; public class My {  static public void sBar(String x, String y) { System.out.println(sBar +x+:+y); }  static public void sBaz(String x, String

Re: Help me improve and/or simplify this code

2012-02-22 Thread Aaron Cohen
On Wed, Feb 22, 2012 at 6:51 AM, Laurent PETIT laurent.pe...@gmail.com wrote: 2012/2/22 Cedric Greevey cgree...@gmail.com If I may venture an opinion here: aren't some people over-thinking and maybe even gold-plating this? My own version is succinct, and moreover when the requirements were

Help me improve and/or simplify this code

2012-02-21 Thread Aaron Cohen
Hi all, After a good deal of effort, I managed to beat the following code into something functional, but it's getting kind of big, unwieldy and hard to follow. I'd appreciate if anyone could take a look and give me some pointers. First, it will probably be easier for me to describe

Re: Help me improve and/or simplify this code

2012-02-21 Thread Aaron Cohen
On Tue, Feb 21, 2012 at 9:21 AM, Cedric Greevey cgree...@gmail.com wrote: On Tue, Feb 21, 2012 at 8:51 AM, Aaron Cohen aa...@assonance.org wrote: I would like to process the ast such that: 1) Any nodes that are of :op :fn, get an entry added named :constants which contains a vector of all

Re: Help me improve and/or simplify this code

2012-02-21 Thread Aaron Cohen
I should have just put this example in the email initially, it's in the gist: (process-frames {:op :fn :children [{:op :let :children [{:op :constant :form 1}]}]}) {:op :fn, :constants [{:value 1}], :children [ {:op :let, :unbox false, :children [ {:unbox true, :form 1, :op :constant}]}]} --

Re: Help me improve and/or simplify this code

2012-02-21 Thread Aaron Cohen
On Tue, Feb 21, 2012 at 9:48 AM, Cedric Greevey cgree...@gmail.com wrote: It works by recursing, passing descendant-of-let? information down the stack, and accumulating constants up the stack. The implementation fn returns a two-element vector of the modified node and a vector of the

Re: Help me improve and/or simplify this code

2012-02-21 Thread Aaron Cohen
On Tue, Feb 21, 2012 at 10:32 AM, Meikel Brandmeyer (kotarak) m...@kotka.de wrote: Hi, I'm not sure it nicer, but anyway... It follows a similar approach as Cedric: pass down unbox info and collect up constants info. However I use the form itself to carry additional information. YMMV. One

Re: Help me improve and/or simplify this code

2012-02-21 Thread Aaron Cohen
On Tue, Feb 21, 2012 at 4:44 PM, Meikel Brandmeyer m...@kotka.de wrote: Hi, Am 21.02.2012 um 22:35 schrieb Aaron Cohen: I'd actuallly tried to avoid littering the syntax tree with :constants elements anywhere other than where they were needed, but thinking about it, there doesn't really

Re: Error in the example on the Multimethods page?

2012-02-14 Thread Aaron Cohen
On Tue, Feb 14, 2012 at 3:14 PM, László Török ltoro...@gmail.com wrote: What I don't get is how a (class []) gets dispatched to ::collection. (class []) returns clojure.lang.PersistentVector which doesn't seem to satisfy the isa? relationship. (defmulti foo class) (defmethod foo

Re: protocols and interfaces

2012-02-10 Thread Aaron Cohen
On Fri, Feb 10, 2012 at 3:13 AM, drewn naylor...@gmail.com wrote: I've just started learning protocols, deftype, etc.  The first thing I did was try to extend a Clojure type (maps) to operate as a specialized Java Swing interface (AttributeSet), forgetting that interfaces are not protocols;

Re: - and -

2012-02-08 Thread Aaron Cohen
Also, for future reference, symboihound.com is a great tool for programmers. http://symbolhound.com/?q=-%3E+clojure On Wed, Feb 8, 2012 at 11:18 AM, Tamreen Khan histor...@gmail.com wrote: - - http://clojuredocs.org/clojure_core/clojure.core/-%3E -

Re: Clojure and long auto-promotion to big decimal

2012-02-07 Thread Aaron Cohen
This was the big change in clojure 1.3 See http://dev.clojure.org/display/doc/Enhanced+Primitive+Support The expectation now is that if you are doing math that is going to overflow, you can either introduce a bigint into the chain somewhere, after which all the math will use bigints (contagion)

Re: Destructuring a seq of maps

2012-02-07 Thread Aaron Cohen
On Tue, Feb 7, 2012 at 3:28 PM, Manuel Paccagnella manuel.paccagne...@gmail.com wrote: I've some questions about destructuring a seq of maps, like: 1. Is it possible? 2. If yes, does it have any sense? 3. And if it's possible and is reasonable, how can I do it? For example, let's say that I

Re: where is defalias in the new contrib github repositories

2012-02-02 Thread Aaron Cohen
Oaaron Thu, Feb 2, 2012 at 5:02 PM, Sam Ritchie sritchi...@gmail.com wrote: Hey Mike, I don't think it's in any of the new modular contrib libraries. I placed it in a utility library called Jackknife that we use from Cascalog:

Re: Invoking varargs Java methods

2012-01-10 Thread Aaron Cohen
On Tue, Jan 10, 2012 at 5:46 PM, Norman Gray norman.x.g...@gmail.com wrote: Greetings. I've run into a situation which (I think) is the Clojure analogue of http://stackoverflow.com/questions/5672778/class-getmethod-when-parameter-is-varargs, and I'm not sure how to apply the solution there

Re: Question ActionListener conditional

2011-12-23 Thread Aaron Cohen
On Fri, Dec 23, 2011 at 1:29 PM, Antonio Recio amdx6...@gmail.com wrote: I am trying to add and to remove an object isoActor when I click the button isoButton, but I get an error: Exception in thread main java.lang.IllegalArgumentException: Don't know how to create ISeq from:

Re: Question ActionListener conditional

2011-12-23 Thread Aaron Cohen
On Fri, Dec 23, 2011 at 3:08 PM, Antonio Recio amdx6...@gmail.com wrote: When I click 2 times the button isoButton I get an error. (.addActionListener isoButton                     (proxy [ActionListener] []                       (actionPerformed [] Sorry, forgot the parameter here, add an e.

Re: [ANN] reader-macros

2011-12-21 Thread Aaron Cohen
On Wed, Dec 21, 2011 at 12:27 PM, Peter Danenberg p...@roxygen.org wrote: Despite Brian Carpenter's warning about torches and pitchforks [1], I've decided to release a reader-macros package; may Zeus forgive me for opening this pithos:  https://github.com/klutometis/reader-macros Here's a

Re: [ANN] reader-macros

2011-12-21 Thread Aaron Cohen
2011/12/21 Peter Danenberg p...@roxygen.org: Quoth Aaron Cohen on Setting Orange, the 63rd of The Aftermath: Ha, I just looked at the source, it's really weird to see λ in clojure code. That's a little idiosyncrasy of mine: I've been chastised for it in the past; maybe `lambda' would be more

Re: [ANN] reader-macros

2011-12-21 Thread Aaron Cohen
2011/12/21 Aaron Cohen aa...@assonance.org: 2011/12/21 Peter Danenberg p...@roxygen.org: Quoth Aaron Cohen on Setting Orange, the 63rd of The Aftermath: Ha, I just looked at the source, it's really weird to see λ in clojure code. That's a little idiosyncrasy of mine: I've been chastised

Re: How to create an alias of clojure.lang.RT/loadLibrary?

2011-12-20 Thread Aaron Cohen
On Tue, Dec 20, 2011 at 2:35 PM, Sean Corfield seancorfi...@gmail.comwrote: On Tue, Dec 20, 2011 at 10:42 AM, Antonio Recio amdx6...@gmail.com wrote: I would like to use an alias to refer clojure.lang.RT/loadLibrary as lib. You could just call: (System/loadLibrary vtkCommonJava) This

Re: How to create an alias of clojure.lang.RT/loadLibrary?

2011-12-20 Thread Aaron Cohen
On Tue, Dec 20, 2011 at 3:52 PM, Sean Corfield seancorfi...@gmail.comwrote: On Tue, Dec 20, 2011 at 11:54 AM, Aaron Cohen aa...@assonance.org wrote: You could just call: (System/loadLibrary vtkCommonJava) This doesn't work, the library will be loaded into the wrong classloader. That's

Re: Clojure-in-CommonLisp?

2011-11-15 Thread Aaron Cohen
FYI: https://github.com/bagucode/clj-native uses bytecode generation to create the glue classes on the fly. On Tue, Nov 15, 2011 at 12:21 PM, Marshall T. Vandegrift llas...@gmail.comwrote: Integrating the JVM with C via JNA [1] is pretty straightforward. I've been doing all my JNA glue in

Rides to the conj

2011-10-27 Thread Aaron Cohen
Hi everyone, I haven't seen a lot of discussion about people organizing rides/roomshares etc for the conj so far, I hope this is an appropriate venue. Is anyone driving down from the DC area who could offer a ride down? I'll be flying out of Durham after the conj, but I can help with gas

Re: Does macros evaluates its arguments before?

2011-09-26 Thread Aaron Cohen
2011/9/26 ru soro...@oogis.ru That's exactly means evaluation of argument that's contradict to mentioned above documentation! On 26 сен, 18:18, Tassilo Horn tass...@member.fsf.org wrote: Ok, this is working! But, what's the difference? Your code: user= (defmacro infix [e] `(let

Re: Arithmetic Exception in 1.3

2011-09-20 Thread Aaron Cohen
Alternatively: (apply * (repeat 100 2N)) and allow BigInt contagion to work. On Tue, Sep 20, 2011 at 8:43 AM, Herwig Hochleitner hhochleit...@gmail.comwrote: 2011/9/19 PC pca...@gmail.com: (apply * (repeat 100 2)) Auto promotion has been turned off in favor of performance. Operations with

Re: misuse of or bug in transients?

2011-09-16 Thread Aaron Cohen
On Fri, Sep 16, 2011 at 2:20 PM, David Nolen dnolen.li...@gmail.com wrote: On Fri, Sep 16, 2011 at 2:07 PM, Mark Engelberg mark.engelb...@gmail.comwrote: Here's what I speculate the problem is: Last time I checked, contains? doesn't work on transient sets. Try rewriting (contains? tset %)

Re: passing a list as a ref bombs

2011-08-31 Thread Aaron Cohen
On Wed, Aug 31, 2011 at 3:14 PM, loonster tbur...@acm.org wrote: ((first in-list) The double parenthesis is suspicious here, it looks like you're trying to invoke the first element of the list as a function. --Aaron -- You received this message because you are subscribed to the

Re: Seq of Numbers from 0 to N and Back

2011-08-24 Thread Aaron Cohen
One way: user=(concat (range 5) (range 5 0 -1)) (0 1 2 3 4 5 4 3 2 1) user=(take 15 (cycl­e (conc­at (rang­e 5) (rang­e 5 0 -1)))­)) (0 1 2 3 4 5 4 3 2 1 0 1 2 3 4) On Wed, Aug 24, 2011 at 6:49 PM, HiHeelHottie hiheelhot...@gmail.comwrote: How can you generate a sequence of numbers from 0 to

Re: reverse a sequence without reverse or rseq

2011-08-08 Thread Aaron Cohen
On Mon, Aug 8, 2011 at 2:29 PM, MarisO maris.orbid...@gmail.com wrote: Do you know of any trick to reverse a sequence without reverse or rseq ? I wrote it like this: ((fn rev ([s] (rev '() s)) ([r s] (if (seq s) (rev (cons (first s) r) (rest s)) r )) ) '[1 2 3 5] )

Re: Defrecord and Interfaces..

2011-07-29 Thread Aaron Cohen
On Fri, Jul 29, 2011 at 3:18 PM, Andreas Liljeqvist bon...@gmail.comwrote: Is this a bug? Nope, expectation dissonance. (defprotocol Notcloseable (dosomething [this])) This is what actually defines the function dosomething. Once this definition happens, the function exists and can be

Re: How to write `when-lets`

2011-07-27 Thread Aaron Cohen
On Wed, Jul 27, 2011 at 2:15 PM, Ken Wesson kwess...@gmail.com wrote: On Wed, Jul 27, 2011 at 2:13 PM, Alan Malloy a...@malloys.org wrote: On Jul 27, 11:11 am, Alan Malloy a...@malloys.org wrote: On Jul 27, 5:50 am, Feng Shen shen...@gmail.com wrote: (defn foldr ([f coll] (reduce f

Re: How to write `when-lets`

2011-07-27 Thread Aaron Cohen
On Wed, Jul 27, 2011 at 2:39 PM, Ken Wesson kwess...@gmail.com wrote: On Wed, Jul 27, 2011 at 2:35 PM, Aaron Cohen aa...@assonance.org wrote: I may be wrong, but don't you need to swap the order of the arguments to f? You can do that by writing f itself appropriately. Usually either

Re: better community docs: getting started

2011-07-22 Thread Aaron Cohen
On Fri, Jul 22, 2011 at 5:22 PM, Stuart Halloway stuart.hallo...@gmail.comwrote: I am working through a few of the pages on clojure.org with two goals: (1) remove or fix anything that is outdated or incorrect I really like how minimal that is now. A quick suggestion: shouldn't the Copyright

Re: Any ways to prevent protocol functions from being hardcoded in?

2011-07-01 Thread Aaron Cohen
On Fri, Jul 1, 2011 at 9:20 AM, David McNeil mcneil.da...@gmail.com wrote: On Jun 30, 7:54 am, Stuart Sierra the.stuart.sie...@gmail.com wrote: Recently the received wisdom has been: protocols are a low-level implementation detail. Actual APIs should be built with normal functions that call

Re: Aw: Re: How to convert a VTK example from java to clojure?

2011-06-21 Thread Aaron Cohen
On Tue, Jun 21, 2011 at 8:00 PM, Antonio Recio amdx6...@gmail.com wrote: I have tried to use wall-hack-method but I still obtain the error: UnsatisfiedLinkError vtk.vtkConeSource.VTKInit()J  vtk.vtkConeSource.VTKInit (vtkConeSource.java:-2). What I am doing wrong? (ns project.core   (:import

Re: cannot use swig native shared libraries

2011-06-21 Thread Aaron Cohen
Sorry to perform thread necromancy, but I believe that this problem is the same that I found a workaround for in a recent thread, and would love if you could confirm that a similar solution fixes this for you? The thread is: https://groups.google.com/d/topic/clojure/br_sTSuWBJ8/discussion For

Re: Aw: Re: How to convert a VTK example from java to clojure?

2011-06-21 Thread Aaron Cohen
It appears that you need to have the VTK *.class or *.jar files on you classpath as well. Add the path to your VTK java files to the cp parameter you are invoking clojure with. On Tue, Jun 21, 2011 at 11:26 AM, Antonio Recio amdx6...@gmail.com wrote: I have tried also this: $ java

Re: Aw: Re: How to convert a VTK example from java to clojure?

2011-06-21 Thread Aaron Cohen
Your LD_LIBRARY_PATH is quite extensive there, is that all required or is this just a bunch of stuff you've been trying? I usually just use -Djava.library.path=whatever. On linux you also may have to be sure that your shared libraries are +x for your user. --Aaron On Tue, Jun 21, 2011 at 12:17

Re: Aw: Re: How to convert a VTK example from java to clojure?

2011-06-21 Thread Aaron Cohen
On Tue, Jun 21, 2011 at 12:38 PM, Antonio Recio amdx6...@gmail.com wrote: java -Djava.library.path=/usr/local/lib/vtk-5.9/ This is the directory that contains: libvtkCommonJava.so, libvtkFilteringJava.so, libvtkIOJava.so, libvtkImagingJava.so, libvtkGraphicsJava.so, and libvtkRenderingJava.so ?

Re: Aw: Re: How to convert a VTK example from java to clojure?

2011-06-21 Thread Aaron Cohen
OK, I've gotten it working on my computer, and it turns out to be a slightly complicated problem. What is happening is that the vtk java files and your clojure code are using different classloaders (clojure uses its own classloader). System/loadLibrary is kind of crippled in that it always loads

Re: map

2011-06-17 Thread Aaron Cohen
On Fri, Jun 17, 2011 at 2:13 PM, FD fabien.dub...@scarlet.be wrote: Hello, What is wrong in this function? (defn testmap []  (do    (map #(fn1 %)       '(a b c))    (map #(fn2%)       '(1 2 3))  )) 1) for is lazy, its value is a LazySeq and the contents are only evaluated at need 2)

Re: Where to place Arguments

2011-06-15 Thread Aaron Cohen
On Tue, Jun 14, 2011 at 4:28 PM, Nick Zbinden nick...@gmail.com wrote: I'm writing this here because of two reasons: 1. The universial threading operator keeps showing up. Im not saying its a always a bad thing but I think we should trie to avoid it in most cases and the standard on the

Re: lein and private locally installed classes

2011-05-24 Thread Aaron Cohen
On Tue, May 24, 2011 at 3:55 AM, Eric S Fraga e.fr...@ucl.ac.uk wrote: Therefore, I want to tell lein that, for a given project, I have Java packages in, say, ${HOME}/share/classes that I wish to access from within that project.  Can any body point me in the right direction?  I assume I need

Re: sessions in Ring, Sandbar, Compojure, etc...

2011-05-11 Thread Aaron Cohen
The magic is in wrap-session, which adds the session middleware to your stack. At that point, your ring handler will see that it's request map has a new key (:session) which is a map containing all your session variables. You can assoc anything into that map and it will be stored in the session.

Re: sessions in Ring, Sandbar, Compojure, etc...

2011-05-11 Thread Aaron Cohen
On Wed, May 11, 2011 at 10:27 PM, Shree Mulay shreemu...@gmail.com wrote: ;;takes the input params from the login form and stores the ;;logged in user into a session. You get logged in when the ;;password value is = secret (defn login-controller [params session]  (do (println (params

Re: Odd Java interop behavior

2011-04-26 Thread Aaron Cohen
On Tue, Apr 26, 2011 at 2:36 PM, Ken Wesson kwess...@gmail.com wrote: On Tue, Apr 26, 2011 at 2:26 PM, Dave Ray dave...@gmail.com wrote: If the blah blah blah... is meant to represent a very long file name or path, my guess would be that you've bumped up against the Windows path limit (260

Re: Grabbing Rotten Tomatoes movie ratings in clojure

2011-04-26 Thread Aaron Cohen
On Tue, Apr 26, 2011 at 3:19 PM, justinhj justi...@gmail.com wrote: An update on this little side project to grab movie ratings from popular a movie website: I've add it to github and included the project file and updated the README https://github.com/justinhj/movieratings Also fixed it so

Re: Clojure performance optimization

2011-04-20 Thread Aaron Cohen
On Wed, Apr 20, 2011 at 11:21 AM, Michael Golovanov mike.golova...@gmail.com wrote: My question is how to find performance bottlenecks in Clojure applications. Second question is about my code. Where are the problem? May be this is 1. Incorrect execution time measuring procedure 2. Bad

Re: labrepl incanter IntelliJ Ubuntu 64-bit X11 error

2011-04-13 Thread Aaron Cohen
On Wed, Apr 13, 2011 at 9:00 PM, peterg pjgood...@gmail.com wrote: *I seriously believe there is a missing step in published configuration instructions, or that a development environment being used elsewhere on the same machine by other people testing provides a magic fix. Hi Peter, I can

Re: Jesus, how the heck to do anything?

2011-03-23 Thread Aaron Cohen
On Wed, Mar 23, 2011 at 9:11 AM, ultranewb pineapple.l...@yahoo.com wrote: I'll be damned - this worked.  Really, there needs to be some prominent, easily-accessible guides for just dumb, ultra-basic stuff like this.  I'm talking guides that assume the user has no knowledge of anything except

Re: Multiple replacements in string using a map

2011-03-15 Thread Aaron Cohen
On Mon, Mar 14, 2011 at 2:17 PM, Daniel Solano Gomez cloj...@sattvik.com wrote: On Mon Mar 14 13:02 2011, shuaybi2 shuaybi2 wrote: I have a string such as: select * from account where acctId = _ACCT-ID_ and acctTyp = _ACCT-TYP_ There are several clojure libraries that exist to improve the

Re: Can this function be simpler?

2011-03-10 Thread Aaron Cohen
On Thu, Mar 10, 2011 at 12:46 PM, Damien Lepage damienlep...@gmail.com wrote: Hi I wrote a function to transform a variable number of arguments into embedded maps. Here is what it does: (enmap 1 2) {1 2} (enmap 1 2 3) {1 {2 3}} (enmap 1 2 3 4) {1 {2 {3 4}}} (enmap 1 2 3 4 {5 6 7 8})

Re: Can this function be simpler?

2011-03-10 Thread Aaron Cohen
On Thu, Mar 10, 2011 at 12:46 PM, Damien Lepage damienlep...@gmail.com wrote: Hi           (apply enmap arg (concat even-more (list (hash-map k v Is there something simpler than (concat even-more (list (hash-map k v)) to append an element at the end of a sequence? To answer your second

Re: using records in Java

2011-03-03 Thread Aaron Cohen
On Wed, Mar 2, 2011 at 11:38 PM, Earl J. Wagner dont.spam.e...@gmail.comwrote: Then I try to compile Java code to use it: import java.lang.reflect.Method; import t.core; import t.core.TRecord; Attempting to compile this with the jar in the classpath produces a cannot find symbol error

Re: using records in Java

2011-03-03 Thread Aaron Cohen
On Thu, Mar 3, 2011 at 2:24 PM, Daniel Solano Gomez cloj...@sattvik.comwrote: On Thu Mar 3 13:48 2011, Aaron Cohen wrote: On Wed, Mar 2, 2011 at 11:38 PM, Earl J. Wagner dont.spam.e...@gmail.comwrote: Well, t.core exists because in his ns declaration he included :gen-class. Now

Re: A blocking function

2011-03-02 Thread Aaron Cohen
On Wed, Mar 2, 2011 at 6:49 PM, Daniel Solano Gomez cloj...@sattvik.comwrote: On Wed Mar 2 15:44 2011, clj123123 wrote: In a multi thread app, is there a way to mark a function to be blocking so it can run not simultaneously but would be blocking for each thread? You could try the

Re: Handling of unsigned bytes

2011-02-12 Thread Aaron Cohen
On Sat, Feb 12, 2011 at 8:28 AM, timc timgcl...@gmail.com wrote: Further investigation reveals that (def b (byte i)) is doing something equivalent to this internally: byte b = Byte.parseByte(String.format(%d,i)); which does indeed throw a NumberFormatException if the decimal integer

Re: Handling of unsigned bytes

2011-02-12 Thread Aaron Cohen
I should also mention that for this sort of stuff, people often get tired of raw bit-twiddling and move to something like a wrapper around protocol buffers (such as https://github.com/ninjudd/clojure-protobuf) or a DSL such as gloss (https://github.com/ztellman/gloss/wiki). --Aaron -- You

Re: Handling of unsigned bytes

2011-02-12 Thread Aaron Cohen
On Sat, Feb 12, 2011 at 4:42 PM, Ken Wesson kwess...@gmail.com wrote: On Sat, Feb 12, 2011 at 8:28 AM, timc timgcl...@gmail.com wrote: Further investigation reveals that (def b (byte i)) is doing something equivalent to this internally: byte b = Byte.parseByte(String.format(%d,i)); What

Re: Dynamic record creation

2011-02-03 Thread Aaron Cohen
On Thu, Feb 3, 2011 at 9:36 PM, Quzanti quza...@googlemail.com wrote: On Feb 4, 2:23 am, Kevin Downey redc...@gmail.com wrote: whole crazy concat thing                 which has nothing to do with anything I probably should have clarified that the reason I need concat is that various

Re: Dynamic record creation

2011-02-03 Thread Aaron Cohen
On Thu, Feb 3, 2011 at 10:04 PM, Quzanti quza...@googlemail.com wrote: I see no reason for the ctor to be defined as a string as you've done with Person.. The reason is that I am reading in XML and mapping a tag name to the record class. It's possible to do this using reflection, but I

Re: Dynamic record creation

2011-02-03 Thread Aaron Cohen
On Thu, Feb 3, 2011 at 10:11 PM, Aaron Cohen aa...@assonance.org wrote: On Thu, Feb 3, 2011 at 10:04 PM, Quzanti quza...@googlemail.com wrote: I see no reason for the ctor to be defined as a string as you've done with Person.. The reason is that I am reading in XML and mapping a tag name

Re: How to disallow unlisted optional argument keys?

2011-01-30 Thread Aaron Cohen
On Sun, Jan 30, 2011 at 12:12 PM, Ken Wesson kwess...@gmail.com wrote: On Sun, Jan 30, 2011 at 5:36 AM, Shantanu Kumar kumar.shant...@gmail.com wrote: On Jan 30, 2:17 pm, Alexander Yakushev yakushev.a...@gmail.com wrote: Why not use a constraint? It looks much cleaner. (defn hello [ {:keys

Re: REQUEST for feedback on http://clojure.org

2011-01-28 Thread Aaron Cohen
On Sat, Oct 30, 2010 at 10:38 PM, Alex Miller alexdmil...@yahoo.com wrote: Hi all, I'm doing a bit of doc cleanup on http://clojure.org and I'd welcome your feedback on things that are broken or could be improved.  I'm not looking (or likely authorized :) to make any drastic changes but if

Re: Ridiculously massive slowdown when working with images

2011-01-28 Thread Aaron Cohen
On Fri, Jan 28, 2011 at 1:55 PM, David Nolen dnolen.li...@gmail.com wrote: As a comparison, the following accomplishes the same thing in 1.3.0. (ns test) (set! *unchecked-math* true) (set! *warn-on-reflection* true) (def buffer-size 192) (def array (byte-array buffer-size)) (defn

Re: I'm doing something wrong with gen-class

2011-01-28 Thread Aaron Cohen
On Fri, Jan 28, 2011 at 6:13 PM, Andy Fingerhut andy.finger...@gmail.com wrote: (ns andy.try  (:gen-class)) (gen-class :name  andy.try.ReversibleByteArray :prefix rba-) I find it confusing that you have both of :gen-class in the ns macro (I guess you're using this to get -main) and

Re: Calling .close() on resources -- with-open macro

2011-01-24 Thread Aaron Cohen
On Mon, Jan 24, 2011 at 2:27 PM, Shantanu Kumar kumar.shant...@gmail.com wrote: I noticed that in 'with-open' macro the .close() method is called without wrapping in another try-catch block. Exceptions raised in the finally block prevails over the exception raised in the try block. Is this

Re: Calling .close() on resources -- with-open macro

2011-01-24 Thread Aaron Cohen
On Mon, Jan 24, 2011 at 4:54 PM, Shantanu Kumar kumar.shant...@gmail.com wrote: On Jan 25, 2:47 am, Aaron Cohen aa...@assonance.org wrote: On Mon, Jan 24, 2011 at 2:27 PM, Shantanu Kumar kumar.shant...@gmail.com wrote: I noticed that in 'with-open' macro the .close() method is called

Re: Euler 14

2011-01-21 Thread Aaron Cohen
On Thu, Jan 20, 2011 at 11:57 PM, Mark Engelberg mark.engelb...@gmail.com wrote: On Thu, Jan 20, 2011 at 6:51 AM, Andreas Liljeqvist bon...@gmail.com wrote: I am sorry, I can't seem to reproduce the behavior at the moment :( Mark, please tell me that I am not delusional... I definitely

Re: Euler 14

2011-01-21 Thread Aaron Cohen
max-key uses destructuring, which was one of the culprits for unexpectedly holding onto the head of lists before locals clearing was added. This part of what I said is garbage, I'm sorry. I looked at max-key too quickly, but there isn't any destructuring there. That doesn't change that I

Re: problem with stream

2011-01-06 Thread Aaron Cohen
On Wed, Jan 5, 2011 at 5:13 PM, Ken Wesson kwess...@gmail.com wrote: On Wed, Jan 5, 2011 at 4:40 PM, rainerh rainer.hahnek...@gmail.com wrote: Hello everybody, I'm trying to use clojure to parse web sites. Unfortunately there is some problem with following code (used library is Apache Commons

Re: about the repl

2010-12-18 Thread Aaron Cohen
On Sat, Dec 18, 2010 at 10:34 AM, Lee Spector lspec...@hampshire.edu wrote: On Dec 18, 2010, at 8:23 AM, .Bill Smith wrote: While this not what tor explicitly asked about, it is worth mentioning that the only way to kill an infinite loop in a Clojure repl is to kill the JVM. Is this

Re: newb q about quote

2010-12-08 Thread Aaron Cohen
On Wed, Dec 8, 2010 at 2:40 PM, javajosh javaj...@gmail.com wrote: I was looking at quote. user= (quote 1) 1 user= (quote) nil user= (quote quote) quote user= ((quote quote) 1) nil It's the last result that confuses me. I would have expected the result to be 1 - e.g. the same as

<    1   2   3   >