Re: DISCUSS: replace (rand)

2008-12-15 Thread Konrad Hinsen
On 15.12.2008, at 02:24, Mark H. wrote: (lazy-cons X1 (lazy-cons X2 (transform-to-gaussian uniform- rest)) Also much better -- the structs were ugly. Thanks for the nice revision! In fact, this is a good test-case for the interface design for random- number generators. If you

Re: learning about AOT

2008-12-15 Thread Albert Cardona
Wow, that's a lot of things that have to be in the classpath! In your example the namespace is fj.tests.process. You say the classpath must contain: 1) the fj directory 2) the process directory 3) the classes directory where the .class files will be written I would have guessed I'd only

Re: Best Choice of Java Class For *out*

2008-12-15 Thread Albert Cardona
Randall R Schulz wrote: What might be the issues or consequences of making the root binding of *out* a PrintWriter? I've been using a PrintWriter for *out* for months now, and no problems so far. Using always nearly latest svn clojure. Albert -- Albert Cardona

Re: reduction

2008-12-15 Thread Rich Hickey
On Dec 12, 3:35 pm, Christophe Grand christo...@cgrand.net wrote: I was sure it was a job for iterate: (defn reductions Returns a lazy seq of the intermediate values of the reduction (as per reduce) of coll by f, starting with init. ([f coll] (if (seq coll) (for [s

Re: Emtpy (filter ...) Result Yields nil; Could / Should It Be An Empty List?

2008-12-15 Thread Randall R Schulz
On Sunday 14 December 2008 21:56, Mon Key wrote: user= (flatten nil) (nil) Not a bug. flatten returns a sequence - in this case a sequence containing 'nil. How else would you flatten on nil? I would expect (flatten nil) = nil ... Randall Schulz

Re: Best Choice of Java Class For *out*

2008-12-15 Thread Randall R Schulz
On Monday 15 December 2008 01:16, Albert Cardona wrote: Randall R Schulz wrote: What might be the issues or consequences of making the root binding of *out* a PrintWriter? I've been using a PrintWriter for *out* for months now, and no problems so far. Using always nearly latest svn

Re: Emtpy (filter ...) Result Yields nil; Could / Should It Be An Empty List?

2008-12-15 Thread Stuart Sierra
On Dec 15, 9:08 am, Randall R Schulz rsch...@sonic.net wrote: flatten returns a sequence  - in this case a sequence containing 'nil. How else would you flatten on nil? I would expect (flatten nil) = nil I agree, it's a bug, but I'm not sure how to fix it, unless it's just a special case

Re: The return of the monads: lessons learned about macros

2008-12-15 Thread Konrad Hinsen
On Dec 14, 2008, at 23:16, jim wrote: Also, I came across set-state and fetch-state being implemented in terms of update-state. Indeed, those are the implementations I had in my first monad implementation. I replaced them by manually inlining update-state when I wanted to get rid of

Re: Clojure classes graph (was chart.png)

2008-12-15 Thread Stuart Sierra
Cool, thanks! -S On Dec 14, 4:47 pm, Chouser chou...@gmail.com wrote: I've updated the Clojure classes graph (thanks for the push, R. Schulz!)  The new version includes the newest classes as well as Java interfaces that are applicable.  These latter are shown inside diamonds. A couple

Re: Emtpy (filter ...) Result Yields nil; Could / Should It Be An Empty List?

2008-12-15 Thread Randall R Schulz
On Monday 15 December 2008 07:22, Stuart Sierra wrote: On Dec 15, 9:08 am, Randall R Schulz rsch...@sonic.net wrote: flatten returns a sequence  - in this case a sequence containing 'nil. How else would you flatten on nil? I would expect (flatten nil) = nil I agree, it's a bug, but

Re: Nested Java Types

2008-12-15 Thread Rich Hickey
On Mon, Dec 15, 2008 at 10:40 AM, Randall R Schulz rsch...@sonic.net wrote: On Friday 05 December 2008 15:36, Randall R Schulz wrote: I make pretty extensive use of nested classes (most significantly Enum types). I was wondering if it might be a good idea to allow dot resolution to find

Re: Clojure classes graph (was chart.png)

2008-12-15 Thread Rich Hickey
On Dec 15, 10:27 am, Stuart Sierra the.stuart.sie...@gmail.com wrote: Cool, thanks! -S On Dec 14, 4:47 pm, Chouser chou...@gmail.com wrote: I've updated the Clojure classes graph (thanks for the push, R. Schulz!) The new version includes the newest classes as well as Java interfaces

Re: Nested Java Types

2008-12-15 Thread Randall R Schulz
On Friday 05 December 2008 15:36, Randall R Schulz wrote: I make pretty extensive use of nested classes (most significantly Enum types). I was wondering if it might be a good idea to allow dot resolution to find such types. E.g.: user= tau.run.TSEvent.TSEKind

Re: Macro Style Question: Expanding to Multiple (def ...) Forms

2008-12-15 Thread Michael Wood
On Mon, Dec 15, 2008 at 4:52 PM, Randall R Schulz rsch...@sonic.net wrote: Hi, I'm wondering whether it's a good idea to create a defsomething -style macro that establishes multiple root bindings? In other one, a macro that expands to multiple (def ...) forms? Well that sounds quite like

Re: Clojure classes graph (was chart.png)

2008-12-15 Thread Chouser
On Mon, Dec 15, 2008 at 10:47 AM, Rich Hickey richhic...@gmail.com wrote: It seems the interface detection is not quite right - many things that are interfaces are shown as classes. Yes, the legend is misleading. Diamonds are for non-clojure interfaces, ovals are clojure.lang.* classes and

Re: The return of the monads: lessons learned about macros

2008-12-15 Thread Konrad Hinsen
Jim, you were quicker than me in implementing monad transformers! What I had in mind is exactly what you did: a monad transformer would be implemented as a function taking a monad as an argument. That's in fact why I defined the monad macro in addition to defmonad. I did some more work

Macro Style Question: Expanding to Multiple (def ...) Forms

2008-12-15 Thread Randall R Schulz
Hi, I'm wondering whether it's a good idea to create a defsomething -style macro that establishes multiple root bindings? In other one, a macro that expands to multiple (def ...) forms? The first thing I noticed when I did this is that (barring further machinations within the macro) it

Does ANTS.CLJ still work?

2008-12-15 Thread Peter Wolf
Hello I was just following the directions on Ubuntu setup directions on http://riddell.us/clojure/ I get the following error when I try ANTS.CLJ. Has something changed? Peter (defn setup places initial food and ants, returns seq of ant agents [] (sync nil (dotimes [i food-places]

Re: clojure.contrib.sql (connection) public?

2008-12-15 Thread kunnar
+1. For example i did a function that calls some Oracle PL/SQL stored procedure (defn db-read-proc [callback] (sql/with-connection db (with-open [stmt (.prepareCall (connection) {call STORED_PROCEDURE (?)})] (. stmt registerOutParameter 1 -10) (. stmt execute) (callback (.

Re: Clojure classes graph (was chart.png)

2008-12-15 Thread Chouser
On Mon, Dec 15, 2008 at 11:02 AM, Chouser chou...@gmail.com wrote: On Mon, Dec 15, 2008 at 10:47 AM, Rich Hickey richhic...@gmail.com wrote: It seems the interface detection is not quite right - many things that are interfaces are shown as classes. Yes, the legend is misleading. Diamonds

Where is the Clojure FAQ?

2008-12-15 Thread Mon Key
Clojure needs a FAQ - a plain old school vanilla FAQ. Clojure.org is useful; The wiki is useful; The gg Group is useful; The /# clojure is useful; (doc some-fn) is useful; (show some-fn) is useful; None of these are a FAQ. None accomplish what a FAQ accomplishes. Lots of people look for a FAQ

Re: Emtpy (filter ...) Result Yields nil; Could / Should It Be An Empty List?

2008-12-15 Thread Randall R Schulz
On Monday 15 December 2008 09:30, Mon Key wrote: I would expect (flatten nil) = nil Why? = nil nil is not a sequence - your expectation is that Clojure flatten and return `nothing'... which *would* be a bug Flattening nothing gives something? Flatten is not consistent with seq: user=

Re: Emtpy (filter ...) Result Yields nil; Could / Should It Be An Empty List?

2008-12-15 Thread Stuart Sierra
On Dec 15, 12:30 pm, Mon Key s...@derbycityprints.com wrote: I would expect (flatten nil) = nil Why? Sorry, Mon Key, but I have to agree with Randall here. All the sequence-related functions (first, rest, filter, map, etc.) return nil for nil. If flatten is returning a sequence, I expect

“Don’t know how to create ISeq from: Symbol” error

2008-12-15 Thread Paul Reiners
I have the following Clojure code and I'm not sure why it's not working: (defn match (x y optional binds) (cond ((eql x y) (values binds t)) ((assoc x binds) (match (binding x binds) y binds)) ((assoc y binds) (match x (binding y binds) binds)) ((var? x) (values (cons (cons x y)

Re: A newbie question on Agents and ants

2008-12-15 Thread MattyDub
Should I interpret the silence on this topic to mean that there aren't any places I can go to find out about *agent*, etc.? In another thread on this group, I see that there is a *out*, as well; I assume therefore that there is a *in*. Perhaps those are documented somewhere - any pointers?

Re: “Don’t know how to create ISeq from: Symbol” error

2008-12-15 Thread Randall R Schulz
On Monday 15 December 2008 09:34, Paul Reiners wrote: I have the following Clojure code and I'm not sure why it's not working: (defn match (x y optional binds) (cond ((eql x y) (values binds t)) ((assoc x binds) (match (binding x binds) y binds)) ((assoc y binds) (match x

Re: Nested Java Types

2008-12-15 Thread Joost
Rich Hickey schreef: Dot is too overloaded in Java, and overloaded enough in Clojure. This one doesn't seem too important to me. I ran into this issue yesterday. Or more precisely: I couldn't find any way to refer to inner classes in the docs on the clojure.org site. I personally don't like

Re: “Don’t know how to create ISeq from: Symbol” error

2008-12-15 Thread kwatford
I have the following Clojure code and I'm not sure why it's not working: The short answer is: That's not Clojure code, it is Common Lisp code. Longer answer: Despite having similar-looking syntax, the two are not particularly related. Of the functions/macros you tried to use, I think only and,

Re: “Don’t know how to create ISeq from: Symbol” error

2008-12-15 Thread James Reeves
On Dec 15, 5:34 pm, Paul Reiners paul.rein...@gmail.com wrote: I have the following Clojure code and I'm not sure why it's not working: (defn match (x y optional binds)   (cond    ((eql x y) (values binds t))    ((assoc x binds) (match (binding x binds) y binds))    ((assoc y binds)

Re: Emtpy (filter ...) Result Yields nil; Could / Should It Be An Empty List?

2008-12-15 Thread Lennart Staflin
How about adding a rest around tree-seq: (defn flatten Takes any nested combination of sequential things (lists, vectors, etc.) and returns their contents as a single, flat sequence. [x] (let [s? #(instance? clojure.lang.Sequential %)] (filter (complement s?) (rest (tree-seq s? seq

Re: Nested Java Types

2008-12-15 Thread Rich Hickey
On Dec 15, 2008, at 1:49 PM, Joost wrote: Rich Hickey schreef: Dot is too overloaded in Java, and overloaded enough in Clojure. This one doesn't seem too important to me. I ran into this issue yesterday. Or more precisely: I couldn't find any way to refer to inner classes in the docs on

Re: A newbie question on Agents and ants

2008-12-15 Thread kwatford
*agent* and a few others have recently been properly documented at http://clojure.org/api Unfortunately this isn't true for all of the 'standard' globals. *in* and *out* don't have entries of their own, though they are mentioned in the functions that use them, so a search within that page will

Re: Nested Java Types

2008-12-15 Thread Randall R Schulz
On Monday 15 December 2008 07:44, Rich Hickey wrote: On Mon, Dec 15, 2008 at 10:40 AM, Randall R Schulz rsch...@sonic.net wrote: On Friday 05 December 2008 15:36, Randall R Schulz wrote: I make pretty extensive use of nested classes (most significantly Enum types). I was wondering if

calling use with a seq of strings

2008-12-15 Thread Brian Doyle
I have a seq of strings that are namespaces like, (clojure.contrib.str-utils, clojure.contrib.duck-streams). I wanted to call the use function on this seq. I can't seem to do that though. Any way I can do this or is this just a bad idea? Thanks.

Re: calling use with a seq of strings

2008-12-15 Thread Stuart Sierra
You can do this: (apply use (map symbol (list clojure.contrib.str-utils clojure.contrib.duck-streams))) -Stuart Sierra On Dec 15, 3:51 pm, Brian Doyle brianpdo...@gmail.com wrote: I have a seq of strings that are namespaces like, (clojure.contrib.str-utils, clojure.contrib.duck-streams). I

Re: calling use with a seq of strings

2008-12-15 Thread Brian Doyle
I didn't know about the symbol function. Thanks! I just want to call use on all of the namespaces in the clojure.contrib jar when starting the repl and this will work nicely! On Mon, Dec 15, 2008 at 1:59 PM, Stuart Sierra the.stuart.sie...@gmail.comwrote: You can do this: (apply use (map

Re: jEdit Mode for Clojure

2008-12-15 Thread David Moss
I been thinking about this during the weekend, and I think I prefer the mode to be aware of nesting (unless you can cause it to blow the stack on a large file or something, which I think would be unlikely anyway), so I'm going to take the keywords from your mode and bolt on the set structures I

Trace Tools

2008-12-15 Thread Craig McDaniel
Here is a minor update to what I posted previously (but this time as an attachment). This is just a small library that allows you turn on tracing for all functions in a namespace all at once, or toggle tracing for individual functions. --~--~-~--~~~---~--~~ You

Common Lisp's symbol-name in Clojure?

2008-12-15 Thread Paul Reiners
Is there anything in Clojure that is equivalent to Common Lisp's symbol-name function? --~--~-~--~~~---~--~~ 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

Getting Started with Gen-Class

2008-12-15 Thread CuppoJava
Hi, I just ran into a need for using gen-class, and need some help getting started. I upgraded to the latest Clojure version using svn co https://clojure.svn.sourceforge.net/svnroot/clojure clojure and I run the REPL using java -jar clojure.jar However when I type: user= (compile) I get the

Re: Nested Java Types

2008-12-15 Thread Joost
Rich Hickey schreef: On Dec 15, 2008, at 1:49 PM, Joost wrote: Rich Hickey schreef: Dot is too overloaded in Java, and overloaded enough in Clojure. This one doesn't seem too important to me. I ran into this issue yesterday. Or more precisely: I couldn't find any way to refer to

Functional Geometry

2008-12-15 Thread Frantisek Sodomka
Hello all! I ported beatiful functional geometry: http://www.frank-buss.de/lisp/functional.html http://intricatevisions.com/index.cgi?page=nlcodetk into Clojure: http://intricatevisions.com/source/clojure/fg.clj (link from the page http://intricatevisions.com/index.cgi?page=clojure) When you

Agents send-off

2008-12-15 Thread Bradbev
I have the following scenario: - a server that is listening on a socket for incoming connections. - when the server accepts a connection it uses send-off to run a handler function to handle the connection - the handler function loops using recur to handle packets - the handler function uses

possible bug with seq and Enumeration?

2008-12-15 Thread Brian Doyle
According to the docs the seq function should be able to take an enumeration, but here is what I see: user= (seq (.elements (doto (java.util.Vector.) (.add hello) (.add world java.lang.IllegalArgumentException: Don't know how to create ISeq from: (NO_SOURCE_FILE:0) SVN 1160, thanks.

Re: Best Choice of Java Class For *out*

2008-12-15 Thread Randall R Schulz
On Sunday 14 December 2008 17:21, Randall R Schulz wrote: Hi, I have quite a bit of Java code with I/O capabilities that generally support both PrintStream and PrintWriter. I was a bit perplexed when I tried to apply one of these methods to *out* and was rebuffed thusly:

Re: Best Choice of Java Class For *out*

2008-12-15 Thread Stephen C. Gilardi
On Dec 15, 2008, at 6:08 PM, Randall R Schulz wrote: user= (class *err*) java.io.PrintWriter PrintWriter is (as far as I can determine) the more modern of the two classes that are accepted as an argument to Throwable.printStackTrace which is used frequently in Clojure's implementation.

Re: Best Choice of Java Class For *out*

2008-12-15 Thread Randall R Schulz
On Monday 15 December 2008 15:22, Stephen C. Gilardi wrote: On Dec 15, 2008, at 6:08 PM, Randall R Schulz wrote: user= (class *err*) java.io.PrintWriter PrintWriter is (as far as I can determine) the more modern of the two classes that are accepted as an argument to

Re: possible bug with seq and Enumeration?

2008-12-15 Thread Rich Hickey
On Dec 15, 6:01 pm, Brian Doyle brianpdo...@gmail.com wrote: According to the docs the seq function should be able to take an enumeration, but here is what I see: user= (seq (.elements (doto (java.util.Vector.) (.add hello) (.add world java.lang.IllegalArgumentException: Don't know

Re: Agents send-off

2008-12-15 Thread Rich Hickey
On Dec 15, 5:57 pm, Bradbev brad.beveri...@gmail.com wrote: I have the following scenario: - a server that is listening on a socket for incoming connections. - when the server accepts a connection it uses send-off to run a handler function to handle the connection - the handler

Re: possible bug with seq and Enumeration?

2008-12-15 Thread Brian Doyle
Using enumeration-seq does the trick! Thanks. user= (enumeration-seq (.entries (java.util.zip.ZipFile. path to some jar))) On Mon, Dec 15, 2008 at 5:14 PM, Rich Hickey richhic...@gmail.com wrote: On Dec 15, 6:01 pm, Brian Doyle brianpdo...@gmail.com wrote: According to the docs the seq

Re: Getting Started with Gen-Class

2008-12-15 Thread Rich Hickey
On Dec 15, 5:35 pm, CuppoJava patrickli_2...@hotmail.com wrote: Hi, I just ran into a need for using gen-class, and need some help getting started. I upgraded to the latest Clojure version using svn cohttps://clojure.svn.sourceforge.net/svnroot/clojureclojure and I run the REPL using

Re: Agents send-off

2008-12-15 Thread Bradbev
On Dec 15, 4:29 pm, Rich Hickey richhic...@gmail.com wrote: On Dec 15, 5:57 pm, Bradbev brad.beveri...@gmail.com wrote: snip Thanks for the quick reply. Very helpful. Cheers, Brad --~--~-~--~~~---~--~~ You received this message because you are subscribed to the

Re: Getting Started with Gen-Class

2008-12-15 Thread CuppoJava
Tried ant clean, it's still giving me the same error. Unable to resolve symbol: compile in this context. Is there a way to check my Clojure version from the REPL? --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups

Re: Getting Started with Gen-Class

2008-12-15 Thread CuppoJava
I checked with SVN. It says I checked out revision number 1160? --~--~-~--~~~---~--~~ 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

Re: Getting Started with Gen-Class

2008-12-15 Thread Randall R Schulz
On Monday 15 December 2008 17:05, CuppoJava wrote: I checked with SVN. It says I checked out revision number 1160? As of this writing, that's the latest rev. In your previous message you said you tried ant clean. I assume that you followed that by ant jar (or just did ant clean jar). By the

macroexpand-1 vs. macroexpand

2008-12-15 Thread Mark Volkmann
I'm trying to understand the difference between these. Is it that macros expanded by macroexpand-1 could result in calls to additional macros that won't be expanded, but macroexpand will continue expanding until no macro calls remain? It tried: (macroexpand-1 '(or ( 2 1) ( 3 2) ( 1 2))) which

Re: macroexpand-1 vs. macroexpand

2008-12-15 Thread Randall R Schulz
On Monday 15 December 2008 17:58, Mark Volkmann wrote: I'm trying to understand the difference between these. Is it that macros expanded by macroexpand-1 could result in calls to additional macros that won't be expanded, but macroexpand will continue expanding until no macro calls remain?

Re: Getting Started with Gen-Class

2008-12-15 Thread CuppoJava
I tried ant clean followed by ant which built a clojure.jar which is exactly 488,904 bytes. And i get the message Unable to resolve symbol: compile in this context when i type (compile) at the REPL. Thanks very much for your help -Patrick --~--~-~--~~~---~--~~

Re: Getting Started with Gen-Class

2008-12-15 Thread Dave Newton
--- On Mon, 12/15/08, CuppoJava wrote: And i get the message Unable to resolve symbol: compile in this context when i type (compile) at the REPL. How are you running the REPL? It's working for me whether I build with Ant or Maven, rev 1160. Dave

Re: Getting Started with Gen-Class

2008-12-15 Thread CuppoJava
I'm running the REPL by typing java -jar clojure.jar in the directory C:\clojure which contains the clojure.jar file. --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups Clojure group. To post to this group, send email

understanding quoting

2008-12-15 Thread Mark Volkmann
Here's a summary of what I think I know about quoting in Clojure. I'd appreciate some feedback if I said anything wrong below or maybe didn't describe something well. ; One use of quoting is to prevent a list from being evaluated ; where the first item is treated as the name of a function ; and

Re: understanding quoting

2008-12-15 Thread Chouser
On Mon, Dec 15, 2008 at 9:41 PM, Mark Volkmann r.mark.volkm...@gmail.com wrote: ; Quoting a list is *not* the same as quoting everyting inside it. (println ('+ '1 '2)) ; outputs 2 which is the value of the last item evaluated Your example works, but your comment is not always true: user= ('+

Gorilla: key combinations

2008-12-15 Thread Alex Burka
Thanks for Gorilla. I am using it with MacVim. One (or :bug :pebkac) report... I put plugin/gorilla.vim in /Applications/MacVim.app/Contents/ Resources/vim/runtime/plugin/ and it seems to be loaded when MacVim starts. But the keybindings are not set up. \sr doesn't do anything (well, the

Re: understanding quoting

2008-12-15 Thread Timothy Pratley
What is the meaning of: ('+ '1 '2) On the surface it appears that '2 is simply the last evaluated, but lets try some similar calls: user= ('+) java.lang.IllegalArgumentException: Wrong number of args passed to: Symbol user= ('+ '1) nil user= ('+ '1 '2) 2 user= ('+ '1 '2 '3)

Re: in-ns + refer

2008-12-15 Thread Chouser
On Mon, Dec 15, 2008 at 10:42 PM, Mike Perham mper...@gmail.com wrote: Why do we have to do this? (in-ns 'myns) (clojure/refer 'clojure) Java automagically imports java.lang. Shouldn't Clojure automagically map the core namespace? It does if you use the 'ns' macro (depending on whether

Re: understanding quoting

2008-12-15 Thread Timothy Pratley
user= ('b '{a 10, b 11, c 12}) 11 Ah, yes so the 1 arg version is the map lookup, which also works in reverse user= ('{a 10, b 11, c 12} 'b) 11 That makes perfect sense... What is the 2 arg version? user= ('{a 10, b 11, c 12} 'b 'c) 11 user= ('b '{a 10, b 11, c 12} 'c) 11 user= ('b 'c '{a 10,

doall and dorun

2008-12-15 Thread wubbie
Hello, doall and dorun returns different results from seond run on... e.g. user= (def x (for [i (range 1 3)] (do (println i) i))) #'user/x user= (doall x) 1 2 (1 2) user= (doall x) (1 2) user= (doall x) (1 2) user= user= (def x (for [i (range 1 3)] (do (println i) i))) #'user/x user= (dorun x)

Re: understanding quoting

2008-12-15 Thread Daniel Eklund
Looks like an if then else version of the map lookup?? ie: (if (%1 %2) (%1 %2) %3) Is this a special feature of maps in general, such that you can look up a key but return something else if it doesn't exist? I hadn't come across it yet, but it sounds useful :) This is exactly right (I just

Re: Emtpy (filter ...) Result Yields nil; Could / Should It Be An Empty List?

2008-12-15 Thread Mon Key
Flattening nothing gives something? Nothing was minding the gap until you put it inside flatten's sequence interface at which point you got a flattened sequence full of nil. Prior to that there was *not* an empty list waiting for nil. Returning nothing when in fact you expect a list (even one

Re: understanding quoting

2008-12-15 Thread Brian Doyle
On Mon, Dec 15, 2008 at 9:43 PM, Daniel Eklund doekl...@gmail.com wrote: Looks like an if then else version of the map lookup?? ie: (if (%1 %2) (%1 %2) %3) Is this a special feature of maps in general, such that you can look up a key but return something else if it doesn't exist? I

Re: understanding quoting

2008-12-15 Thread Timothy Pratley
Neat :) Thanks for the in depth examination, that's a very clear explanation! --~--~-~--~~~---~--~~ 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

Initialize java.util.TreeSet/TreeMap using clojure set/map value

2008-12-15 Thread Feng
Hi, Because clojure set, vector and map all implements java.util.Comparator (indirectly via AFn), they interact with java.util.TreeSet/TreeMap in surprising way due to overloaded ctor (java.util.Comparator). user= (def s (java.util.TreeSet. [1 2 3 3])) #'user/s user= s #=(java.util.TreeSet.

Re: understanding quoting

2008-12-15 Thread Daniel Eklund
How did you know that it delegates to 'get'? sorry, I rushed that part. the keyword and symbol are instances of clojure.lang.Keyword and clojure.lang.Symbol which are _java_ classes found in Keyword.java and Symbol.java (I found these in the src/jvm directory) These are what the invoke( )

Re: Emtpy (filter ...) Result Yields nil; Could / Should It Be An Empty List?

2008-12-15 Thread Mon Key
whoops, chopped of the end of that last message - forgot the nasake-no ichigeki user (seq? '(nil)) ==|]==true --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups Clojure group. To post to this group, send email to

test-is uncaught exception behavior

2008-12-15 Thread Allen Rohner
In recent versions of test-is, it appears that exceptions are only caught inside of the 'is' macro, as opposed to during the whole test run. This is a problem when running test-is from slime, because when a test throws an exception outside of the 'is' macro, it requires user intervention to

Re: doall and dorun

2008-12-15 Thread Brian Doyle
I'll take a crack at this. It may appear that the doall and dorun return something different with subsequent calls but they don't actually. The doall always returns the sequence (1 2) and dorun always returns nil. The first time (doall x) is called the for loop executes and prints 1 2 (a side

template.clj (r306) in clojure.contrib won't compile

2008-12-15 Thread walterc
the template function is missing parameter binding part of a let --~--~-~--~~~---~--~~ 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

Re: jEdit Mode for Clojure

2008-12-15 Thread Daniel Spiewak
I been thinking about this during the weekend, and I think I prefer the mode to be aware of nesting (unless you can cause it to blow the stack on a large Well, this would be my question: why? :-) Auto-indent needs to be aware of nesting, but that's already handled in a separate pass from the

Re: Gorilla: key combinations

2008-12-15 Thread Meikel Brandmeyer
Hi, On 16 Dez., 04:08, Alex Burka zapper3...@gmail.com wrote: I put plugin/gorilla.vim in /Applications/MacVim.app/Contents/ Resources/vim/runtime/plugin/. The correct way to install Gorilla is to copy the contents of the plugin, after and doc directories to your .vim directory in your home

Re: macroexpand-1 vs. macroexpand

2008-12-15 Thread Konrad Hinsen
On 16.12.2008, at 02:58, Mark Volkmann wrote: I'm trying to understand the difference between these. Is it that macros expanded by macroexpand-1 could result in calls to additional macros that won't be expanded, but macroexpand will continue expanding until no macro calls remain? Right.

Re: jEdit Mode for Clojure

2008-12-15 Thread Daniel Spiewak
Also, it's worth noting that my trick to highlight def-initions probably isn't going to work if we have hierarchical parsing of S- expressions. I'm not entirely sure how jEdit is going to handle certain cases if we try to merge the two. It might be possible to make it work, but I suspect that

Re: understanding quoting

2008-12-15 Thread Mon Key
For FAQ style plain text I like having the RHS comments moved below the S-Expression as I can C-n down the file and do C-x C-e evaluation to REPL as I go. Once the RHS ;;;Comments are below the S-Expressions I find i like having a symbol to indicate the eval = I took the liberty of