Re: Anonymous function syntax in R1053

2008-10-06 Thread Stephen C. Gilardi
On Oct 7, 2008, at 1:21 AM, Matthew D. Swank wrote: > > Typing #(nil) at a repl gives me: > > java.lang.NullPointerException (NO_SOURCE_FILE:1) > [Thrown class clojure.lang.Compiler$CompilerException] > [...] > However, (fn [] nil) is fine. > > Shouldn't they be equivalent? > > Thanks, > Matt Her

Anonymous function syntax in R1053

2008-10-06 Thread Matthew D. Swank
Typing #(nil) at a repl gives me: java.lang.NullPointerException (NO_SOURCE_FILE:1) [Thrown class clojure.lang.Compiler$CompilerException] Restarts: 0: [ABORT] Return to SLIME's top level. 1: [CAUSE] Throw cause of this exception Backtrace: 0: clojure.lang.Compiler.analyzeSeq(Compiler.ja

Re: For socket repl: request redirectable *err* var

2008-10-06 Thread Stephen C. Gilardi
It's either attached to this message or uploaded to the group as: redirectable-stderr.patchThanks,--Steve redirectable-err.patch Description: Binary data On Oct 6, 2008, at 8:42 PM, Rich Hickey wrote:On Oct 6, 8:37 pm, "Stephen C. Gilardi" <[EMAIL PROTECTED]> wrote:Rich,Would you accept a patch t

genclass error message

2008-10-06 Thread Chouser
Currently if you fail to provide or mis-name the main fn in a gen-class implementation, you get an error like: Exception in thread "main" java.lang.UnsupportedOperationException: net.n01se/main not defined This is wrong, since the name shouldn't be just "main". Attached is a patch to change this

Re: For socket repl: request redirectable *err* var

2008-10-06 Thread Rich Hickey
On Oct 6, 8:37 pm, "Stephen C. Gilardi" <[EMAIL PROTECTED]> wrote: > Rich, > > Would you accept a patch to implement this? > Sure - thanks. Rich > > On Sep 30, 2008, at 12:25 AM, Craig McDaniel wrote: > > > > > Yes, I'd like to see *err* added too. I did my own *err* for a custom > > REPL and

Re: For socket repl: request redirectable *err* var

2008-10-06 Thread Stephen C. Gilardi
Rich, Would you accept a patch to implement this? --Steve On Sep 30, 2008, at 12:25 AM, Craig McDaniel wrote: > > Yes, I'd like to see *err* added too. I did my own *err* for a custom > REPL and was surprised it wasn't already part of the environment just > like *out*. > > On Sep 29, 9:24 am, T

Re: What "reasoner"?

2008-10-06 Thread Parth Malwankar
Josip Gracin wrote: > Hi! > > Rich, in the Boston talk you mentioned that you're considering some > kind of a "reasoner" (if I understood correctly) for working with > databases. You also mentioned a project whose name sounded like "ios > reasoner". I can't find references on anything spelled

Re: Using Java frameworks from Clojure

2008-10-06 Thread James Reeves
On Oct 6, 11:51 pm, "Hans Huebner" <[EMAIL PROTECTED]> wrote: > Your simple example, creating a wrapper around the http client, really > shows off the problem quite well:  True, for most use cases, people > will just have the library fetch the given URL and be done with it. > But what about query

Re: Using Java frameworks from Clojure

2008-10-06 Thread Hans Huebner
On Mon, Oct 6, 2008 at 17:47, James Reeves <[EMAIL PROTECTED]> wrote: > The most important thing I can think of is to remember that your > wrapper doesn't have to be comprehensive. [...] > So long as people can go back and use the Java API to do the complex > stuff, I figure the best way to appro

Re: Using Java frameworks from Clojure

2008-10-06 Thread James Reeves
On Oct 6, 6:58 pm, Hans Hübner <[EMAIL PROTECTED]> wrote: > The API I am working with is xlightweb, an asynchronous HTTP client/ > server framework based on xSocket.  API docs are > athttp://xlightweb.sourceforge.net/core/apidocs/2_1/ > > Any thoughts would be greatly appreciated. I've been thin

Re: Clojure at Boston Lisp Meeting videos

2008-10-06 Thread Bjorn Ludvigsen
> Note that this talk was for a crowd of experienced Lispers, so may not > be the best intro if you don't know some Lisp already. I knew no Lisp, and found this talk to be the best by far. More enthusiasm and jokes, a smarter audience, and the faster speed and greater detail suited the subject ma

