Re: java.io.IOException with compile

2011-02-04 Thread Meikel Brandmeyer
Hi, On 4 Feb., 01:03, Stuart Sierra the.stuart.sie...@gmail.com wrote: Or get another operating system. :) In general this won't help. A quick check on wikipedia gave, that only reiserfs allows for filenames longer than 256 Bytes. (looking at: ext3, ext4, reiserfs, XFS, JFS, HFS+, NTFS; for

XML navigation puzzles

2011-02-04 Thread yiguang hu
Hello, Can some one show me how to navigate through xml? I am trying to have some fun with clojure and think of doing a simple xml navigation, it seems I didn't get the basics and not know how to do this simple thing in clojure. For example, I try to get the user id and name of all barackobama

Re: Hosted REPL, suggestions?

2011-02-04 Thread Timothy Licata
Hi Mark, I don't have answers to your bigger questions, but question: if GAE is the only game in town, do people have a preferrence over the various packages available on github (app-magic, appengine-clj, others)? I've recently moved my apps to appengine-magic. It does a good job of setting

idiomatic super-map

2011-02-04 Thread Mike
This is probably a pretty newb question...sorry. I'm looking for the idiomatic way to apply a seq of functions to other seqs. In other words, a version of map that doesn't take a single f, but a seq of them. (map f c1 c2 ... cn) = ((f c11 c21 ... cn1) (f c12 c22 ... cn2) ... (f c1m c2m ...

Re: idiomatic super-map

2011-02-04 Thread Meikel Brandmeyer
Hi, (map (juxt f1 f2 f3) c1 c2 c3) (map (apply juxt fs) c1 c2 c3) (apply map (apply juxt fs) cs) Sincerely Meikel -- 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: idiomatic super-map

2011-02-04 Thread Meikel Brandmeyer
Or maybe on a second look: (map apply fs c1 ... cn)? (user= (map #(apply %1 %) [+ - *] [1 2 3] [1 2 3]) (2 0 9) vs. user= (map (juxt + - *) [1 2 3] [1 2 3]) ([2 0 1] [4 0 4] [6 0 9]) Sincerely Meikel -- You received this message because you are subscribed to the Google Groups Clojure group.

Re: idiomatic super-map

2011-02-04 Thread Ken Wesson
On Fri, Feb 4, 2011 at 9:19 AM, Mike cki...@gmail.com wrote: This is probably a pretty newb question...sorry.  I'm looking for the idiomatic way to apply a seq of functions to other seqs.  In other words, a version of map that doesn't take a single f, but a seq of them. (map f c1 c2 ... cn)

Re: idiomatic super-map

2011-02-04 Thread Ken Wesson
On Fri, Feb 4, 2011 at 10:11 AM, Ken Wesson kwess...@gmail.com wrote: With juxt it's as Meikel wrote: (defn supermap [fs cs]  (apply map (apply juxt fs) cs)) Or not. Hm, juxt documentation needs clarifying. (defn supermap [fs cs]  (map apply fs (apply map vector cs))) -- You received

Re: idiomatic super-map

2011-02-04 Thread Mike
On Feb 4, 10:11 am, Ken Wesson kwess...@gmail.com wrote: This does it without using juxt: (defn supermap [fs cs]   (map apply fs (apply map vector cs))) This is really nice. Even handles infinity properly: (supermap (repeat +) (range 3) (range 3)) = (0 2 4) Thanks Ken and Meikel! Mike

Re: XML navigation puzzles

2011-02-04 Thread Allen Johnson
Here is my attempt using enlive: (require '[net.cgrand.enlive-html :as html]) (import '[java.net URL])) (def *url* http://api.twitter.com/1/statuses/friends/barackobama.xml;) (defn print-friends [url] (let [data (html/xml-resource (URL. url))] (doseq [user (html/select data [:user])]

Confusion about JARs Leiningen

2011-02-04 Thread Conrad
Hi everyone: Even though I'm an intermediate clojure user, I realize there's some basic things I just don't understand about JARs and Leiningen. It seems to me the answers to these questions would make great additions to the Leiningen FAQ (unless I'm the only one boneheaded enough not to be able

Re: XML navigation puzzles

2011-02-04 Thread Despite
I like to use zip and zip-filter with xml files. For example (suppose clojure.zip is aliased as zip and clojure.contrib.zip-filter.xml is aliased as zf): (def bo-zip (zip/xml-zip (xml/parse http://api.twitter.com/1/statuses/ friends/barackobama.xml Then I can use zip-filters to get the info I

Matrix transform

2011-02-04 Thread Nick
I've got a matrix transformation that I'm doing which is really slow. I'm looking for ways to speed it up. source is a NxD matrix (seqs of seqs of values). I will set and read this matrix. dest is a NxN transformation of f in which indices are mapped to specific indices of f. I will only read

Re: Confusion about JARs Leiningen

2011-02-04 Thread Mark Rathwell
These are all questions about Maven, the dependency management / build system used by many Java developers, on top of which leiningen is built. 1. The sources are publicly accessible maven repositories, of which clojars is one. When running 'lein deps', you can see the repositories that

Re: Confusion about JARs Leiningen

2011-02-04 Thread Luc Prefontaine
On Fri, 4 Feb 2011 08:30:21 -0800 (PST) Conrad drc...@gmail.com wrote: Hi everyone: Even though I'm an intermediate clojure user, I realize there's some basic things I just don't understand about JARs and Leiningen. It seems to me the answers to these questions would make great additions to

Re: how to print-dup records?

2011-02-04 Thread Seth
cool! thought you had to refer or something the namespace, but i guess the reader works differently. changes are here https://github.com/Storkle/defrecord2 basically, i modified it to work with print-dup and i got rid of the pprint methods and changed the way constructor names are specified. so

Re: Matrix transform

2011-02-04 Thread Robert McIntyre
Could you possibly put up a minimal example of code that shows the problem? I'm having a hard time following exactly what you're doing but would like to help. :) sincerely, --Robert McIntyre On Fri, Feb 4, 2011 at 10:20 AM, Nick npatric...@gmail.com wrote: I've got a matrix transformation

Re: XML navigation puzzles

2011-02-04 Thread yiguang hu
Thanks a lot for both responses. I really appreciate it! The zip is really nice. On Fri, Feb 4, 2011 at 11:39 AM, Despite desp...@gmail.com wrote: I like to use zip and zip-filter with xml files.  For example (suppose clojure.zip is aliased as zip and clojure.contrib.zip-filter.xml is

Re: java interop question

2011-02-04 Thread clwham...@gmail.com
Yes, Ken's original suggestion was correct -- the clojure code had to look like a real java bean. It works perfectly now, so thanks! On Feb 3, 3:55 pm, Stuart Sierra the.stuart.sie...@gmail.com wrote: I don't know what select * from StockTick(symbol=... is doing, but it looks like the error is

Re: Matrix transform

2011-02-04 Thread Ken Wesson
If you need efficient numeric matrix operations, your best bet is to move away from higher level abstractions like seqs and (especially) refs and just use a one-dimensional Java array of primitives of size (* m n), and indexed as (+ (* i m) j) or (+ (* j n) i) using primitive arithmetic for speed.

Re: Confusion about JARs Leiningen

2011-02-04 Thread Conrad
Thanks guys for the informative replies! -Conrad On Feb 4, 11:30 am, Conrad drc...@gmail.com wrote: Hi everyone: Even though I'm an intermediate clojure user, I realize there's some basic things I just don't understand about JARs and Leiningen. It seems to me the answers to these questions

Re: Hosted REPL, suggestions?

2011-02-04 Thread Mark Fredrickson
Thanks to one and all for the replies. For the moment, I'm going to concentrate on the DSL itself and start puttering with a Clojure parser for CodeMirror (http://codemirror.net/), a JavaScript text editor, which should be simplified by cribbing from the Scheme parser implementation. This is

searching for a good name thread-let, thread-with, thread-thru

2011-02-04 Thread B Smith-Mannschott
Clojure's threading macros - and - to be quite a win. It breaks down when the expression to be chained together are not consistent in nesting the threaded expression second or last. An idiomatic way to gain the necessary flexibility seems to be via let: (let [x (line-seq x) x (sort x)

Re: searching for a good name thread-let, thread-with, thread-thru

2011-02-04 Thread Ken Wesson
On Fri, Feb 4, 2011 at 3:05 PM, B Smith-Mannschott bsmith.o...@gmail.com wrote: (defmacro thread-let [[varname init-expression :as binding] expressions]  {:pre [(symbol? varname)         (not (namespace varname))         (vector? binding)         (= 2 (count binding))]}  `(let

Re: searching for a good name thread-let, thread-with, thread-thru

2011-02-04 Thread Alan
Another solution, which is not especially satisfying but is worth considering, is to use the most-common thread style at the top level, and interweave some exceptions for the less-common style. (- 10 range 20 (- take 2)) or (- 10 (#(range % 20)) (take 2)) On Feb 4, 12:05 pm, B

Re: searching for a good name thread-let, thread-with, thread-thru

2011-02-04 Thread Alan
Missing some parens there. Should be (- (take 2)), of course. On Feb 4, 12:53 pm, Alan a...@malloys.org wrote: Another solution, which is not especially satisfying but is worth considering, is to use the most-common thread style at the top level, and interweave some exceptions for the

Re: searching for a good name thread-let, thread-with, thread-thru

2011-02-04 Thread Michael Ossareh
On Fri, Feb 4, 2011 at 12:05, B Smith-Mannschott bsmith.o...@gmail.comwrote: I came up with this macro, but I'm unsure what to call it: (defmacro thread-let [[varname init-expression :as binding] expressions] {:pre [(symbol? varname) (not (namespace varname)) (vector?

Re: Hosted REPL, suggestions?

2011-02-04 Thread Rayne
Exciting. Keep me updated. On Feb 4, 1:39 pm, Mark Fredrickson mark.m.fredrick...@gmail.com wrote: Thanks to one and all for the replies. For the moment, I'm going to concentrate on the DSL itself and start puttering with a Clojure parser for CodeMirror (http://codemirror.net/), a JavaScript

Re: searching for a good name thread-let, thread-with, thread-thru

2011-02-04 Thread Hugo Duncan
On Fri, 04 Feb 2011 15:05:39 -0500, B Smith-Mannschott bsmith.o...@gmail.com wrote: What should I name this thing? I'm concerned that thread is confusing due to its dual meaning. let seems in line with clojure conventions. (thread-let [x ...] ...) (thread-with [x ...] ...) (thread-through [x

Re: Confusion about JARs Leiningen

2011-02-04 Thread Phil Hagelberg
On Feb 4, 11:06 am, Conrad drc...@gmail.com wrote: Thanks guys for the informative replies! Probably also worth reading the tutorial (lein help tutorial in recent versions) as it covers these questions in more depth. -Phil -- You received this message because you are subscribed to the Google

Any news on pull requests?

2011-02-04 Thread Eugen Dück
In June 2009, Rich wrote in clojure goes git!: Some items are still outstanding: Importation of existing issues Placement of generated contrib documentation Patch submission policy In particular, please don't send pull requests via GitHub at this time. Any updates

Re: Any news on pull requests?

2011-02-04 Thread Sean Corfield
On Fri, Feb 4, 2011 at 5:24 PM, Eugen Dück eu...@dueck.org wrote: Furthermore, I was really surprised to find on http://clojure.org/contributing that I have to send a (non-e)mail around the world to be able to contribute Written acceptance of a contributor's agreement is fairly common on large

Re: Any news on pull requests?

2011-02-04 Thread Eugen Dück
On Feb 5, 11:00 am, Sean Corfield seancorfi...@gmail.com wrote: On Fri, Feb 4, 2011 at 5:24 PM, Eugen Dück eu...@dueck.org wrote: Furthermore, I was really surprised to find onhttp://clojure.org/contributing that I have to send a (non-e)mail around the world to be able to contribute

Re: Any news on pull requests?

2011-02-04 Thread Mike Meyer
On Fri, 4 Feb 2011 18:00:24 -0800 Sean Corfield seancorfi...@gmail.com wrote: On Fri, Feb 4, 2011 at 5:24 PM, Eugen Dück eu...@dueck.org wrote: Furthermore, I was really surprised to find on http://clojure.org/contributing that I have to send a (non-e)mail around the world to be able to

Re: Any news on pull requests?

2011-02-04 Thread Sean Corfield
On Fri, Feb 4, 2011 at 6:16 PM, Eugen Dück eu...@dueck.org wrote: Is it really necessary, though? We all agree to EULAs and make other more significant legal commitments online all the time, and in some cases without having proven who and where we are. There are certainly some legal

Re: Any news on pull requests?

2011-02-04 Thread Ken Wesson
On Fri, Feb 4, 2011 at 9:36 PM, Sean Corfield seancorfi...@gmail.com wrote: On Fri, Feb 4, 2011 at 6:16 PM, Eugen Dück eu...@dueck.org wrote: Is it really necessary, though? We all agree to EULAs and make other more significant legal commitments online all the time, and in some cases without

Re: Any news on pull requests?

2011-02-04 Thread Mike Meyer
On Fri, 4 Feb 2011 18:36:34 -0800 Sean Corfield seancorfi...@gmail.com wrote: On Fri, Feb 4, 2011 at 6:16 PM, Eugen Dück eu...@dueck.org wrote: Is it really necessary, though? We all agree to EULAs and make other more significant legal commitments online all the time, and in some cases

Re: Any news on pull requests?

2011-02-04 Thread Sean Corfield
On Fri, Feb 4, 2011 at 6:39 PM, Ken Wesson kwess...@gmail.com wrote: It says Transfer of a right on a nonexclusive basis does not require a written agreement. As long as Clojure gets a worldwide, nonexclusive, royalty-free license with EPL-compatible redistribution terms, that ought to be good

Re: Any news on pull requests?

2011-02-04 Thread Eugen Dück
On Feb 5, 11:51 am, Sean Corfield seancorfi...@gmail.com wrote: off to Rich... If someone really feels signing and mailing an agreement is too much work then they don't seem very committed to contributing, IMO. It's really not much of a hardship is it? Things like github's pull requests are

Re: Any news on pull requests?

2011-02-04 Thread Ken Wesson
On Fri, Feb 4, 2011 at 9:51 PM, Sean Corfield seancorfi...@gmail.com wrote: On Fri, Feb 4, 2011 at 6:39 PM, Ken Wesson kwess...@gmail.com wrote: It says Transfer of a right on a nonexclusive basis does not require a written agreement. As long as Clojure gets a worldwide, nonexclusive,

force evaluation of macro parameter

2011-02-04 Thread Eugen Dück
I'm using a macro that, stripped down to just expose my problem, looks like this: (defmacro quoted-param [x] `(println '~x)) It's all nice if I call it like (quoted-param 23) It will print the number 23. The following, however, will print asdf, rather than 23: (def asdf 23) (quoted-param

Re: force evaluation of macro parameter

2011-02-04 Thread Ken Wesson
On Fri, Feb 4, 2011 at 11:24 PM, Eugen Dück eu...@dueck.org wrote: I'm using a macro that, stripped down to just expose my problem, looks like this: (defmacro quoted-param  [x]  `(println '~x)) It's all nice if I call it like (quoted-param 23) It will print the number 23. The

Re: force evaluation of macro parameter

2011-02-04 Thread Eric Lavigne
Which is of course what the quote is supposed to do. But is there any way to get that macro to expand to using the value of asdf, rather than the symbol itself? Or can only changing the macro fix this? I fear the latter, which would imply that using quotes like that in a macro should be done

Which branch of clojure-hadoop to use?

2011-02-04 Thread Benny Tsai
I have a bunch of older computers sitting at home, and thought I'd put them to use for experimenting with clojure-hadoop and swarmiji. However, I can't figure out which branch of clojure-hadoop to use. Stuart Sierra's branch looks like the canonical one, but hasn't been updated since March 2010.

Re: force evaluation of macro parameter

2011-02-04 Thread Eugen Dück
On Feb 5, 1:52 pm, Eric Lavigne lavigne.e...@gmail.com wrote: This makes me think that the original macro needs some refactoring. There should be a function that handles most of the work, and a macro to make your code shorter in the common case. (defn unquoted-param [x] (println x))

Re: Any news on pull requests?

2011-02-04 Thread Christopher Petrilli
On Fri, Feb 4, 2011 at 10:35 PM, Ken Wesson kwess...@gmail.com wrote: Perhaps. But it's well known that any barrier to participation causes a percentage drop in same. This topic keeps coming up, and while a large number of people have signed CAs (many of us at the conference last year), people

Re: force evaluation of macro parameter

2011-02-04 Thread Ken Wesson
On Sat, Feb 5, 2011 at 12:08 AM, Eugen Dück eu...@dueck.org wrote: yes, the code is more complex and it is in contrib. Changing contrib requires you to send an intercontinental mail first, as mentioned in my other post today... :) Reason enough to first checkout the other options and dig

Re: Deflayout - define Swing UI declaratively

2011-02-04 Thread Alan
That's not how macros work. They can only operate on the parameters they're passed, as symbols and lists. If you prepare a value for them elsewhere, those values will only be available in the macroexpansion (runtime), not at compile time. Granted, it would be nice if the functionality were

Re: Deflayout - define Swing UI declaratively

2011-02-04 Thread Ken Wesson
On Sat, Feb 5, 2011 at 1:01 AM, Alan a...@malloys.org wrote: That's not how macros work. They can only operate on the parameters they're passed, as symbols and lists. Clojure macros can also see literal maps, sets, and vectors, not to mention integers, strings, and the like. (Ever seen