Re: classpath in clojure box

2010-01-14 Thread brian
Shawn Hoover wrote: On Wed, Jan 13, 2010 at 8:38 PM, brian > wrote: I was wondering if this is the right statement for setting the external classpath? setq swank-clojure-classpath Another way is to use M-x swank-clojure-project. You enter a directory

Re: classpath in clojure box

2010-01-14 Thread Michael Wood
2010/1/14 brian : > Shawn Hoover wrote: >> >> On Wed, Jan 13, 2010 at 8:38 PM, brian > > wrote: >> >> >>    I was wondering if this is the right statement for setting the >>    external  classpath? >> >>    setq swank-clojure-classpath >> >> >> Another way is to use M-x swa

Re: classpath in clojure box

2010-01-14 Thread brian
Michael Wood wrote: 2010/1/14 brian : Shawn Hoover wrote: On Wed, Jan 13, 2010 at 8:38 PM, brian mailto:brw...@gmail.com>> wrote: I was wondering if this is the right statement for setting the external classpath? setq swank-clojure-classpath Another way is to use M-x swan

Re: classpath in clojure box

2010-01-14 Thread brian
Michael Wood wrote: 2010/1/14 brian : Shawn Hoover wrote: On Wed, Jan 13, 2010 at 8:38 PM, brian mailto:brw...@gmail.com>> wrote: I was wondering if this is the right statement for setting the external classpath? setq swank-clojure-classpath Another way is to use M-x swan

Re: I'm going to teach Clojure at university - suggestions/comments?

2010-01-14 Thread Jeff Rose
Dober dan gospodine, A few years ago I taught two semesters of web application programming to undergraduates using Ruby on Rails. None of them had any experience with either programming in Ruby or developing for the web before we started, but by most accounts it was a success. Maybe some of what

Re: I'm going to teach Clojure at university - suggestions/comments?

2010-01-14 Thread Dragan Djuric
Thanks Jeff, that was a really interesting report. I'd like to do something like this - unfortunately, it's difficult to enforce here because many students would start the riots (just kidding) :) As for the local economy, it's not a problem in a sense of employment opportunity - half of them even

Re: classpath in clojure box

2010-01-14 Thread Shawn Hoover
On Thu, Jan 14, 2010 at 3:17 AM, brian wrote: > The above didn't work, but apparently it doesn't pick up my .emacs file, > which has > > (setq swank-clojure-classpath >(list "c:/shcloj-code/code/examples")) > > itknows where home is, when it boots up, the default is my home dir, where > .emac

Re: Help needed regarding the "let"

2010-01-14 Thread Graham Fawcett
Hi, On Wed, Jan 13, 2010 at 1:30 AM, Manish wrote: > Thanx for ur response, > Actually We are using string builder in our project, String Builder > causing the memory leak in as I google, Thats the main reason i want > to set the StringBuilder object to nil, > We are using the htmlunit core js li

NYC Clojure Users Group Meeting for Jan 28th - I reserved a bigger space!

2010-01-14 Thread Eric Thorsen
I've reserved a larger space to accommodate 55 people (we were out of room). There will be desks in the front and rows of seats in the back so come a bit early if you want a desk. For more details, see the full listing: http://www.meetup.com/Clojure-NYC/calendar/12228936/ When: Thursday, January 2

[ANN] units.clj - unit conversion functions without repeating yourself

2010-01-14 Thread Scott Jaderholm
Hi, I created a library that provides unit conversion functions[1] for several common units and allows you to define new units conversions with a single equation. The library does a few interesting things automatically: First, if you define inches-to-feet, it will create feet-to-inches for you.

NullPointerException from #'> et al.