swank-clojure chokes reading definitions after update to svn 1053

2008-10-06 Thread Matthew D. Swank
In the *inferior-lisp* after typing a form: Exception in thread "Read Loop Thread" java.lang.RuntimeException: clojure.lang.LispReader$ReaderException: java.lang.Exception: Invalid token: swank::*load-path* at clojure.lang.AFn.run(AFn.java:42) at java.lang.Thread.run(Thread.java:

Re: Using Java frameworks from Clojure

2008-10-06 Thread Hans Hübner
On 6 Okt., 10:34, James Reeves <[EMAIL PROTECTED]> wrote: > On Oct 6, 4:21 am, Hans Hübner <[EMAIL PROTECTED]> wrote: > > > for a project, I would like to use a Java framework that exposes a > > very Javaesque API, with dozens of classes that need to be > > instantiated or used and with several in

Re: slurp is in Clojure, but spit is in Contrib?

2008-10-06 Thread Paul Barry
+1 On Oct 6, 10:43 am, "Stephen C. Gilardi" <[EMAIL PROTECTED]> wrote: > If this gets traction, please also consider a name change to something   > more along the lines of "read-file" and "write-file". > > --Steve --~--~-~--~~~---~--~~ You received this message bec

Re: class weirdness

2008-10-06 Thread Rich Hickey
On Oct 3, 3:17 pm, Stuart Halloway <[EMAIL PROTECTED]> wrote: > Thanks Stephen, Chouser, and Rich. > > Understanding the historical reason that (. SomeClass method) doesn't > work, I would be in favor of the deprecation Rich mentioned, leading > to (. SomeClass method) being able to work in the

Clojure 'to the metal'

2008-10-06 Thread cliffc
> Hi Cliff, > It was great meeting you at the JVM Summit - I learned a lot, thanks! > I know the test is over, but wanted to get you a version of your simple test > that demonstrates Clojure's ability to get to the metal on primitive numerics > when given type hints. > Attached is a new clojure.

Re: slurp is in Clojure, but spit is in Contrib?

2008-10-06 Thread Matti Jagula
On Mon, Oct 6, 2008 at 5:43 PM, Stephen C. Gilardi <[EMAIL PROTECTED]> wrote: > If this gets traction, please also consider a name change to something > more along the lines of "read-file" and "write-file". I guess that spit and slurp are more original and therefore less likely to clash with exis

Re: slurp is in Clojure, but spit is in Contrib?

2008-10-06 Thread Parth Malwankar
On Oct 6, 6:40 pm, Stuart Halloway <[EMAIL PROTECTED]> wrote: > Hi all > > For consistency, I would like to see spit moved into the boot.clj. > > This will play well with the Java crowd. For years I have poked fun of   > Java for having megabytes of core library and no simple way to save a   > f

Re: Hex literals

2008-10-06 Thread Jim Menard
On Mon, Oct 6, 2008 at 2:40 AM, Michael Wood <[EMAIL PROTECTED]> wrote: > The previous release (from June) did not support hexadecimal numbers. > Perhaps you're using that version? You are correct; the files in my clojure.jar were all dated June 12, 2008. After downloading the latest version, al

Re: true?

2008-10-06 Thread Stuart Halloway
> What if I were to add sparse vectors? Continuing down the ugly path I started, those *wouldn't* throw an exception. :-/ I am going to cease and desist now, and accept contains? as it is. But somebody is going to need to write a book to explain these odd corners to people coming from the

Re: slurp is in Clojure, but spit is in Contrib?

2008-10-06 Thread Stephen C. Gilardi
On Oct 6, 2008, at 10:16 AM, Matti Jagula wrote: > Hi all, > > On Mon, Oct 6, 2008 at 4:40 PM, Stuart Halloway > <[EMAIL PROTECTED]> wrote: >> For consistency, I would like to see spit moved into the boot.clj. > > I wholeheartedly agree. > > And I'd also like both slurp and spit to support encod

Re: safe navigation operator

2008-10-06 Thread Parth Malwankar
On Oct 6, 7:00 pm, Rich Hickey <[EMAIL PROTECTED]> wrote: > On Oct 6, 9:36 am, Stuart Halloway <[EMAIL PROTECTED]> wrote: > > > > > Yes, that's better. Glad you like the idea. > > > Does anybody not named Stuart also want to see this added to > > Clojure? ;-) > > > Stuart > > > > On Oct 3, 3:13

Re: safe navigation operator

2008-10-06 Thread Stuart Sierra
On Oct 6, 10:00 am, Rich Hickey <[EMAIL PROTECTED]> wrote: > I'm not opposed, but we'll need to find another name. Leading ? is a > likely candidate for rule syntax, and trailing means predicate. > > .?. > > ? Or, more verbosely, "nilsafe.." -Stuart Sierra --~--~-~--~~~--

Re: safe navigation operator

2008-10-06 Thread Stuart Halloway
> .?. OK with me. Needs a dorky name to match. :-) --~--~-~--~~~---~--~~ 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 To unsubscribe from this group, send

