Re: Support for new bee

2009-01-07 Thread Christian Vest Hansen
On Wed, Jan 7, 2009 at 8:26 AM, janus wrote: > > It can't figure out why this is not working or was I sleeping while > trying it out. > > (apply #(println %) [2 3]) The #(println %) procedure takes only one argument (because you only have that one % in there) and you are applying it to two, name

Re: Support for new bee

2009-01-07 Thread Christian Vest Hansen
On Wed, Jan 7, 2009 at 9:03 AM, Christian Vest Hansen wrote: > You are effectively trying to do (#(println %) 1 2). Typo. I meant to write (#(println %) 2 3). -- Venlig hilsen / Kind regards, Christian Vest Hansen. --~--~-~--~~~---~--~~ You received this messa

Re: Support for new bee

2009-01-07 Thread Christophe Grand
janus a écrit : > It can't figure out why this is not working or was I sleeping while > trying it out. > > (apply #(println %) [2 3]) > This line is equivalent to (#(println %) 2 3) which errors since #(println %) takes only one argument. user=> (macroexpand '#(println %)) (fn* [p1__3493] (pri

Re: metadata question

2009-01-07 Thread Christophe Grand
rzeze...@gmail.com a écrit : > Looking at how the #^ macro is used in core.clj confuses me even more. > > For example: > > user=> (def #^{:arglist '([name]) :doc "Say hello."} hello (fn hello > [name] (println (str "Hello, " name > #'user/hello > user=> (hello "ryan") > Hello, ryan > nil > > I

Re: yet another Clojure snake

2009-01-07 Thread Tom Ayerst
Hi Mark, I think the def inside a defn has to go, it looks like an accident in waiting. I think you are replacing globals with a "god" structure (game) which passed to every function, I think you need to abstract more. I'm afraid I don't like the "big let" style and I found it hard to follow some

Re: Support for new bee

2009-01-07 Thread Emeka
Chris and Chris Thanks On Wed, Jan 7, 2009 at 9:09 AM, Christophe Grand wrote: > > janus a écrit : > > It can't figure out why this is not working or was I sleeping while > > trying it out. > > > > (apply #(println %) [2 3]) > > > This line is equivalent to (#(println %) 2 3) which errors since

Re: Very noob file reading and printing question

2009-01-07 Thread Tom Ayerst
Thanks Brian. I finally nailed it with: (use '[clojure.contrib.duck-streams :only (reader)]) (with-open [r (reader "doc.txt")] (dorun (for [line (line-seq r)] (do (println line) Cheers Tom 2009/1/6 Brian Doyle > > On Tue, Jan 6, 2009 at 4:47 PM, Tom Ayerst wrote: > >> Its not t

Re: Cons.count overflows stack (with patch)

2009-01-07 Thread Chouser
On Wed, Jan 7, 2009 at 2:41 AM, Christian Vest Hansen wrote: > > On Wed, Jan 7, 2009 at 5:26 AM, Chouser wrote: >> Since I couldn't find any other class that uses this kind of >> recursion for count(), it may be impossible to build a seq that >> would still cause Cons.count() to overflow the sta

Re: Very noob file reading and printing question

2009-01-07 Thread Paul Barry
Here's a little cleaner version using doseq: (use 'clojure.contrib.duck-streams) (with-open [r (reader "doc.txt")] (doseq [line (line-seq r)] (println line))) On Wed, Jan 7, 2009 at 7:27 AM, Tom Ayerst wrote: > Thanks Brian. > > I finally nailed it with: > > (use '[clojure.contrib.duck-strea

Re: Very noob file reading and printing question

2009-01-07 Thread Tom Ayerst
Thanks Barry, I now see what I did. I tried doseq early but it didn't print anything. I had: (with-open [r (reader "doc.txt")] (doseq [line (line-seq r)] println line)) so I wasn't evaluating the println. Cheers Tom 2009/1/7 Paul Barry > Here's a little cleaner version using doseq:

Re: Very noob file reading and printing question

2009-01-07 Thread Paul Barry
No Problem Ayerst :) Just kidding, people call me Barry all the time, even though my first name is Paul. That's the curse of having 2 first names I guess. On Wed, Jan 7, 2009 at 8:17 AM, Tom Ayerst wrote: > Thanks Barry, I now see what I did. > > I tried doseq early but it didn't print anythin

Re: Very noob file reading and printing question

2009-01-07 Thread Tom Ayerst
Oops, sorry Paul (In your favour I expect people can probably pronounce your surname! ;-) Cheers Tom 2009/1/7 Paul Barry > No Problem Ayerst :) Just kidding, people call me Barry all the time, even > though my first name is Paul. That's the curse of having 2 first names I > guess. > > > On W