2010-01-14 Thread C. Florian Ebeling
Hi, out of curiosity, what is the reasoning behind this behavior (I'm pretty sure it is intended): (= nil 1) => false (> nil 1) ;; NullPointerException Same behavior for >= <= etc. Florian -- Florian Ebeling florian.ebel...@gmail.com -- You received this message because you are subscribed

Re: NullPointerException from #'> et al.

2010-01-14 Thread ataggart
What do you think should be the boolean result of (> nil 1)? Since the inequality functions only work with Numbers, and nil is not a Number. The only way to make that work would be to impute some default numerical value to nil, which would probably introduce more problems than it solved. On Jan

Re: NullPointerException from #'> et al.

2010-01-14 Thread C. Florian Ebeling
> What do you think should be the boolean result of (> nil 1)? > > Since the inequality functions only work with Numbers, and nil is not > a Number.  The only way to make that work would be to impute some > default numerical value to nil, which would probably introduce more > problems than it solve

Re: [ANN] units.clj - unit conversion functions without repeating yourself

2010-01-14 Thread Brian
This is more java related but there is a java library and application ( http://futureboy.us/frinkdocs/) that provides a set of very powerful unit conversion tools. On Thu, Jan 14, 2010 at 10:49 AM, Scott Jaderholm wrote: > Hi, > > I created a library that provides unit conversion functions[1] fo

Re: deftype and macros

2010-01-14 Thread Konrad Hinsen
On 14.01.2010, at 08:35, Konrad Hinsen wrote: This one failed yesterday on my office computer, but now I tried it again at home and it works fine: .. I'll check again on my office machine later today. It failed indeed, but after recompilation of Clojure and Contrib it works fine now. Sorr

Compilation-aware code?

2010-01-14 Thread ataggart
Some people have had issues with c.c.logging in that it looks for a suitable logging implementation at macro-expansion-time (by simply trying to import the necessary classes), which thus also occurs during AOT compilation; the down-side is that if the desired logging lib is not on the classpath dur

Re: Compilation-aware code?

2010-01-14 Thread Cyrus Harmon
hmm... perhaps one could have a form called something like ... oh, I dunno, maybe ... eval-when! And then one could have situations like :compile-toplevel and :load-toplevel and, maybe, :execute. Nah... that's a crazy idea; never mind... :) Cyrus On Jan 14, 2010, at 9:22 AM, ataggart wrote:

Re: Compilation-aware code?

2010-01-14 Thread ataggart
I'm detecting sarcasm, but it's not clear to me what point you're trying to make. Care to be more helpful or enlightening? On Jan 14, 12:09 pm, Cyrus Harmon wrote: > hmm... perhaps one could have a form called something like ... oh, I dunno, > maybe ... eval-when! And then one could have situa

Re: NullPointerException from #'> et al.

2010-01-14 Thread ataggart
On Jan 14, 9:00 am, "C. Florian Ebeling" wrote: > > What do you think should be the boolean result of (> nil 1)? > > > Since the inequality functions only work with Numbers, and nil is not > > a Number.  The only way to make that work would be to impute some > > default numerical value to nil, w

Re: NullPointerException from #'> et al.

2010-01-14 Thread ataggart
Also, it is consistent given that == is the numerical analogue to <=, etc. -- 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 members are moderated - please be patient

Re: Compilation-aware code?

2010-01-14 Thread Cyrus Harmon
I was referring to common lisp's eval-when special operator: http://www.lispworks.com/documentation/HyperSpec/Body/s_eval_w.htm cyrus On Jan 14, 2010, at 12:22 PM, ataggart wrote: > I'm detecting sarcasm, but it's not clear to me what point you're > trying to make. Care to be more helpful or

Re: units.clj - unit conversion functions without repeating yourself

2010-01-14 Thread Mike Davis
On Jan 14, 10:12 am, Brian wrote: > This is more java related but there is a java library and application > (http://futureboy.us/frinkdocs/) that provides a set of very powerful unit > conversion tools. I have always liked the units tool available here: http://www.gnu.org/software/units/. I

Re: Redis-Clojure: NoRouteToHostException

2010-01-14 Thread mudphone
Timothy, Thanks for the suggestion. Creating a million keys within the same with-server is possible, without seeing the NoRouteToHostException. So, hitting with-server so many times in so short a time period is definitely a bad idea (duh). So, I think there is a problem with how my larger progra

Re: NullPointerException from #'> et al.

2010-01-14 Thread Timothy Pratley
2010/1/15 C. Florian Ebeling : > I agree. It only looks inconsistent when you assume nil is treated > uniformly by these comparison function, which does not make sense. I quite often wish to compare comparable objects that are not numbers and wrote some simple operators to do that: user=> ( ( ( (

StackOverflowError possible with seq ?

2010-01-14 Thread mudphone
Is it possible that the Clojure core seq function can cause a stack overflow (since it calls itself)? Or is there some other manner in which misuse of a lazy seq could cause this? In the stack trace below, I'm seeing repeated calls to "seq" in clojure core, until the stack is blown. Thanks, Kyle

ANN: dgraph 1.0, a dependency graph library for Clojure

2010-01-14 Thread Constantine Vetoshev
I would like to announce the release of dgraph 1.0, a dependency graph implementation for Clojure. http://github.com/gcv/dgraph dgraph provides a mostly pure functional data structure whose nodes behave like cells in a spreadsheet. Data changes in stored nodes cause their dependent computed nodes

Many foolish questions

2010-01-14 Thread Simon Brooke
OK, I'm trying to get seriously stuck in, and the first thing I'm trying to do is reimplement an inference engine I first wrote in Portable Standard Lisp and then in InterLisp-D in /idiomatic/ Clojure. So please have patience with me... If one has something which is strongly typed, is it idiomatic

Re: ANN: dgraph 1.0, a dependency graph library for Clojure

2010-01-14 Thread Timothy Pratley
Hi Constantine, Very interesting! I'll definitely be trying this out. To give me a head-start, are there key differences with clojure.contrib.dataflow so I can better understand? Regards, Tim. 2010/1/15 Constantine Vetoshev : > I would like to announce the release of dgraph 1.0, a dependency g

Re: units.clj - unit conversion functions without repeating yourself

2010-01-14 Thread Simon Brooke
On 14 Jan, 15:49, Scott Jaderholm wrote: > Hi, > > I created a library that provides unit conversion functions[1] for > several common units and allows you to define new units conversions > with a single equation. > > The code is athttp://gist.github.com/276662#file_units.clj > > I'd love to recei

how can i better write this (reflection, str)?

2010-01-14 Thread Raoul Duke
hi, i'm guessing there is a more Clojure-y and compact way to do this. any suggestions would be appreciated. thank you. (defn reflection-dump [o] (let [methods (.getDeclaredMethods o) method-count (alength methods) method-dumps (map (fn [i] (str " " i ": " (nth methods i))) (ran

Re: Creating an object given a class object

2010-01-14 Thread evins.mi...@gmail.com
On Jan 12, 1:50 am, Konrad Hinsen wrote: > On 11 Jan 2010, at 23:09, .Bill Smith wrote: > > > Every class object has a newInstance method: > > > user=> (Class/forName "java.util.HashMap") > > java.util.HashMap > > user=> (.newInstance (Class/forName "java.util.HashMap")) > > # > > user=> > > > I

Re: Many foolish questions

2010-01-14 Thread Richard Newman
but the reader spits an illegal argument exception. Is there different syntax which the reader could parse? Or am I using the wrong kind of thing? Wrong kind of thing. defstruct defines a struct-map, which is simply a map with some guaranteed keys. It doesn't make any assertions about the va

Re: I'm going to teach Clojure at university - suggestions/comments?

2010-01-14 Thread Eric Lavigne
>> The issue that is >> particularly interesting to me to explore is how alien Clojure is to >> Java programmers, what are subjective and objective causes, and how >> hard is to overcome each of the identified issues. > > This sounds very interesting. I try to explain the point of lisp to > java pr

Re: how can i better write this (reflection, str)?

2010-01-14 Thread .Bill Smith
You might change the method-dumps definition to this: method-dumps (map (fn [i x] (str " " i ": " x)) (range 0 method-count) methods) It isn't more compact but I suppose it's more Clojure-y. On Jan 14, 6:49 pm, Raoul Duke wrote: > hi, > > i'm guessing there is a more Clojure-y and compact way t

Re: how can i better write this (reflection, str)?

2010-01-14 Thread Adrian Cuthbertson
How about; (defn reflection-dump [o] (let [methods (seq (.getDeclaredMethods o)) ] (str o " has " (count methods) "methods...\n" (second (reduce (fn [[i st] meth] [(inc i) (str st "meth" i ": " meth "\n")]) [0 ""] methods) (print (reflection-dump java.io.InputStream)) class java

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

2010-01-14 Thread Perry Trolard
On Jan 12, 8:58 pm, aria42 wrote: > I was seeing this error too and I reckoned it was because my > clojure.contribwas not compatible with clojure core. I think if > you're using1.2master of clojure you need 1.1 master ofcontrib. Is that right? The 1.1 new branch of Contrib is compatible, at least

Re: Funding Clojure 2010

2010-01-14 Thread Brian Goslinga
I think it would be useful if there was some way to (mostly) automatically donate $10/month. -- 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 members are moderated -

Re: Funding Clojure 2010

2010-01-14 Thread Giancarlo Angulo
I second this. = angol = -|-^...@^_^, =|+^_^X++~_~,@- www.onthe8spot.com http://www.facebook.com/giancarlo.angulo http://twitter.com/Neoryder On Fri, Jan 15, 2010 at 1:29 PM, Brian Goslinga wrote: > I think it would be useful if there was some way to (mostly) > automatically