Re: slurp is in Clojure, but spit is in Contrib?

2008-10-06 Thread Matti Jagula
Hi all, On Mon, Oct 6, 2008 at 4:40 PM, Stuart Halloway <[EMAIL PROTECTED]> wrote: > For consistency, I would like to see spit moved into the boot.clj. I wholeheartedly agree. And I'd also like both slurp and spit to support encoding as an optional parameter as it is a bit of pain to write my o

Re: safe navigation operator

2008-10-06 Thread Paul Stadig
.? kinda almost works. It's not exactly a predicate, but it means "access this member if not null". Or perhaps .* which would mean "access as many members as possible in the following list". Paul On Mon, Oct 6, 2008 at 10:00 AM, Rich Hickey <[EMAIL PROTECTED]> wrote: > > > > On Oct 6, 9:36 am,

Re: safe navigation operator

2008-10-06 Thread Rich Hickey
On Oct 6, 9:36 am, Stuart Halloway <[EMAIL PROTECTED]> wrote: > Yes, that's better. Glad you like the idea. > > Does anybody not named Stuart also want to see this added to > Clojure? ;-) > > Stuart > > > On Oct 3, 3:13 pm, Stuart Halloway <[EMAIL PROTECTED]> wrote: > >> (defmacro ?. > >>"li

Re: Literal set

2008-10-06 Thread Arie van Wingerden
Hi Steve! that last post makes it clear for me. The example using "let" shows exactly what I needed to understand. Thanks very much! Arie 2008/10/6 Stephen C. Gilardi <[EMAIL PROTECTED]> > > > On Oct 6, 2008, at 9:07 AM, hotcore wrote: > > > I was playing around with data structures and fo

Re: string-functions, split/recur-problem

2008-10-06 Thread Stephen C. Gilardi
On Oct 6, 2008, at 5:16 AM, ssecorp wrote: > (also, what is the best way to deal with strings in clojure, java- > strings?) Clojure strings are Java strings. Search for "java.lang.String split" on the web to find: http://java.sun.com/j2se/1.4.2/docs/api/java/lang/String.html Try it in Cloju

slurp is in Clojure, but spit is in Contrib?

2008-10-06 Thread Stuart Halloway
Hi all For consistency, I would like to see spit moved into the boot.clj. This will play well with the Java crowd. For years I have poked fun of Java for having megabytes of core library and no simple way to save a file. Stuart --~--~-~--~~~---~--~~ You r

Re: Literal set