Re: yet another Clojure snake

2009-01-07 Thread Mark Volkmann
On Wed, Jan 7, 2009 at 12:55 AM, Emeka wrote: > > Hello, > > Why not changing defns create-apple and create-snake to defs create-apple > and snake-create.Your defns have no args that why I feel strongly that they > should def, well I may be wrong. The newest version of my code only has one defn

delimiter and capitalization for clojure-contrib?

2009-01-07 Thread Stuart Halloway
Is there a definitive delimiter and capitalization for the name "clojure-contrib"? I have seen space, hyphen, and dot as a delimiter, plus several different takes on capitalization. Sorry to be a pedant, but copyeditors are tough opponents. :-) Thanks, Stuart --~--~-~--~~-

Re: Cons.count overflows stack (with patch)

2009-01-07 Thread Christian Vest Hansen
On Wed, Jan 7, 2009 at 2:10 PM, Chouser wrote: > > On Wed, Jan 7, 2009 at 2:41 AM, Christian Vest Hansen > wrote: >> >> On Wed, Jan 7, 2009 at 5:26 AM, Chouser wrote: >>> Since I couldn't find any other class that uses this kind of >>> recursion for count(), it may be impossible to build a seq

Re: yet another Clojure snake

2009-01-07 Thread Mark Volkmann
On Wed, Jan 7, 2009 at 3:13 AM, Tom Ayerst wrote: > Hi Mark, > > I think you are replacing globals with a "god" structure (game) which passed > to every function, I think you need to abstract more. That's definitely what I'm doing and I don't like it either. I just haven't worked out a better al

Re: yet another Clojure snake

2009-01-07 Thread Mark Volkmann
On Wed, Jan 7, 2009 at 3:13 AM, Tom Ayerst wrote: > Hi Mark, > > I think the def inside a defn has to go, it looks like an accident in waiting. I'm not sure about that. The value last-key-code is only set in the keyPressed method which is invoked when Swing/AWT detects that the user pressed a ke

Re: yet another Clojure snake

2009-01-07 Thread Christophe Grand
Mark Volkmann a écrit : > I'd > really like to find a way to get rid of that global variable, but I > haven't been able to. You can pass an atom (locally defined in main) to create-panel, and pass it to your step function. Christophe --~--~-~--~~~---~--~~ You re

Re: yet another Clojure snake

2009-01-07 Thread Mark Volkmann
On Wed, Jan 7, 2009 at 3:13 AM, Tom Ayerst wrote: > Hi Mark, > > I'm afraid I don't like the "big let" style and I found it hard to follow > some of your code, that may just be a personal thing but a lot of the vars > defined in let are only used once and could be inlined. I agree they could be

Re: File organization & bootstrapping

2009-01-07 Thread Greg Harman
Nevermind, with a fresh start today (and perhaps more importantly, perhaps, a fresh environment) compiling seems to work fine. > It works for "require" and for calling functions in the package(s), > but the problem now is that it doesn't work for AOT from the REPL. > > (compile 'package1) crashes

Re: yet another Clojure snake

2009-01-07 Thread Mark Volkmann
On Wed, Jan 7, 2009 at 8:52 AM, Christophe Grand wrote: > > Mark Volkmann a écrit : >> I'd >> really like to find a way to get rid of that global variable, but I >> haven't been able to. > You can pass an atom (locally defined in main) to create-panel, and pass > it to your step function. Thanks

