How to deal with clojure versions in libs

2010-04-18 Thread Heinz N. Gies
Hi I'm not certain how to approach this problem the best, since libraries are compiled class files they are statically linked to the clojure and c.c version they were compiled with. Please correct me if I'm wrong. Now also between 1.1 and 1.2 some namespaces changed entirely so some code had to

Re: platform-specific unit test failures in cc.test-complex-numbers

2010-04-18 Thread Rich Hickey
On Apr 17, 2010, at 3:50 PM, B Smith-Mannschott wrote: On Sat, Apr 17, 2010 at 21:32, Stuart Halloway stuart.hallo...@gmail.com wrote: It's almost certainly the commit that added the InternalReduce protocol: 5b281880571573c5917781de932ce4789f18daec. I am slowly pounding my skull against

Extending Java class in Clojure with multiple constructors

2010-04-18 Thread David McNeil
When extending a Java class in Clojure, what is a clean way to support multiple constructors in the base class? Below is a sample of how I accomplished this. The key point is that the base class has two constructors and to expose both of these in Clojure I needed to create two proxies. I used a

Re: Dead easy start with Clojure on windows

2010-04-18 Thread Kasim
Thanks Mark. I updated the Wiki with more information. I also added a simple bash script so one can use ClojureW on Mac and Linux, which I often do. I will add a readme shortly. During the mean time, here is the Wiki text: ClojureW makes it dead easy to start with Clojure on Windows, Mac and

Re: Dead easy start with Clojure on windows

2010-04-18 Thread Kasim
Thanks Zmitro for pointing this out. Here is the updated information: Here are what you need to get started : 1. Download from http://bitbucket.org/kasim/clojurew/get/tip.zip 2. Set CLOJURE_HOME = path/to/unzipped/folder Note: For Mac and Linux, put these line in your .profile file

Re: Version of netbeans with extra Clojure and Polyglot Maven/Leiningen support ...

2010-04-18 Thread Steve
On Apr 12, 4:58 pm, Antony Blakey antony.bla...@gmail.com wrote: I also have a version (1.1.1) of the Enclojure plugin that fixes the can't-find-clojure-jar when starting a project REPL (which is 100% of the time with my version of NB). I've sent a pull request to Eric, but in the meantime

Re: binary structures/bitstrings

2010-04-18 Thread Geoff
I've implemented something similar for working with java.nio.ByteBuffer objects to pull apart and build network packets, but it's not packaged as a separate library right now. Look at http://github.com/geoffsalmon/bonjure/blob/master/src/bonjure/bytebuffer.clj specifically the pack, unpack,

Error whitch i don't understand

