Re: ANN: clj-dropbox, Dropbox client library in Clojure

2010-07-25 Thread aria42
assume thats where the problem is. if i do the dance by hand and copy the result the client works great! /Micke 2010/7/23 Marc Spitzer mspit...@gmail.com: I need to look at this.  Thanks for the toy. marc On Thu, Jul 22, 2010 at 8:23 PM, aria42 ari...@gmail.com wrote: Hi all, I've

Re: ANN: clj-dropbox, Dropbox client library in Clojure

2010-07-25 Thread aria42
used or nil as a callback-url. i assume thats where the problem is. if i do the dance by hand and copy the result the client works great! /Micke 2010/7/23 Marc Spitzer mspit...@gmail.com: I need to look at this.  Thanks for the toy. marc On Thu, Jul 22, 2010 at 8:23 PM, aria42 ari

ANN: clj-dropbox, Dropbox client library in Clojure

2010-07-22 Thread aria42
Hi all, I've released my clojure library for accessing the Dropbox API. Its called clj-dropbox and it can be found at: http://github.com/aria42/clj-dropbox Hope some people get use out of it. Feel free to email or leave comments and/or suggestions Best, Aria -- You received this message

Maps with functions for default values

2010-07-12 Thread aria42
Is there a way to set up a map so that there is a default function which depending on the key returns a value if one is not present in the map. I can obviously write this with a deftype and have it implement Associative, Seqable, etc. so it behaves like a built-in map, but just wondering if there

Re: -- macro proposal

2010-07-07 Thread aria42
I've needed -- a few times in my code. I don't think I need it as much as just - or -. Most of the time I've needed it is because I or someone else essentially had parameters in the wrong order. Maybe it belongs in contrib along with -? which I've needed sparingly as well, but have found useful

Remapping Class Imports

2010-03-30 Thread aria42
Hi, Is it possible to remap the name of a class or package import? Ideally I'd like to say something like (import [[java.util :as ju] ArrayList List]) and then use (ju.ArrayList.) to refer to the class. I recall reading Rich doesn't like auto-imports of all classes in a package or of renaming

Accidentally Retaining Head?

2010-03-23 Thread aria42
Hi, I was experimenting with some code and I had an largish sequence I did a doseq over. The memory hit the ceiling, which you expect since even though the head isn't retained GC doesn't happen until you hit your memory limit (is there a way to change that). Once it hit the memory limit, 1.2

Re: Accidentally Retaining Head?

2010-03-23 Thread aria42
, Mar 23, 2010 at 9:40 PM, aria42 ari...@gmail.com wrote: Hi,  I was experimenting with some code and I had an largish sequence I did  a doseq over. The memory hit the ceiling, which you expect since even though the head isn't retained GC doesn't happen until you hit your memory limit

extending protocol

2010-03-13 Thread aria42
Is there a way to say that a protocol extends another protocol or interface? I.e. can i specify that a given protocol must also support the seq method from clojure.lang.Seqable? -- You received this message because you are subscribed to the Google Groups Clojure group. To post to this group,

Can I make this faster?

2010-02-17 Thread aria42
Hi all, I was playing with the defprotocol/deftype/reify stuff in 1.2, and I wanted to test how a common abstraction I use would look if I did with java data structures vs. clojure ones. I've pasted the code below. I'll wait for you to take a lookSo on my test, I have the Clojure version about

Re: Trait-like behavior with Protocols

2010-02-09 Thread aria42
If this situation is common enough, shouldn't defprotocol support optional implementations which are implicitly merged? On Feb 9, 6:01 am, Konrad Hinsen konrad.hin...@fastmail.net wrote: On 09.02.2010, at 02:14, Stuart Sierra wrote: On Feb 8, 6:13 pm, aria42 ari...@gmail.com wrote

Trait-like behavior with Protocols