Re: metadata question

2009-01-07 Thread Rich Hickey
On Jan 7, 1:01 am, "rzeze...@gmail.com" wrote: > Looking at how the #^ macro is used in core.clj confuses me even more. > > For example: > > user=> (def #^{:arglist '([name]) :doc "Say hello."} hello (fn hello > [name] (println (str "Hello, " name > #'user/hello > user=> (hello "ryan") > He

Re: File organization & bootstrapping

2009-01-07 Thread Phil Hagelberg
> I think you may be working at too low a level with "load". You should > be able to accomplish the same thing with: > > (ns my-app > (:require package1 package2)) > > (package2/start-app) > > my_app, package1, and package2 all need to be immediately under a > directory (or JAR file

Agent thread pool OOM

2009-01-07 Thread durka
I ran to into some strange agent behavior today that may be a bug. An agent apparently exhausted the JVM available memory and threw an OutOfMemoryError -- but it didn't go anywhere. I saw the error in the console, but I couldn't get at it from the REPL: agent-errors still returned nil and .getQueu

what's wrong with this?

2009-01-07 Thread wubbie
Hi all, I'm attempting to provide 2 type hints here and not working... (defn my-fn [#^String s #^Integer i] (println format("%s %d" s i))) (my-fn "hello" (new Integer 123)) Thanks Sun --~--~-~--~~~---~--~~ You received this message because you are subscribed to

Re: Agent thread pool OOM

2009-01-07 Thread Rich Hickey
On Jan 7, 2:14 am, durka wrote: > I ran to into some strange agent behavior today that may be a bug. An > agent apparently exhausted the JVM available memory and threw an > OutOfMemoryError -- but it didn't go anywhere. I saw the error in the > console, but I couldn't get at it from the REPL: a

Re: what's wrong with this?

2009-01-07 Thread Stuart Halloway
Try: (defn my-fn [#^String s #^Integer i] (println (format"%s %d" s i))) #'user/my-fn user=> (my-fn 1 "foo") java.util.IllegalFormatConversionException: d != java.lang.String (NO_SOURCE_FILE:0) user=> (my-fn "foo" 1) foo 1 Stuart > > Hi all, > > I'm attempting to provide 2 type hints here a

Re: what's wrong with this?

2009-01-07 Thread wubbie
typo... and looks working... should be (println (format "%s %d" s i))) On Jan 7, 10:44 am, wubbie wrote: > Hi all, > > I'm attempting to provide 2 type hints here and not working... > > (defn my-fn [#^String s #^Integer i] (println format("%s %d" s i))) > (my-fn "hello" (new Integer 123)) > > T

Re: per-defmulti hierarchies

2009-01-07 Thread Rich Hickey
On Jan 5, 4:56 pm, Meikel Brandmeyer wrote: > Dear Clojurians, > > This patch allows multimethods to use different hierarchies, than > the global hierarchy for use with isa?. Currently only the global > hierarchy is possible. > > The patch extends the MultiFn class to accept also a Var pointing

Re: delimiter and capitalization for clojure-contrib?

2009-01-07 Thread Chouser
On Wed, Jan 7, 2009 at 9:45 AM, Stuart Halloway wrote: > > Is there a definitive delimiter and capitalization for the name > "clojure-contrib"? I have seen space, hyphen, and dot as a delimiter, > plus several different takes on capitalization. > > Sorry to be a pedant, but copyeditors are tough

Re: per-defmulti hierarchies

2009-01-07 Thread Meikel Brandmeyer
Hi Rich, Am 07.01.2009 um 17:10 schrieb Rich Hickey: Thanks Meikel. I have a couple of points: First, making derive and underive act on vars instead of the hierarchies directly is not good - it reduces the generality needlessly. Good practice is to make pure fns, then do the reference part, no

Re: metadata question

2009-01-07 Thread rzeze...@gmail.com
On Jan 7, 10:37 am, Rich Hickey wrote: > On Jan 7, 1:01 am, "rzeze...@gmail.com" wrote: > > > Looking at how the #^ macro is used in core.clj confuses me even more. > > > For example: > > > user=> (def #^{:arglist '([name]) :doc "Say hello."} hello (fn hello > > [name] (println (str "Hello, "

nested transactions

2009-01-07 Thread Mark Volkmann
Are there any particular issues with using nested transactions ... dosync inside a dosync ... in Clojure? -- R. Mark Volkmann Object Computing, Inc. --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups "Clojure" group.

Simple example of using postgresql with contrib.sql...

2009-01-07 Thread ssecorp
This was going to be a question but I solved it before I finished the post :) Figured I might post the solution then, hopefully it will help someone else. (import '(java.sql Connection DriverManager ResultSet SQLException Statement ResultSetMetaData)) (import '(org.postgresql

atom swap! and retry

2009-01-07 Thread Mark Volkmann
What is it that triggers the function passed to swap! to be retried? Is it that some other thread has modified the atom since swap! was invoked, but before the function passed to swap! returns? -- R. Mark Volkmann Object Computing, Inc. --~--~-~--~~~---~--~~ You

Re: nested transactions

2009-01-07 Thread Rich Hickey
On Jan 7, 12:07 pm, "Mark Volkmann" wrote: > Are there any particular issues with using nested transactions ... > dosync inside a dosync ... in Clojure? > Nope. Just note that nested transactions 'join' the enclosing transaction - they commit with it. Essentially there is only the outermost tr

Re: atom swap! and retry

2009-01-07 Thread Rich Hickey
On Jan 7, 12:11 pm, "Mark Volkmann" wrote: > What is it that triggers the function passed to swap! to be retried? > Is it that some other thread has modified the atom since swap! was > invoked, but before the function passed to swap! returns? > > -- I think that's described pretty well here:

Re: File organization & bootstrapping

2009-01-07 Thread Greg Harman
This is frustrating - with a fresh REPL I'm back to the compile problem. I can't think of anything I changed that would cause it to work intermittently, and I don't know what file it's looking for... the source files are on the classpath (it "require"s just fine) and the directory in *compile-path

Re: File organization & bootstrapping

2009-01-07 Thread Greg Harman
> One solution would be to load a single file and then have that file use > add-classpath to set the classpath, but add-classpath is unreliable; > I've had problems getting it to work consistently and have been told in > #clojure that I shouldn't be using it. Possibly the cause of the compile pro

Re: nested transactions

2009-01-07 Thread wubbie
So nested transactions only keep track of nesting level similar to that in Sybase? Sun On Jan 7, 12:18 pm, Rich Hickey wrote: > On Jan 7, 12:07 pm, "Mark Volkmann" wrote: > > > Are there any particular issues with using nested transactions ... > > dosync inside a dosync ... in Clojure? > > Nop

Re: File organization & bootstrapping

2009-01-07 Thread Shawn Hoover
On Wed, Jan 7, 2009 at 12:34 PM, Greg Harman wrote: > > This is frustrating - with a fresh REPL I'm back to the compile > problem. I can't think of anything I changed that would cause it to > work intermittently, and I don't know what file it's looking for... > the source files are on the classpa

Re: delimiter and capitalization for clojure-contrib?

2009-01-07 Thread Stuart Halloway
Works for me. I am going to go with clojure-contrib if nobody pushes strongly for something else. Maybe I'll even commit a README file. :-) Stuart > On Wed, Jan 7, 2009 at 9:45 AM, Stuart Halloway > wrote: >> >> Is there a definitive delimiter and capitalization for the name >> "clojure-contr

Re: File organization & bootstrapping

2009-01-07 Thread Greg Harman
Bingo - *compile-path* was a relative dir. Defining it as the full path did the trick. Thanks! > Also, make sure the directory named by *compile-path* exists on the file > system. Compilation creates subdirs, but not *compile-path* itself. --~--~-~--~~~---~--~~ Y

Re: File organization & bootstrapping

2009-01-07 Thread Shawn Hoover
On Wed, Jan 7, 2009 at 1:45 PM, Greg Harman wrote: > > Bingo - *compile-path* was a relative dir. Defining it as the full > path did the trick. > > Thanks! > > > Also, make sure the directory named by *compile-path* exists on the file > > system. Compilation creates subdirs, but not *compile-path

writing bytes to a file

2009-01-07 Thread Brian Doyle
I couldn't find anything in core or contrib that wrote out bytes to a file so I wrote something to do it. Is this functionality already implemented and I just couldn't find it? If there isn't anything already, would this be something good to put in contrib somewhere? Thanks. (defn write-by

Re: writing bytes to a file

2009-01-07 Thread Paul Barry
clojure.contrib.duck_streams/spit? On Wed, Jan 7, 2009 at 2:14 PM, Brian Doyle wrote: > I couldn't find anything in core or contrib that wrote out > bytes to a file so I wrote something to do it. Is this > functionality already implemented and I just couldn't find > it? If there isn't anythi

Re: File organization & bootstrapping

2009-01-07 Thread Stephen C. Gilardi
On Jan 7, 2009, at 2:04 PM, Shawn Hoover wrote: Clojure developers, would it be a good idea for Compiler.java or clojure.core/compile to check if *compile-path* exists, else throw an exception specific to that problem? I like the idea. There is a subtle problem I don't think it will catch

Re: writing bytes to a file

2009-01-07 Thread Brian Doyle
Looks like spit is for printing just text. On Wed, Jan 7, 2009 at 12:20 PM, Paul Barry wrote: > clojure.contrib.duck_streams/spit? > > > On Wed, Jan 7, 2009 at 2:14 PM, Brian Doyle wrote: > >> I couldn't find anything in core or contrib that wrote out >> bytes to a file so I wrote something to

Re: Simple example of using postgresql with contrib.sql...

2009-01-07 Thread Stephen C. Gilardi
On Jan 7, 2009, at 12:11 PM, ssecorp wrote: This was going to be a question but I solved it before I finished the post :) Figured I might post the solution then, hopefully it will help someone else. Very cool. (ns progs.netflix.db (:require (clojure.contrib [sql :as sql])) (:require

Re: atom swap! and retry

2009-01-07 Thread Mark Volkmann
On Wed, Jan 7, 2009 at 11:21 AM, Rich Hickey wrote: > > On Jan 7, 12:11 pm, "Mark Volkmann" wrote: >> What is it that triggers the function passed to swap! to be retried? >> Is it that some other thread has modified the atom since swap! was >> invoked, but before the function passed to swap! ret

Re: Adding user-defined state to classes created with (proxy ...)

2009-01-07 Thread Greg Harman
Chouser, Do you have an example of gen-interface + proxy working together? Take a look at the following. Proxy works fine for a Java-provided interface, but not for the generated one (ICompileTest.class is being generated and is in the filesystem/classpath where expected.) (ns compiletest) (gen-

Re: File organization & bootstrapping

2009-01-07 Thread Craig McDaniel
Getting back to Phil Hagelberg's comment that maintaining a project's classpath in both a SLIME config and shell script for each project/ application is a "Don't Repeat Yourself" violation, there is a way to avoid that: Don't bother with swank-clojure-extra-classpaths. Instead, include / path/to/

Re: yet another Clojure snake

2009-01-07 Thread Nathan Kitchen
On Jan 7, 7:01 am, "Mark Volkmann" wrote: > On Wed, Jan 7, 2009 at 3:13 AM, Tom Ayerst wrote: > > Hi Mark, > > > I'm afraid I don't like the "big let" style and I found it hard to follow > > some of your code, that may just be a personal thing but a lot of the vars > > defined in let are only us

Re: Adding user-defined state to classes created with (proxy ...)

2009-01-07 Thread Chouser
On Wed, Jan 7, 2009 at 3:18 PM, Greg Harman wrote: > > Do you have an example of gen-interface + proxy working together? You're calling my bluff, eh? Well, no I don't yet. I'm doing ugly hacky things instead, to avoid the compile step. But since you've thrown down the gauntlet, to mix some me

AOT compilation and reloading of namespaces

2009-01-07 Thread Meikel Brandmeyer
Dear Clojurians, I found an issue with (require :reload ...) and AOT compilation. Files "load"ed in a multi-file namespace get not correctly reloaded when AOT compiled. user=> (compile 'foo) foo user=> (require :reload-all :verbose 'foo) (clojure.core/load "/foo") (clojure.core/load "/bar") nil

Re: yet another Clojure snake

2009-01-07 Thread Tom Ayerst
Honestly? The second one, but I did say I didn't like the 'big let' style, maybe that is why. Cheers Tom 2009/1/7 Mark Volkmann > > On Wed, Jan 7, 2009 at 3:13 AM, Tom Ayerst wrote: > > Hi Mark, > > > I agree they could be inlined, but I find that style easier to read. > For example, these a

Re: Adding user-defined state to classes created with (proxy ...)

2009-01-07 Thread Greg Harman
> You're calling my bluff, eh?  Well, no I don't yet. Although I have been known to do some bluff-calling, in this case I was actually hoping you had done it because I need this for a project I'm working on. :-) > I think the problem with your example is trying to work with classes > or namespac

Re: yet another Clojure snake

2009-01-07 Thread Mark Volkmann
On Wed, Jan 7, 2009 at 3:05 PM, Tom Ayerst wrote: > Honestly? The second one, but I did say I didn't like the 'big let' style, > maybe that is why. I think I may be in the minority on this. I suspect there are more people currently using Clojure who came to it from a Lisp background than a Java

contrib/sql with postgresql, problem inserting into column of type date

2009-01-07 Thread ssecorp
(defn inse [] (sql/with-connection db (sql/transaction (insert-rows :r [[1 2 "date '2008-12-03'" 3]]))) nil) I have tried all kinds of variations. it works perfectly with another table, like (int,int,int,int) and passing [1,2,3,4] so it is the type of column 3 that is the problem. "

Re: contrib/sql with postgresql, problem inserting into column of type date

2009-01-07 Thread Stuart Halloway
The sample code for the book now includes a clojure.contrib.sql example with date handling that may be helpful [1]. I tested with HSQLDB, please let me know if it doesn't work with postgresql. Cheers, Stuart [1] http://github.com/stuarthalloway/programming-clojure/tree/master/examples/snipp

Re: File organization & bootstrapping

2009-01-07 Thread Phil Hagelberg
Craig McDaniel writes: > Connect to your running app from emacs by using "M-x slime-connect" > rather than "M-x slime". When you're done, use "M-x slime- > disconnect" (or from the REPL, "," then "disconnect") to leave your > process running. In addtion, including swank in your running > product

Re: Simple example of using postgresql with contrib.sql...

2009-01-07 Thread ssecorp
I tried to use connection in internal to get resultSetMetadata but I never succeeded with it. --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups "Clojure" group. To post to this group, send email to clojure@googlegroups.

Re: Simple example of using postgresql with contrib.sql...

2009-01-07 Thread ssecorp
and user.clj function wasn't avilable without importing it when I try to access them if I put a file ina namespace. On Jan 7, 8:27 pm, "Stephen C. Gilardi" wrote: > On Jan 7, 2009, at 12:11 PM, ssecorp wrote: > > > > > This was going to be a question but I solved it before I finished the > > pos

re-find

2009-01-07 Thread Jeff Foster
I'm not understanding re-find. (re-find #"bar" "bar") => "bar" whereas (re-find #"(foo)|(bar)" "foo bar") => ["foo" "foo" nil] Why does one return a vector and one just the result directly? Looking at the code, re-find uses re-groups which explicitly says that it either returns a vector or a

Re: yet another Clojure snake

2009-01-07 Thread Korny Sietsma
As a complete clojure newbie (hi folks!) from a Ruby/Java background, I kind-of don't like either - I'd pull out a named function like: (def add-mix-and-beat [bowl, dry-ingredients wet-ingredients] ... and then use your second example, but now it's: (def make-cookies-2a [flower baking-soda salt

Re: re-find

2009-01-07 Thread Randall R Schulz
On Wednesday 07 January 2009 15:21, Jeff Foster wrote: > I'm not understanding re-find. > > (re-find #"bar" "bar") => "bar" > > whereas > > (re-find #"(foo)|(bar)" "foo bar") => ["foo" "foo" nil] > > Why does one return a vector and one just the result directly? The use of capturing parentheses i

Re: re-find

2009-01-07 Thread Stephen C. Gilardi
On Jan 7, 2009, at 6:21 PM, Jeff Foster wrote: Looking at the code, re-find uses re-groups which explicitly says that it either returns a vector or a string. This is clunky to deal with - is there any reason it doesn't always return a vector? Whether it returns a vector or string depends on

Re: Simple example of using postgresql with contrib.sql...

2009-01-07 Thread Stephen C. Gilardi
On Jan 7, 2009, at 6:20 PM, ssecorp wrote: I tried to use connection in internal to get resultSetMetadata but I never succeeded with it. In the current svn version of clojure.contrib, connection is available without using sql.internal. Also, there's now an example of getting connection me

sort behavior question

2009-01-07 Thread Dmitri
I noticed strange behavior in the sort function, I was sorting key value tuples and ran into the following: when sorting 2 item vectors such as [1 [1 2 3]] sort works fine: (println (sort (map (fn [x] [(int (* (Math/random) 10)) x]) (for [x (range 4)] [1 2 3] output: (

update in place for unique references

2009-01-07 Thread Mark P
I am new to clojure, but it seems very interesting. Has anyone thought about allowing "update in place" for situations where it is safe? Suppose you have (def y (tripleit x)) and you know that there is only a single reference to x at this point, then it would be safe to implement it as "y

Slime buffer ns is always user

2009-01-07 Thread Zak Wilson
I'm using the latest Slime, swank-clojure and Clojure, with a fix from Chousuke to start up the REPL properly. I have no problem setting the namespace in the REPL, but anything I eval directly from a file (i.e. with C-x C-e) gets evaluated in the user ns. The ns in the *inferior-lisp* buffer rema

Gen-interface signature

2009-01-07 Thread Greg Harman
I'm playing around with gen-interface, and compiled the following: (ns mypkg.compiletest) (gen-interface :name mypkg.ICompileTest :methods [['foo [] []]]) I then used a java .class decompiler to look at the resulting .class file expecting to see an interface with a single method c

Re: sort behavior question

2009-01-07 Thread .Bill Smith
I wonder if the root cause might be clearer if you were to review the documentation for the sort function and then apply what it says to a smaller dataset, e.g. a pair of lists. Bill --~--~-~--~~~---~--~~ You received this message because you are subscribed to the

Re: Slime buffer ns is always user

2009-01-07 Thread Bill Clementson
On Wed, Jan 7, 2009 at 7:25 PM, Zak Wilson wrote: > > I'm using the latest Slime, swank-clojure and Clojure, with a fix from > Chousuke to start up the REPL properly. I have no problem setting the > namespace in the REPL, but anything I eval directly from a file (i.e. > with C-x C-e) gets evaluat

Re: Slime buffer ns is always user

2009-01-07 Thread Zak Wilson
> First, compile the buffer with C-c > C-k. Then, evaluate new definitions in the same source file and they > will be evaluated in the correct namespace (regardless of what > namespace is active in the repl). That's what I expected, but it doesn't work; new definitions are evaluated in user. It s

Re: Slime buffer ns is always user

2009-01-07 Thread Bill Clementson
On Wed, Jan 7, 2009 at 11:49 PM, Zak Wilson wrote: > >> First, compile the buffer with C-c >> C-k. Then, evaluate new definitions in the same source file and they >> will be evaluated in the correct namespace (regardless of what >> namespace is active in the repl). > > That's what I expected, but