Stuck with AOT + Classpath

2008-11-29 Thread Geoffrey Teale
Morning all, I've been busy with other things for a couple of weeks, so I haven't been tracking the development of AOT. This weekend though I have had the opportunity to try it, but I am having a nightmare to get it to work at all. I've hunted through this group, read the sparkly new documenta

Re: infix operators

2008-11-29 Thread Johan Berntsson
As most people will tell you, the prefix notation is more natural in Lisp-like languages. However, I sometimes wonder if adding a Haskell infix operator (grave accent changes the argument order) could be a good idea in some situations; for example (2 `+ 3) -> (+ 2 3). On Nov 28, 3:54 pm, Dmitri <

Re: infix operators

2008-11-29 Thread Jeff Bester
On Nov 28, 11:11 pm, Dmitri <[EMAIL PROTECTED]> wrote: > Thanks for the comments, the prefix notation may indeed be something > that one gets used to. I find it just fine for most cases, just not > for mathematical expressions. The example function was not meant as a > complete solution, but rathe

Re: SVN or release?

2008-11-29 Thread Kyle Schaffrick
On Sat, 29 Nov 2008 19:05:23 -0800 (PST) Parth Malwankar <[EMAIL PROTECTED]> wrote: > > Regarding Chimp, maybe you can try Gorilla: > http://groups.google.com/group/clojure/browse_thread/thread/c8b7bc3106c39791 > I haven't used it personally yet. > My mistake, I actually did mean Gorilla and no

Re: Getting Started question

2008-11-29 Thread puzzler
Ok, I found the right link. I'll give it a try... --~--~-~--~~~---~--~~ 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 e

Re: Getting Started question

2008-11-29 Thread puzzler
Sounds great, but the link to the installer given in that thread is broken :( . On Nov 29, 7:11 pm, Mark Feeney <[EMAIL PROTECTED]> wrote: > "Clojure Box, alpha" > thread:http://groups.google.com/group/clojure/browse_frm/thread/6fd17fb97f05... --~--~-~--~~~---~--~---

Re: SVN or release?

2008-11-29 Thread Chouser
On Sat, Nov 29, 2008 at 1:01 PM, Kyle Schaffrick <[EMAIL PROTECTED]> wrote: > > I'm running the latest packaged release, and I'd like to start writing > some more serious "spikes" in Clojure, but I'm starting to get the > impression that I should be using the SVN version instead to get the > lates

Re: Getting Started question

2008-11-29 Thread Mark Feeney
If you want a dead easy way to get up and messing around with Clojure on Windows, I'd definitely recommend "Clojure Box". It's a relatively recent build of Clojure integrated with Emacs, SLIME, and everything else you need. Pretty much click on it and go. "Clojure Box, alpha" thread: http://gro

Re: SVN or release?

2008-11-29 Thread Parth Malwankar
Kyle Schaffrick wrote: > Hi all, > > I've been playing with Clojure for a few days now, following the mailing > list, searching and tinkering, etc. I'm really excited about this > language! > > I'm running the latest packaged release, and I'd like to start writing > some more serious "spikes" in

Re: Getting Started question

2008-11-29 Thread puzzler
On Nov 29, 5:39 pm, Randall R Schulz <[EMAIL PROTECTED]> wrote: > On Saturday 29 November 2008 17:28, puzzler wrote: > SLIME is an Emacs-based development environment for programming Lisp > under Emacs (technically, "The Superior Lisp Interaction Mode for > Emacs"). You might want to check out "

SVN or release?

2008-11-29 Thread Kyle Schaffrick
Hi all, I've been playing with Clojure for a few days now, following the mailing list, searching and tinkering, etc. I'm really excited about this language! I'm running the latest packaged release, and I'd like to start writing some more serious "spikes" in Clojure, but I'm starting to get the i

Re: Exception on the formatted print method calls

2008-11-29 Thread Randall R Schulz
On Saturday 29 November 2008 11:01, ppierre wrote: > On 29 nov, 17:13, "Stephen C. Gilardi" <[EMAIL PROTECTED]> wrote: > > On Nov 29, 2008, at 10:48 AM, ppierre wrote: > > > But I can't compile core.clj when I put get-locale and > > > with-locale   inside it. > > > > What error do you get? > > I h

Re: Getting Started question

2008-11-29 Thread Randall R Schulz
On Saturday 29 November 2008 17:28, puzzler wrote: > On Windows, when I enter the following line from "Getting Started" > into the REPL, nothing happens... it just hangs: > (. javax.swing.JOptionPane (showMessageDialog nil "Hello World")) > > Any idea why this isn't working for me? Is it possible

Re: Getting Started question

2008-11-29 Thread puzzler
Never mind. I found the other thread on this topic from a few months ago, and yes, it turned out the dialog was popping up behind the console window. --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups "Clojure" group.

Re: Next: #=(...) [was: Re: Documentation of :: Notation?]

2008-11-29 Thread Randall R Schulz
On Saturday 29 November 2008 17:00, Chouser wrote: > On Sat, Nov 29, 2008 at 6:26 PM, Randall R Schulz wrote: > > OK... Is it a legitimate part of Clojure's public specification, or > > is it something that is (even more) subject to change (than other > > things in a young language)? > > The doubl

Getting Started question

2008-11-29 Thread puzzler
On Windows, when I enter the following line from "Getting Started" into the REPL, nothing happens... it just hangs: (. javax.swing.JOptionPane (showMessageDialog nil "Hello World")) Any idea why this isn't working for me? Also, has anyone written a more detailed guide to getting up and running o

Re: Next: #=(...) [was: Re: Documentation of :: Notation?]

2008-11-29 Thread Stuart Halloway
> This is part of the print-dup work related to AOT. It is new since > the last release, and therefore not necessarily documented on the site > yet. Some examples in the book may be out-of-date wrt this change. Feel free to post any you spot to the errata page: http://www.pragprog.com/titles/

Re: Next: #=(...) [was: Re: Documentation of :: Notation?]

2008-11-29 Thread Chouser
On Sat, Nov 29, 2008 at 6:26 PM, Randall R Schulz <[EMAIL PROTECTED]> wrote: > > OK... Is it a legitimate part of Clojure's public specification, or is > it something that is (even more) subject to change (than other things > in a young language)? The double-colon keyword prefix is a specific and

Next: #=(...) [was: Re: Documentation of :: Notation?]

2008-11-29 Thread Randall R Schulz
Thanks, Stuart, On Saturday 29 November 2008 15:04, Stuart Halloway wrote: > The only place I have seen it is on this list, when I asked Rich how > to get the code for that section of the book to work. :-) OK... Is it a legitimate part of Clojure's public specification, or is it something that

Possible Reflector Bug

2008-11-29 Thread JMan
Consider these 2 interfaces: - PackagePrivateInterface.java package test; interface PackagePrivateInterface { public void myPublicMethod(); } - PublicTagInterface.java package test; public interface PublicTagInterface extends PackagePrivateInterface { } And these 2 classes: - Factory.j

Re: Documentation of :: Notation?

2008-11-29 Thread Stuart Halloway
The only place I have seen it is on this list, when I asked Rich how to get the code for that section of the book to work. :-) Stuart http://groups.google.com/group/clojure/browse_thread/thread/a88caa17b8d24008/77832fcda9a1e8fc?lnk=gst&q=multimethods+halloway#77832fcda9a1e8fc > > Hi, > > I ca

Documentation of :: Notation?

2008-11-29 Thread Randall R Schulz
Hi, I came across the use of :: keyword notation in section 8.4 of Programming Clojure (beta 3 PDF) and went to look for it on the Clojure Web site, but it appears not to be mentioned there. I looked in the Reader, Evaluation, Namespaces, API, Multimethods ('cause that's where Stuart introduc

Re: Exception on the formatted print method calls

2008-11-29 Thread ppierre
On 29 nov, 17:13, "Stephen C. Gilardi" <[EMAIL PROTECTED]> wrote: > On Nov 29, 2008, at 10:48 AM, ppierre wrote: > > > But I can't compile core.clj when I put get-locale and with-locale   > > inside it. > > What error do you get? I have found it : #"(?:^|_)([a-zA-Z]*)" (re-pattern "(?:^|_)([a-zA-

Re: Trying to get the ants demo to run on Windows

2008-11-29 Thread Blaine
Hi there, I'm having almost the same problem. I'm trying to get the ants demo running in ubuntu, and I get Rob's second problem: user=> (def panel (doto (proxy [JPanel] [] (paint [g] (render g))) (.setPreferredSize (new Dimension

Re: Exception on the formatted print method calls

2008-11-29 Thread Stephen C. Gilardi
On Nov 29, 2008, at 10:48 AM, ppierre wrote: > But I can't compile core.clj when I put get-locale and with-locale > inside it. What error do you get? >> - *locale* (should be set!-able as well), > A set-locale function ? No, I meant that if *locale* becomes part of Clojure at some p

Re: Exception on the formatted print method calls

2008-11-29 Thread ppierre
final static public Var LOCALE = Var.intern(CLOJURE_NS, Symbol.create ("*locale*"), null); (defn format "Formats a string using java.lang.String.format, see java.util.Formatter for format string syntax" [fmt & args] (let [locale (or *locale* (java.util.Locale/getDefault

Re: Macroexpand As A Tool For Understanding [was: Re: Reader Anomaly?]

2008-11-29 Thread Randall R Schulz
On Saturday 29 November 2008 07:35, Stephen C. Gilardi wrote: > On Nov 29, 2008, at 10:29 AM, Randall R Schulz wrote: > > I'm somewhat confused by this, but I gather it has something to do > > with "take" being lazy? > > The last note in the doc for macroexpand explains it: > > user=> (doc macroex

Re: NullPointer when just returning nil?

2008-11-29 Thread Rich Hickey
On Nov 29, 2008, at 9:06 AM, Stephen C. Gilardi wrote: > > > On Nov 29, 2008, at 8:03 AM, Ralf Bensmann wrote: > >> But #(...) and (fn [] ...) should be the same? > > The other replies have noted why that's not right. > > There is a way to get the effect you were looking for. If you want to > re

Re: Macroexpand As A Tool For Understanding [was: Re: Reader Anomaly?]

2008-11-29 Thread Stephen C. Gilardi
On Nov 29, 2008, at 10:29 AM, Randall R Schulz wrote: > I'm somewhat confused by this, but I gather it has something to do > with "take" being lazy? The last note in the doc for macroexpand explains it: user=> (doc macroexpand) - clojure.core/macroexpand ([form]) Rep

Re: Macroexpand As A Tool For Understanding [was: Re: Reader Anomaly?]

2008-11-29 Thread Randall R Schulz
On Saturday 29 November 2008 07:29, Randall R Schulz wrote: > On Saturday 29 November 2008 06:55, Randall R Schulz wrote: > > ... > > > > It's a good technique, though, to see what the compiler is going to > > be asked to translate after all players between the form as > > submitted and the compil

Re: NullPointer when just returning nil?

2008-11-29 Thread Ralf Bensmann
I think the NullPointerException was misleading for me... a more informational error message should be added. Rich, what do you think? On Sat, Nov 29, 2008 at 3:41 PM, Ralf Bensmann <[EMAIL PROTECTED]>wrote: > Argl... just forgot one of the "basic rules" ;) > > > On Sat, Nov 29, 2008 at 3:33 PM,

Macroexpand As A Tool For Understanding [was: Re: Reader Anomaly?]

2008-11-29 Thread Randall R Schulz
On Saturday 29 November 2008 06:55, Randall R Schulz wrote: > ... > > It's a good technique, though, to see what the compiler is going to > be asked to translate after all players between the form as submitted > and the compiler have done their thing. Or is it? Can you tell what a newbie I am? I

Re: loop recur vs recursion

2008-11-29 Thread .Bill Smith
As often as this comes up, I wonder if TCO and loop/recur deserve their own section in the reference section. Bill On Nov 29, 4:11 am, "Kevin Downey" <[EMAIL PROTECTED]> wrote: > the jvm does not do TCO, loop/recur allows for functional looking > recursion on the jvm with constant stack size. >

Re: Reader Anomaly?

2008-11-29 Thread Stephen C. Gilardi
On Nov 29, 2008, at 9:55 AM, Randall R Schulz wrote: > In this case, it's no different than just printing the list you passed > to macroexpand: > > user=> '(interpose '.' "The quick brown fox") > (interpose (quote .) (quote "The quick brown fox")) > > It's a good technique, though, to see what th

Re: Reader Anomaly?

2008-11-29 Thread Randall R Schulz
On Saturday 29 November 2008 06:45, Stephen C. Gilardi wrote: > On Nov 29, 2008, at 9:30 AM, Randall R Schulz wrote: > > Is it a reader bug? (That the second apostrophe appeared to be > > ignored.) > > It wasn't ignored. It quoted the string. Yeah, Robert made me see that. > I've been intereste

Re: Reader Anomaly?

2008-11-29 Thread Randall R Schulz
On Saturday 29 November 2008 06:36, Robert Pfeiffer wrote: > Hi, > > On 29 Nov., 15:30, Randall R Schulz <[EMAIL PROTECTED]> wrote: > > Hi, > > > > What happened here? > > String literals evaluate to themselves. Quoting prevents evaluation. > When you evaluate a quoted string, you get just the str

Compiler bug with package name vs. namespace name

2008-11-29 Thread Lennart Staflin
There is a bug in the AOT compiler. When it calls the method functions it uses the java package name instead of the clojure namespace name. This creates problems if I have a namespace with a dash in the name. (ns net.cddr.foo-bar1) (defn -main [] (println "Hello: foo-bar1")) Compil

Re: Reader Anomaly?

2008-11-29 Thread Stephen C. Gilardi
On Nov 29, 2008, at 9:30 AM, Randall R Schulz wrote: > Is it a reader bug? (That the second apostrophe appeared to be > ignored.) It wasn't ignored. It quoted the string. I've been interested in a way to see what the reader returns for things like this in the past. It turns out we can get

Re: NullPointer when just returning nil?

2008-11-29 Thread Ralf Bensmann
Argl... just forgot one of the "basic rules" ;) On Sat, Nov 29, 2008 at 3:33 PM, Randall R Schulz <[EMAIL PROTECTED]> wrote: > > On Saturday 29 November 2008 06:27, Ralf Bensmann wrote: > > Thanks for clarification. But I am wondering about a function can > > return nil: > > > > user=> (fn [] ((

Re: Reader Anomaly?

2008-11-29 Thread Robert Pfeiffer
Hi, On 29 Nov., 15:30, Randall R Schulz <[EMAIL PROTECTED]> wrote: > Hi, > > What happened here? String literals evaluate to themselves. Quoting prevents evaluation. When you evaluate a quoted string, you get just the string. user=> '"hello" "hello" user=> "hello" "hello" user=> (= "a" '"a") tr

Re: NullPointer when just returning nil?

2008-11-29 Thread Randall R Schulz
On Saturday 29 November 2008 06:27, Ralf Bensmann wrote: > Thanks for clarification. But I am wondering about a function can > return nil: > > user=> (fn [] ((+ 1 2) nil)) > # > > But "just returning nil" is not ok? > user=> (fn [] (nil)) You're not returning nil, you're trying to apply nil (as i

Reader Anomaly?

2008-11-29 Thread Randall R Schulz
Hi, What happened here? user=> (take 20 (interpose '.' "The quick brown fox")) (\T . \h . \e . \space . \q . \u . \i . \c . \k . \space .) Naturally, I meant to use a character literal as the first argument to interpose, but my C / Java habits led me to use the apostrophes instead of the pro

Re: NullPointer when just returning nil?

2008-11-29 Thread Ralf Bensmann
Thanks for clarification. But I am wondering about a function can return nil: user=> (fn [] ((+ 1 2) nil)) # But "just returning nil" is not ok? user=> (fn [] (nil)) java.lang.NullPointerException (NO_SOURCE_FILE:24) user=> (fn [] ((nil))) java.lang.NullPointerException (NO_SOURCE_FILE:25) Thank

Re: NullPointer when just returning nil?

2008-11-29 Thread Rich Hickey
On Nov 29, 9:06 am, "Stephen C. Gilardi" <[EMAIL PROTECTED]> wrote: > On Nov 29, 2008, at 8:03 AM, Ralf Bensmann wrote: > > > But #(...) and (fn [] ...) should be the same? > > The other replies have noted why that's not right. > > There is a way to get the effect you were looking for. If you wa

Re: NullPointer when just returning nil?

2008-11-29 Thread Stephen C. Gilardi
On Nov 29, 2008, at 8:03 AM, Ralf Bensmann wrote: > But #(...) and (fn [] ...) should be the same? The other replies have noted why that's not right. There is a way to get the effect you were looking for. If you want to return a constant or do something with side-effects before returning a

Re: NullPointer when just returning nil?

2008-11-29 Thread Rich Hickey
On Nov 29, 2008, at 8:03 AM, Ralf Bensmann wrote: > But #(...) and (fn [] ...) should be the same? No, as stated here: http://clojure.org/reader The anonymous fn reader macro expands as follows: #(...) => (fn [args] (...)) If you think about it a bit: #(+ 2 %) => (fn [x] (+ 2 x)) Note the

Re: NullPointer when just returning nil?

2008-11-29 Thread Parth Malwankar
On Nov 29, 6:03 pm, "Ralf Bensmann" <[EMAIL PROTECTED]> wrote: > But #(...) and (fn [] ...) should be the same? I suppose that might make the syntax somewhat ugly. E.g.: (fn [x] (foo x)) would become #((foo %)). This particular syntax is a frequent point of confusion but then once you get it i

Re: NullPointer when just returning nil?

2008-11-29 Thread Ralf Bensmann
But #(...) and (fn [] ...) should be the same? On Sat, Nov 29, 2008 at 1:48 PM, Parth Malwankar <[EMAIL PROTECTED]>wrote: > > On Nov 29, 5:29 pm, "Ralf Bensmann" <[EMAIL PROTECTED]> > wrote: > > Hi, > > > > is this the intended behavior? > > > > user=> #(nil) > > java.lang.NullPointerException (N

Re: loop recur vs recursion

2008-11-29 Thread Rich Hickey
On Nov 29, 2008, at 6:49 AM, Daniel Renfer wrote: > Even if you don't think you'll run into the possibility of blowing > your stack, it's still a good idea to use recur when doing tail call > recursion. The compiler will help you out by making sure it really is > a tail call. > > Remember, recur

Re: NullPointer when just returning nil?

2008-11-29 Thread Parth Malwankar
On Nov 29, 5:29 pm, "Ralf Bensmann" <[EMAIL PROTECTED]> wrote: > Hi, > > is this the intended behavior? > > user=> #(nil) > java.lang.NullPointerException (NO_SOURCE_FILE:12) > user=> (def b #(nil)) > java.lang.NullPointerException (NO_SOURCE_FILE:13) > This is expected. #(nil) is the same as (

NullPointer when just returning nil?

2008-11-29 Thread Ralf Bensmann
Hi, is this the intended behavior? user=> #(nil) java.lang.NullPointerException (NO_SOURCE_FILE:12) user=> (def b #(nil)) java.lang.NullPointerException (NO_SOURCE_FILE:13) This works: user=> #('nil) # Thanks, -Ralf --~--~-~--~~~---~--~~ You received this messag

Re: loop recur vs recursion

2008-11-29 Thread Daniel Renfer
Even if you don't think you'll run into the possibility of blowing your stack, it's still a good idea to use recur when doing tail call recursion. The compiler will help you out by making sure it really is a tail call. Remember, recur isn't just for loop. It works with functions too. On Sat, Nov

Re: loop recur vs recursion

2008-11-29 Thread bOR_
In this case, the depth of the recursion would be at maximum 21 (number of different types of amino acids), and the function itself not often called. Is stack size something to worry about at those depths? On Nov 29, 11:11 am, "Kevin Downey" <[EMAIL PROTECTED]> wrote: > the jvm does not do TCO, l

Re: loop recur vs recursion

2008-11-29 Thread Kevin Downey
the jvm does not do TCO, loop/recur allows for functional looking recursion on the jvm with constant stack size. On Sat, Nov 29, 2008 at 1:25 AM, bOR_ <[EMAIL PROTECTED]> wrote: > > Hi all, > > I wondered if there is a difference between using loop-recur or merely > writing a recursive function. T

loop recur vs recursion

2008-11-29 Thread bOR_
Hi all, I wondered if there is a difference between using loop-recur or merely writing a recursive function. The main difference I found thus far was that the loop-recur can suffice with less arguments, but the recursive functions seem to be shorter, and perhaps more elegant? (defn construct-ato