2008-10-06 Thread Stephen C. Gilardi
On Oct 6, 2008, at 9:07 AM, hotcore wrote: > I was playing around with data structures and found that I couldn't > type: > (conj #{aap noot mies} 'wim) > which results in: > java.lang.Exception: Unable to resolve symbol: mies in this context > > Instead I have to type: > (conj '#{aap noo

Re: Quick way to kill slime with clojure

2008-10-06 Thread jv-lists
The Ubuntu package you probably want is "emacs-snapshot-gtk" (on Hardy this is Emacs 23.0.60). I couldn't reproduce your error with this package and Slime from the Hardy repos. My installed clojure-swank is from 2008-09-23 and Clojure is rev-1043. Hope this helps. Jeff - Original Message

Re: safe navigation operator

2008-10-06 Thread Stuart Halloway
Yes, that's better. Glad you like the idea. Does anybody not named Stuart also want to see this added to Clojure? ;-) Stuart > On Oct 3, 3:13 pm, Stuart Halloway <[EMAIL PROTECTED]> wrote: >> (defmacro ?. >>"like .. but drops out on null object" >>([x form] >> `(. ~x ~form)) >>

Re: Patch: java.util.Map support

2008-10-06 Thread Rich Hickey
On Sep 30, 11:17 am, Rich Hickey <[EMAIL PROTECTED]> wrote: > On Sep 30, 5:04 am, Achim Passen <[EMAIL PROTECTED]> wrote: > > > On Sep 30, 5:20 am, "Stephen C. Gilardi" <[EMAIL PROTECTED]> wrote: > > > > After some more thought, I'm not sure whether this should be a concern > > > or not. Since j

Re: Literal set

2008-10-06 Thread Randall R Schulz
On Monday 06 October 2008 06:07, hotcore wrote: > Hi, > > I was playing around with data structures and found that I couldn't > type: >(conj #{aap noot mies} 'wim) > which results in: >java.lang.Exception: Unable to resolve symbol: mies in this > context > > Instead I have to type: >(

Literal set

2008-10-06 Thread hotcore
Hi, I was playing around with data structures and found that I couldn't type: (conj #{aap noot mies} 'wim) which results in: java.lang.Exception: Unable to resolve symbol: mies in this context Instead I have to type: (conj '#{aap noot mies} 'wim) or: (conj (set '(aap noot mies)) '

Re: string-functions, split/recur-problem

2008-10-06 Thread Stephen C. Gilardi
On Oct 6, 2008, at 5:16 AM, ssecorp wrote: > (defn splitall [str delim] >(loop [s str acc nil] >(if (= s nil) > (reverse acc) > (let [parts (split s delim)] > (recur (rest parts) (cons (first parts) acc)) As a debugging tool, I recommend inserti

string-functions, split/recur-problem

2008-10-06 Thread ssecorp
split is working fine, returns the parts on both sides of the delimiter. but for some reason splitall doesnt, it just does what split does. (also, what si the best way to deal with strings in clojure, java- strings?) (defn split [str delim] (loop [s str acc nil] (cond (= s

Re: Hex literals

2008-10-06 Thread Michael Wood
On Mon, Oct 6, 2008 at 2:04 AM, Jim Menard <[EMAIL PROTECTED]> wrote: > > nimbus:/usr/local/src/Lisp/clojure> clojure > Clojure > user=> 0xff > java.lang.IllegalArgumentException: Invalid number: 0xff > java.lang.Exception: ReaderError:(2,1) Invalid number: 0xff >at clojure.lang.LispReader

Re: Hacking boot.clj, what else needs to be reloaded?

2008-10-06 Thread Stephen C. Gilardi
On Oct 6, 2008, at 7:55 AM, Stephen C. Gilardi wrote: > put the directory "/src/clj/ > clojure" into your classpath Correction: "/src/clj" --Steve --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups "Clojure" grou

Re: Hacking boot.clj, what else needs to be reloaded?

2008-10-06 Thread Stephen C. Gilardi
On Oct 6, 2008, at 5:13 AM, ssecorp wrote: > If I want to add something to boot.clj so I always have it available. > > lets say h and t for head/first tail/rest (yes i find them annoyingly > long). > > it doesn't work just adding something to the file, do i have to add it > somewhere else too? r

Re: Syntax highlighter and setup for Clojure in Context editor under Windows/XP

2008-10-06 Thread hotcore
Hi, I uploaded a new version for the highlighter with a few improvements. Maybe the moderator can delete the previous version? TIA, Arie On 4 okt, 17:59, hotcore <[EMAIL PROTECTED]> wrote: > Thanks Hans, didn't know that feature yet! > > I uploaded the file as Clojure-Context.zip. > > Regard

Hacking boot.clj, what else needs to be reloaded?

2008-10-06 Thread ssecorp
If I want to add something to boot.clj so I always have it available. lets say h and t for head/first tail/rest (yes i find them annoyingly long). it doesn't work just adding something to the file, do i have to add it somewhere else too? recompile something? --~--~-~--~~---

Re: Using Java frameworks from Clojure

2008-10-06 Thread James Reeves
On Oct 6, 4:21 am, Hans Hübner <[EMAIL PROTECTED]> wrote: > for a project, I would like to use a Java framework that exposes a > very Javaesque API, with dozens of classes that need to be > instantiated or used and with several interfaces that one needs to > implement in order to be called back by

Re: complexity of subvec

2008-10-06 Thread Cesare
On Oct 3, 5:21 pm, Rich Hickey <[EMAIL PROTECTED]> wrote: > Yes. If it is important to get access bounded by the subvector's N you > can just call vec on it, at a one-time O(subvecN) cost. > > It is important to note that for vectors that are created by vec (and > literals) that have never been up