2010-04-18 Thread Yonov
Hi, I am trying to implement memoize myself and have stucked on one place for a lot of time. This is the code: (defn mymemoize [func] (let [dict (ref (hash-map)) inner #((let [val (@dict %)] (if (nil? val) (do (dosync (alter

Re: Error whitch i don't understand

2010-04-18 Thread Stephen C. Gilardi
On Apr 18, 2010, at 9:21 AM, Yonov wrote: Hi, I am trying to implement memoize myself and have stucked on one place for a lot of time. This is the code: (defn mymemoize [func] (let [dict (ref (hash-map)) inner #((let [val (@dict %)] (if

Re: Interrupting the Repl

2010-04-18 Thread Stephen C. Gilardi
On Apr 16, 2010, at 2:06 AM, Brian Watkins wrote: Is there a way to interrupt the Repl when I've set to some kind of infinite loop without also shutting down the JVM entirely? Yes there is. clojure-contrib includes add-break-thread! to do just that. Here's an example: % java -cp

Re: Has deftype changed?

2010-04-18 Thread Praki Prakash
Thanks Andrew. I did catch 'this' argument requirement sometime back but the 'new' bit escaped me. Praki On Sat, Apr 17, 2010 at 6:16 PM, Andrew Stein steinl...@gmail.com wrote: (deftype Bar [a b c d e]) (def b (new Bar 1 2 3 4 5)) There are a few other syntax changes too, defrecord

Any Clojure job out there?

2010-04-18 Thread Nicolas Buduroi
Hi, I've been having lots of fun in the past months working in Clojure only on my own time and wonder if there's opportunities to be paid for it. Our community is growing everyday and I've heard that Clojure is being more and more used in the real world. So, is there any job opening for us

New Recruit

2010-04-18 Thread llcawthorne
Hello! I normally lurk on lists a bit before introducing myself (if I ever introduce myself), but I just wanted to say hello; especially since it tends to take a little bit to ascertain the norms on any given list, but what the heck, eh? I saw Aaron Bedra's presentation on Clojure at the

Re: Error whitch i don't understand

2010-04-18 Thread Yonov
Thanks, a lot! It seems that there is no nice way to make a shortened lambda function which returns an integer. I mean #(1) is not OK, and #1 is not OK. Although there is no problem with this (fn [] 1). On Apr 18, 5:48 pm, Stephen C. Gilardi squee...@mac.com wrote: On Apr 18, 2010, at 9:21 AM,

Re: help wanted: tests for c.c.io

2010-04-18 Thread Daniel Glauser
Hi Stuart, I would like to help as well. Just signed up for Clojure Dev and an Assembla account. I'll send in my CA tomorrow. id: danielglauser Thanks, Daniel On Apr 15, 1:10 pm, Stuart Halloway stuart.hallo...@gmail.com wrote: You are added. Thanks! I'll take a stab at it.    Can you

Re: Error whitch i don't understand

2010-04-18 Thread Joop Kiefte
you can do #(identity 1) 2010/4/18 Yonov myo...@gmail.com Thanks, a lot! It seems that there is no nice way to make a shortened lambda function which returns an integer. I mean #(1) is not OK, and #1 is not OK. Although there is no problem with this (fn [] 1). On Apr 18, 5:48 pm, Stephen

Re: Error whitch i don't understand

2010-04-18 Thread Joop Kiefte
Now I took a look at your code =x, i think you can let it work using #(let instead of #((let 2010/4/18 Joop Kiefte iko...@gmail.com you can do #(identity 1) 2010/4/18 Yonov myo...@gmail.com Thanks, a lot! It seems that there is no nice way to make a shortened lambda function which returns

Re: How to deal with clojure versions in libs

2010-04-18 Thread Phil Hagelberg
If you want to maintain backwards compatibility with 1.1, there are a few gotchas: * don't use 1.2-specific features like deftype, obviously. * don't aot-compile anything. If you need gen-class *and* 1.1, you can clearly document which nses need it and require your users to perform the

Re: Has deftype changed?

2010-04-18 Thread Rob Lachlan
For deeftype, has the syntax for field accessors changed too? I can't get it to work: user (deftype someType [b f]) user.someType user (def y (new someType 2 3)) #'user/y user (:b y) nil user (:f y) nil defrecord works as expected, though. On Apr 17, 6:16 pm, Andrew Stein steinl...@gmail.com

Re: Has deftype changed?

2010-04-18 Thread David Nolen
On Sun, Apr 18, 2010 at 1:49 PM, Rob Lachlan robertlach...@gmail.comwrote: For deeftype, has the syntax for field accessors changed too? I can't get it to work: user (deftype someType [b f]) user.someType user (def y (new someType 2 3)) #'user/y user (:b y) nil user (:f y) nil

Re: New Recruit

2010-04-18 Thread Nicolas Buduroi
Welcome aboard! On Apr 18, 10:54 am, llcawthorne llcawtho...@archlinux.us wrote: Hello! I normally lurk on lists a bit before introducing myself (if I ever introduce myself), but I just wanted to say hello; especially since it tends to take a little bit to ascertain the norms on any given

Re: Has deftype changed?

2010-04-18 Thread ataggart
My sense from the changes is that defrecord is the map-like one, whereas deftype is the lower-level construct used to implement stuff like clojure collections. I imagine users will use defrecord more often than deftype. On Apr 18, 10:49 am, Rob Lachlan robertlach...@gmail.com wrote: For

Re: Extending Java class in Clojure with multiple constructors

2010-04-18 Thread Stephan Mühlstrasser
On 18 Apr., 01:51, David McNeil mcneil.da...@gmail.com wrote: My question is: is there a better way to accomplish this, perhaps using a mechanism other than proxy? You can do that with gen-class: http://richhickey.github.com/clojure/clojure.core-api.html#clojure.core/gen-class. ... By

Re: Error whitch i don't understand

2010-04-18 Thread Michael Wood
On 18 April 2010 19:36, Joop Kiefte iko...@gmail.com wrote: you can do #(identity 1) Or #(do 1). 2010/4/18 Yonov myo...@gmail.com Thanks, a lot! It seems that there is no nice way to make a shortened lambda function which returns an integer. I mean #(1) is not OK, and #1 is not OK.

Re: Error whitch i don't understand

2010-04-18 Thread Meikel Brandmeyer
Hi, On Sun, Apr 18, 2010 at 07:36:23PM +0200, Joop Kiefte wrote: you can do #(identity 1) As well as #(do 1). The core function constantly works the same and conveys the intention as well: (constantly 1). Sincerely Meikel -- You received this message because you are subscribed to the Google

Re: New Recruit

2010-04-18 Thread Seth
Since you are really interested in both Clojure and statistics, might I recommend two RSS feeds: * The Incanter RSS feed -- you might already have this but just in case. @liebke pays close attention to documentation in Incanter and as well as comments to the blog. http://incanter-blog.org/feed/

Re: Has deftype changed?

2010-04-18 Thread Praki Prakash
That was my interpretation as well. I now have defrecord instead of deftype everywhere. It looks like deftype was refactored into deftype and defrecord. deftype implements none of the usual interfaces (IPersistentMap) whereas defrecord does. Praki On Sun, Apr 18, 2010 at 11:33 AM, ataggart

Not so happy with my code

2010-04-18 Thread verec
I have two problems with the following code. First, I have this `tos' business (to-string) because: user= (first abc) \a user= (rest abc) (\b \c) Since I wanted to get strings out of strings, a character or a collection is no good. Second, I ended-up having to use a mutable atom `res' because I

Re: Not so happy with my code

2010-04-18 Thread verec
Posted too quickly ... replace ana3 with anagram. I cleaned-up the code before posting, forgetting that the previous version ana3 was still in the REPL ... Oh well ... -- You received this message because you are subscribed to the Google Groups Clojure group. To post to this group, send email to

Re: Not so happy with my code

2010-04-18 Thread David Nolen
On Sun, Apr 18, 2010 at 9:20 PM, verec jeanfrancois.brouil...@googlemail.com wrote: I have two problems with the following code. First, I have this `tos' business (to-string) because: user= (first abc) \a user= (rest abc) (\b \c) Since I wanted to get strings out of strings, a character

Re: Not so happy with my code

2010-04-18 Thread Per Vognsen
(use 'clojure.contrib.combinatorics 'clojure.contrib.str-utils) (defn anagrams [xs] (map #(str-join %) (distinct (permutations xs Of course, the real meat is in the permutations function. The implementation in the combinatorics library is a bit complicated. Here's something simpler

Re: Any Clojure job out there?

2010-04-18 Thread Steven Shaw
On 19 April 2010 02:59, Nicolas Buduroi nbudu...@gmail.com wrote: Hi, I've been having lots of fun in the past months working in Clojure only on my own time and wonder if there's opportunities to be paid for it. Our community is growing everyday and I've heard that Clojure is being more and

Re: binary structures/bitstrings

2010-04-18 Thread Scott T
Well, network packets would also be a good use of what I was looking for and it looks *very* much like something useful for what I want. I'll clone it and try it in the next few days. My intention is to use it for some low-level structures inside virtual disk files... I haven't done anything

questions about clojure's core library organization

2010-04-18 Thread falcon
Hi, I am trying to understand clojure and found a couple of interesting things about the core library: 1. core.clj is a gigantic library with more than 400 function definitions (378 defns and 62 defmacros to be exact). I didn't expect to find sequence related functions, such as map/reduce in

Re: questions about clojure's core library organization

2010-04-18 Thread Richard Newman
Something like the 'for' macro (if it is thought of as a non-general monad) can be implemented in terms of reduce. Is there a reason this isn't so? I can think of two: * filter and map are lazy. Implementing every? and some? in those terms would needlessly introduce lazy sequences to the

Re: questions about clojure's core library organization

2010-04-18 Thread Per Vognsen
On Mon, Apr 19, 2010 at 10:30 AM, falcon shahb...@gmail.com wrote: 1. core.clj is a gigantic library with more than 400 function definitions (378 defns and 62 defmacros to be exact).  I didn't expect to find sequence related functions, such as map/reduce in core. Doesn't it make sense to move

Re: questions about clojure's core library organization

2010-04-18 Thread Per Vognsen
How about this: Symbols in namespaces are optionally organized into groups. The vehicle might be something as simple as a :group metadata entry on the symbols. When symbols from other namespaces are referred, new local copies are created with :group metadata equal to the namespace name. When

Re: questions about clojure's core library organization

2010-04-18 Thread falcon
As I understand it, map is, itself, lazy. Does that mean that using map to implement these methods would create extra intermediate structures? What if often used functions such as map/reduce/filter were macros, that could 'deforest' (to use Haskell terminology) these intermediate structures?

Re: questions about clojure's core library organization

2010-04-18 Thread Per Vognsen
On Mon, Apr 19, 2010 at 12:15 PM, falcon shahb...@gmail.com wrote: As I understand it, map is, itself, lazy. Does that mean that using map to implement these methods would create extra intermediate structures? Yes. What if often used functions such as map/reduce/filter were macros, that

Re: How to deal with clojure versions in libs

2010-04-18 Thread Heinz N. Gies
Hi phil, thanks for the answer many good points there. So just to be sure, if I don't add a :gen-class (which I don't need to in my case) I can use the lib with both 1.1 and 1.2 w/o problems (save for the named ones) so the lein jar jar's are not 'statically linked' (if you can call it that

Re: New Recruit

2010-04-18 Thread Heinz N. Gies
Welcome llcawthorne! Glad to have you here :) also as a advice :visit the IRC channel #clojure (on freenode) since the community there is incredible :) Regards, Heinz On Apr 18, 2010, at 16:54 , llcawthorne wrote: Hello! I normally lurk on lists a bit before introducing myself (if I ever