2010-02-08 Thread aria42
Is it possible to have default implementations associated with functions in a protocol? This is most useful when some protocol functions are defined in terms of other. For instance, (defprotocol Span (start [self]) (stop [self]) (span-length [self])) Now I know I can just make span-length

Re: Bug with Clojure 1.2 REPL (aka master branch) ?

2010-01-12 Thread aria42
I was seeing this error too and I reckoned it was because my clojure.contrib was not compatible with clojure core. I think if you're using 1.2 master of clojure you need 1.1 master of contrib. Is that right? On Jan 12, 6:41 pm, David Nolen dnolen.li...@gmail.com wrote: Hullo, I'm trying to run

Re: Inheritance multiple inheritance using structs

2009-01-22 Thread aria42
[sorry for duplicating content from the email i sent you David] Would anyone be interested in simplifying some of the boilerplate for defining methods in clojs? Currently you have to do this, (defclass circle [shape] (:radius 10)) (defmulti area :tag) (defmethod area ::circle [this] (*

Re: How much Clojure source code is complicated?

2009-01-13 Thread aria42
For what's it worth, I think the Programming Clojure book is excellent (Okay Stuart, make the check payable to ). My only complaint is that the I wish there were another largish example besides the two in there (mc simulation and the lancelet thing). Cheers, Aria On Jan 13, 12:58 am, bOR_

Re: IntelliJ Plugin

2009-01-13 Thread aria42
Did you ever get around to posting the notes on getting the IntelliJ plugin to work? I sorely would love IDE support for Clojure in either Eclipse or IntelliJ. Is the IntelliJ one in a usable state, or is it not ready for some alpha-level testers? Cheers, Aria On Dec 29 2008, 10:36 am, Justin

command-line in clojure.contrib suggestions

2009-01-12 Thread aria42
Hi, I've got some suggestions for improving command-line.clj... It would be great if you could provide a function to be called with the value of the option and the result of that function binds to the variable. This would take care of the annoying stuff like calling (Integer/parseInt intAsStr)

Re: command-line in clojure.contrib suggestions

2009-01-12 Thread aria42
Couldn't it have access to the other bindings so far like let? And then just have the order of options reflect the partial order induced by dependency? So is this possible... (with-command-line *command-line-args* my-program [[size The size of something #(if % (Integer/parseInt %) 99)]

Re: Probability distributions in Clojure

2009-01-08 Thread aria42
Hey Conrad, this is great. The only suggestion I'd make is that often times you want a probability distribution which is updatable over time. This happens in online learning as well as Gibbs sampling where you always only implicitly store the posterior b/c it's changing constantly. So in my

Functional Shuffle

2009-01-04 Thread aria42
Hey all, I wanted to write a functional shuffle sequence (not lazy) rather than call out to Java. If anyone is interested here it is. If anyone thinks there is a better way to implement the rifle shuffle, let me know. Not asserting it's the most efficient or anything.

How To Make Code More Functional?

2008-12-26 Thread aria42
-or-less translating my java code (which is more or less translated from Psuedo-Code), but I don't see a good way to make this problem more functional, but this is probably due to my imperative roots. I have the code posted as an attachment here or posted at http://www.cs.berkeley.edu/~aria42

Re: How To Make Code More Functional?

2008-12-26 Thread aria42
Clojure for Tajan's Algorithm uploaded here http://clojure.googlegroups.com/web/tarjan.clj?gsc=yOHJ-CEAAAB3Fq8nFW3O6gqQkWXH_xrOYRvSPFZyhAT412614U6EGkzfKN-m9S9niuHrq-IEXAE - aria On Dec 26, 6:30 am, aria42 ari...@gmail.com wrote: Hi all,   I'm just getting started with clojure from

For Comprehension and println (Noob Question)

2008-12-03 Thread aria42
Hi all, When I run the following from the REPL, I see the result of the println (defn read-docs [duc-dir] (for [file (.listFiles (java.io.File. duc-dir)) :when (.isFile file)] (do (println file) (.getName file However, when embedded in a script