Re: problems with slime and emacs
On Nov 1, 4:47 am, Chanwoo Yoo <[EMAIL PROTECTED]> wrote: > Hi. With a latest version of slime, I can not make slime working > properly with clojure on Mac(Leopard). I tried it as instructions of > clojure wiki, a readme file in swank-clojure, and emacs/slime/clojure > tutorial on ubuntu, but in the every case, slime shows some error > messages. > > When I type m+x run-clojure, a user prompte appears with errors: > > (clojure/add-classpath "file:Users/chanwoo/Documents/lisp/clojure/ > swank-clojure/") > > (clojure/require (quote > swank)) > > (swank/ignore-protocol-version "2008-10-31") > > (swank/start-server "/var/folders/Zc/ZcIgibUaGyWC8sCN4S4Y9TI/-Tmp-/ > slime.33346" :encoding "iso-latin-1-unix") > > Clojure > user=> > nil > user=> java.lang.Exception: Unable to resolve symbol: *1 in this > context > clojure.lang.Compiler$CompilerException: core.clj:124: Unable to > resolve symbol: *1 in this context AFAIK, you should be using Clojure compiled from the most recent SVN sources, not release tarballs. Regards. --~--~-~--~~~---~--~~ 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 email to [EMAIL PROTECTED] For more options, visit this group at http://groups.google.com/group/clojure?hl=en -~--~~~~--~~--~--~---
Re: problems with slime and emacs
Hi. With a latest version of slime, I can not make slime working properly with clojure on Mac(Leopard). I tried it as instructions of clojure wiki, a readme file in swank-clojure, and emacs/slime/clojure tutorial on ubuntu, but in the every case, slime shows some error messages. When I type m+x run-clojure, a user prompte appears with errors: (clojure/add-classpath "file:Users/chanwoo/Documents/lisp/clojure/ swank-clojure/") (clojure/require (quote swank)) (swank/ignore-protocol-version "2008-10-31") (swank/start-server "/var/folders/Zc/ZcIgibUaGyWC8sCN4S4Y9TI/-Tmp-/ slime.33346" :encoding "iso-latin-1-unix") Clojure user=> nil user=> java.lang.Exception: Unable to resolve symbol: *1 in this context clojure.lang.Compiler$CompilerException: core.clj:124: Unable to resolve symbol: *1 in this context Caused by: java.lang.Exception: No such var: swank/start- server at clojure.lang.Compiler.resolveIn(Compiler.java: 4002) at clojure.lang.Compiler.resolve(Compiler.java: 3972) at clojure.lang.Compiler.analyzeSymbol(Compiler.java: 3955) at clojure.lang.Compiler.analyze(Compiler.java: 3686) ... 15 more user=> Polling "/var/folders/Zc/ZcIgibUaGyWC8sCN4S4Y9TI/-Tmp-/slime. 33346".. (Abort with `M-x slime-abort-connection'.) my .emacs file: ;;clojure mode (add-to-list 'load-path "/Users/chanwoo/Documents/lisp/clojure/clojure- mode") (require 'clojure-auto) ;;slime (add-to-list 'load-path "/Users/chanwoo/Documents/lisp/clojure/ slime") (require 'slime) (slime- setup) (add-to-list 'load-path "/Users/chanwoo/Documents/lisp/clojure/swank- clojure") (setq swank-clojure-jar-path "/Users/chanwoo/Documents/lisp/clojure/ clojure_20080916/clojure.jar") (require 'swank-clojure- autoload) (defun run-clojure () "Starts clojure in Slime" (interactive) (slime 'clojure)) Is vim setup with clojure easy than emacs? I have been used only emacs with lisp, have no experience with vim... --~--~-~--~~~---~--~~ 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 email to [EMAIL PROTECTED] For more options, visit this group at http://groups.google.com/group/clojure?hl=en -~--~~~~--~~--~--~---
Re: Clojure documentation via mind map diagram
On Oct 31, 9:06 am, bc <[EMAIL PROTECTED]> wrote: > On my blog, I've posted an alternative way to navigate the Clojure > documentation:http://bc.tech.coop/blog/081031.html While this is being said, does Rich Hickey consider switching the pages on the Clojure website to a more consistent documentation format? (Let's not start a war between LaTeX vs. DocBook vs. Texi. I'm ok with any such scheme, as long as there is a scheme.) In this way, people will be able to download the documentation and convert it to any appropriate format (e.g PDF for printing) they desire. OTOH, it'll open the way for people to contribute to the documentation by patches, etc. Regards. --~--~-~--~~~---~--~~ 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 email to [EMAIL PROTECTED] For more options, visit this group at http://groups.google.com/group/clojure?hl=en -~--~~~~--~~--~--~---
Re: problems with slime and emacs
On Oct 31, 5:59 pm, "[EMAIL PROTECTED]" <[EMAIL PROTECTED]> wrote: > I'm struggling to get slime and emacs to work together. I copied the > code from the readme included with swank-clojure, but am running into > an error. Just for the records, there are some problems with both swank-clojure code and README instructions. I've sent a mail to its author with appropriate bug reports and fixes, but no replies yet. Anyway, here are my foundings. - One must specify SWANK-CLOJURE-JAR-PATH and SWANK-CLOJURE-JAR-PATH variables before calling (require 'swank-clojure-autoload). (It'd also be good to mention about SWANK-CLOJURE-JAVA-PATH in the README.) - SWANK-CLOJURE-CMD fails for relative paths. See http://paste.lisp.org/display/69530 for a fixed version. (I tweaked error message too. See documentation of ERROR.) I hope above points would help to others as well. Regards. --~--~-~--~~~---~--~~ 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 email to [EMAIL PROTECTED] For more options, visit this group at http://groups.google.com/group/clojure?hl=en -~--~~~~--~~--~--~---
Re: Defining own data types on top of Persistent ones
Hi André, Am 31.10.2008 um 22:48 schrieb André Thieme: Can anybody give a very simple/minimal implementation of lists/ vectors/ maps in Clojure? A 5-20 lines (proxy ...) example that would allow me to say (def a (make-lyst 1 2 3)) and run several list functions on it? There is my lazy-map package. It doesn't use proxy, because I needed an additional method, which the proxy doesn't allow. However it is not very big and the methods are reasonable short to be easily understood. It turns any map given into a lazy map, which does not evaluate the value associated with a key until it is accessed. So this is maybe a good example of a modified data structure. The package may be found at: http://kotka.de/projects/clojure/lazy-map.html Sincerely Meikel smime.p7s Description: S/MIME cryptographic signature
Re: Defining own data types on top of Persistent ones
Stuart Sierra schrieb: > On Oct 31, 1:20pm, André Thieme <[EMAIL PROTECTED]> wrote: > > But unfortunately (make-lyst 1 2 3) ==> > > java.lang.ClassCastException: clojure.lang.Proxy__5307 cannot be cast > > to clojure.lang.ISeq > > > > Any ideas how this should be done so that it will work? > > I think the problem here is that IPersistentList is just an interface > -- it does not define any behavior. You probably need to proxy a > concrete class like PersistentList. Simply replacing clojure.lang.IPersistentList with clojure.lang.PersistentList didn’t help. Although this time the error message is different: (make-lyst 1 2 3) ==> java.lang.IllegalArgumentException: No matching ctor found for class clojure.lang.Proxy__3761 Can anybody give a very simple/minimal implementation of lists/vectors/ maps in Clojure? A 5-20 lines (proxy ...) example that would allow me to say (def a (make-lyst 1 2 3)) and run several list functions on 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.com To unsubscribe from this group, send email to [EMAIL PROTECTED] For more options, visit this group at http://groups.google.com/group/clojure?hl=en -~--~~~~--~~--~--~---
Re: Defining own data types on top of Persistent ones
On Oct 31, 1:20 pm, André Thieme <[EMAIL PROTECTED]> wrote: > But unfortunately (make-lyst 1 2 3) ==> > java.lang.ClassCastException: clojure.lang.Proxy__5307 cannot be cast > to clojure.lang.ISeq > > Any ideas how this should be done so that it will work? I think the problem here is that IPersistentList is just an interface -- it does not define any behavior. You probably need to proxy a concrete class like PersistentList. -Stuart Sierra --~--~-~--~~~---~--~~ 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 email to [EMAIL PROTECTED] For more options, visit this group at http://groups.google.com/group/clojure?hl=en -~--~~~~--~~--~--~---
Re: Memory usage when iterating over lazy sequences
On Oct 31, 1:57 pm, Mark Triggs <[EMAIL PROTECTED]> wrote: > When I ran my code it very quickly ran out of memory and fell over. > After thinking about it for a while I've realised it must be because my > 'do-something' function call is hanging on to the head of the list, so > as its elements are realised and cached it gradually eats up all my > memory. Answering my own question, using the function itself as the recur target does exactly what I want: ;; Process the list one chunk at a time (defn do-something [biglist] (when biglist (doall (take 1000 biglist)) (recur (drop 1000 biglist I guess I should have tried it instead of assuming it wouldn't work. Please excuse my talking to myself :o) Cheers, Mark --~--~-~--~~~---~--~~ 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 email to [EMAIL PROTECTED] For more options, visit this group at http://groups.google.com/group/clojure?hl=en -~--~~~~--~~--~--~---
Re: (in-ns 'java)
On Oct 31, 2:57 pm, André Thieme <[EMAIL PROTECTED]> wrote: > I get a funny result when I say (in-ns 'java), on the repl. > I can’t switch back, as in (in-ns 'user). So don't do that. :) Seriously, though, it looks like the Java runtime restricts the "java" package. Clojure namespaces are (more or less) Java packages, which is probably the source of the problem. So... don't do that. user=> (in-ns 'java) #=(find-ns java) java=> (in-ns 'user) java.lang.RuntimeException: java.lang.SecurityException: Prohibited package name: java (NO_SOURCE_FILE:0) user=> (in-ns 'java.lang) #=(find-ns java.lang) java.lang=> (in-ns 'user) java.lang.RuntimeException: java.lang.SecurityException: Prohibited package name: java.lang (NO_SOURCE_FILE:0) -Stuart Sierra --~--~-~--~~~---~--~~ 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 email to [EMAIL PROTECTED] For more options, visit this group at http://groups.google.com/group/clojure?hl=en -~--~~~~--~~--~--~---
Re: problems with slime and emacs
I believe you need to be using a newer version from SVN for this to work correctly. (probably a good idea anyway as some important fixes have made it in since that release.) On Fri, Oct 31, 2008 at 1:31 PM, Matthias Benkard <[EMAIL PROTECTED]> wrote: > > Hi, > >> I'm sure it's something trivial that I'm missing. > > I'm not so sure. > >> (require 'swank-clojure-autoload) >> (swank-clojure-config >> (setq swank-clojure-jar-path "/Users/clk/Documents/Development/ >> Languages/lisp/clojure_20080916/clojure.jar") >> (setq swank-clojure-extra-classpaths (list "/Users/clk/.emacs.d/ >> clojure-extra"))) > > Try this instead: > >(setq swank-clojure-jar-path "/Users/clk/Documents/Development/ > Languages/lisp/clojure_20080916/clojure.jar") >(setq swank-clojure-extra-classpaths (list "/Users/clk/.emacs.d/ > clojure-extra")) >(require 'swank-clojure-autoload) > > I'm a bit confused about this, too. What the README says doesn't work > for me either (or maybe I'm missing something as well). > > Matthias > > > --~--~-~--~~~---~--~~ 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 email to [EMAIL PROTECTED] For more options, visit this group at http://groups.google.com/group/clojure?hl=en -~--~~~~--~~--~--~---
(in-ns 'java)
I get a funny result when I say (in-ns 'java), on the repl. I can’t switch back, as in (in-ns 'user). --~--~-~--~~~---~--~~ 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 email to [EMAIL PROTECTED] For more options, visit this group at http://groups.google.com/group/clojure?hl=en -~--~~~~--~~--~--~---
Re: problems with slime and emacs
Hi, > I'm sure it's something trivial that I'm missing. I'm not so sure. > (require 'swank-clojure-autoload) > (swank-clojure-config > (setq swank-clojure-jar-path "/Users/clk/Documents/Development/ > Languages/lisp/clojure_20080916/clojure.jar") > (setq swank-clojure-extra-classpaths (list "/Users/clk/.emacs.d/ > clojure-extra"))) Try this instead: (setq swank-clojure-jar-path "/Users/clk/Documents/Development/ Languages/lisp/clojure_20080916/clojure.jar") (setq swank-clojure-extra-classpaths (list "/Users/clk/.emacs.d/ clojure-extra")) (require 'swank-clojure-autoload) I'm a bit confused about this, too. What the README says doesn't work for me either (or maybe I'm missing something as well). Matthias --~--~-~--~~~---~--~~ 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 email to [EMAIL PROTECTED] For more options, visit this group at http://groups.google.com/group/clojure?hl=en -~--~~~~--~~--~--~---
Re: problems with slime and emacs
This works for me: (add-to-list 'load-path (expand-file-name "~/src/slime")) (require 'slime) (add-to-list 'load-path (expand-file-name "~/src/clojure-mode")) (require 'clojure-auto) (add-to-list 'load-path (expand-file-name "~/src/swank-clojure")) (setq swank-clojure-jar-path (expand-file-name "~/clojure_20080916/ clojure.jar")) (setq swank-clojure-extra-classpaths (list (file-truename "~/share/ java/*"))) (setq swank-clojure-library-paths (list (file-truename "~/lib"))) (require 'swank-clojure-autoload) On Oct 31, 11:59 am, "[EMAIL PROTECTED]" <[EMAIL PROTECTED]> wrote: > Hello all, > > I'm struggling to get slime and emacs to work together. I copied the > code from the readme included with swank-clojure, but am running into > an error. I'm sure it's something trivial that I'm missing. Here is > what I have in my .emacs copied from the various readme files. > > ;; clojure mode > (add-to-list 'load-path "~/.emacs.d/clojure-mode") > > (require 'clojure-auto) > ;; or if you use paredit, uncomment the following > ;; (require 'clojure-paredit) > > ;; swank clojure > (add-to-list 'load-path "/Users/clk/.emacs.d/swank-clojure") > > (require 'swank-clojure-autoload) > (swank-clojure-config > (setq swank-clojure-jar-path "/Users/clk/Documents/Development/ > Languages/lisp/clojure_20080916/clojure.jar") > (setq swank-clojure-extra-classpaths (list "/Users/clk/.emacs.d/ > clojure-extra"))) > > ;; Add sbcl back in > (add-to-list 'slime-lisp-implementations '(sbcl ("sbcl"))) > > That results in the following error: > > ad-Orig-error: Error: You must specify a swank-clojure-jar-path. > Please see README of swank-clojure. > > I copied the code above from the readme. And yes, the path to the > clojure.jar is correct. > > I'm using emacs 22 on OSX. --~--~-~--~~~---~--~~ 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 email to [EMAIL PROTECTED] For more options, visit this group at http://groups.google.com/group/clojure?hl=en -~--~~~~--~~--~--~---
Defining own data types on top of Persistent ones
In #Clojure Rich mentioned today that we can define our own data structures on top of the existing ones. Maybe someone wants/needs his own version of vectors that rearrange automatically in some specific order or whatever. If I now want to add something that works nearly like lists, but a little bit different, and for which I can use all functions that work for lists, I will have to use a proxy. Chris Houser implemented a little helper tool: http://paste.lisp.org/display/67122#1 Now what I would like to see are some minimal examples on how to do that. Lists are a good candidate as they only have 6 methods which we need to implement: user> (show clojure.lang.IPersistentList) === #=clojure.lang.IPersistentList === [ 0] cons : interface clojure.lang.IPersistentCollection (1) [ 1] count : int (0) [ 2] empty : interface clojure.lang.IPersistentCollection (0) [ 3] peek : class java.lang.Object (0) [ 4] pop : interface clojure.lang.IPersistentStack (0) [ 5] seq : interface clojure.lang.ISeq (0) nil The numbers in parens at the end tell us how many parameters the methods should have. They have a hidden one more. We can magically use “this”. Here is what I tried: user> (defn make-lyst [& items] (proxy [clojure.lang.IPersistentList] [] (cons [obj] (cons obj this)) (count [] (count this)) (empty [] ()) (peek [] 5) (pop [] 6) (seq [] this))) As I found no examples yet, I was hoping this would return an instance of my own list type. (make-lyst 1 2 3) would print like normal lists: (1 2 3) And it would use the cons function of lists, dito for counting. (empty lyst) would return an empty IPersistentList, peek always a 5, pop always a 6 and seq the list object itself. But unfortunately (make-lyst 1 2 3) ==> java.lang.ClassCastException: clojure.lang.Proxy__5307 cannot be cast to clojure.lang.ISeq Any ideas how this should be done so that it will work? --~--~-~--~~~---~--~~ 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 email to [EMAIL PROTECTED] For more options, visit this group at http://groups.google.com/group/clojure?hl=en -~--~~~~--~~--~--~---
Re: macro questions, "can't embed unreadable..."
It's possible but very ugly. You need to force the reader to make two passes over the code, using eval. Here's what I came up with: (defmacro declare-init [vecs] `(doseq v# ~(if (symbol? vecs) vecs (list 'quote vecs)) (eval (list 'def (first v#) (second v#) In use: user=> (declare-init [[a 1] [b 2] [c 3]]) nil user=> a 1 user=> c 3 user=> (def myvec '[[d 1] [e 2] [f 3]]) #=(var user/myvec) user=> (declare-init myvec) nil user=> d 1 user=> f 3 I do not recommend this approach, since debugging it can get hairy very fast. If you need to def global vars based on run-time data, chances are that you're Doing It Wrong. But it is possible. On Oct 31, 2:02 am, mb <[EMAIL PROTECTED]> wrote: > Hi, > > On 31 Okt., 05:30, "Stephen C. Gilardi" <[EMAIL PROTECTED]> wrote: > > > It works with a literal for vecs: > > > user=> (declare-init [[a 1] [b 2] [c 3]]) > > #=(var user/c) > > > But if I def the seq of seqs: > > > user=> (def myvecs '[[a 1] [b 2] [c 3]]) > > #=(var user/myvecs) > > user=> myvecs > > [[a 1] [b 2] [c 3]] > > user=> (declare-init myvecs) > > java.lang.IllegalArgumentException: Don't know how to create ISeq > > from: myvecs (Symbol) (NO_SOURCE_FILE:17) > > For my understanding, the answer is: it is not possible to make > declare-init work that way. The declare-init call only sees the Symbol > myvecs. It doesn't resolve the var behind or whatever, since the > declare happens at compile time. Think (def myvecs > (terrible-computation)). However with literal vectors you actually get > the data structures themselves (containing symbols). > > Why should (declare-init foo) resolve foo, but (declare-init [foo 5]) > should not resolve foo? > > Another question: Why not unify both? > > (defmacro declare > [& vars] > `(do > ~@(map (fn [x] > (if (vector? x) > `(def [EMAIL PROTECTED]) > `(def ~x))) > vars))) > > (declare foo [bar 5]) > > Using defvar instead of def from clojure.contrib.def > one even gets automatic docstrings. > > Sincerely > Meikel --~--~-~--~~~---~--~~ 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 email to [EMAIL PROTECTED] For more options, visit this group at http://groups.google.com/group/clojure?hl=en -~--~~~~--~~--~--~---
problems with slime and emacs
Hello all, I'm struggling to get slime and emacs to work together. I copied the code from the readme included with swank-clojure, but am running into an error. I'm sure it's something trivial that I'm missing. Here is what I have in my .emacs copied from the various readme files. ;; clojure mode (add-to-list 'load-path "~/.emacs.d/clojure-mode") (require 'clojure-auto) ;; or if you use paredit, uncomment the following ;; (require 'clojure-paredit) ;; swank clojure (add-to-list 'load-path "/Users/clk/.emacs.d/swank-clojure") (require 'swank-clojure-autoload) (swank-clojure-config (setq swank-clojure-jar-path "/Users/clk/Documents/Development/ Languages/lisp/clojure_20080916/clojure.jar") (setq swank-clojure-extra-classpaths (list "/Users/clk/.emacs.d/ clojure-extra"))) ;; Add sbcl back in (add-to-list 'slime-lisp-implementations '(sbcl ("sbcl"))) That results in the following error: ad-Orig-error: Error: You must specify a swank-clojure-jar-path. Please see README of swank-clojure. I copied the code above from the readme. And yes, the path to the clojure.jar is correct. I'm using emacs 22 on OSX. --~--~-~--~~~---~--~~ 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 email to [EMAIL PROTECTED] For more options, visit this group at http://groups.google.com/group/clojure?hl=en -~--~~~~--~~--~--~---
Re: Files in Clojure Google Groups
Does the wiki accept file uploads? -S On Oct 31, 7:46 am, Rich Hickey <[EMAIL PROTECTED]> wrote: > On Oct 30, 3:57 pm, bc <[EMAIL PROTECTED]> wrote: > > > Hi all, > > > Is there any way to enter an annotation or comments when a file is > > uploaded to the Clojure Google Groups file area? I've recently had a > > look at a few things there and it would be nice to have some context > > or background on why they were uploaded. For example, "tsp.zip" is a > > Traveling Salesperson example but, unless you download it and look at > > the code, how would you know that? Another example is "Clojure.png" > > which has a nice graphical representation of the Clojure reader. Was > > this part of a documentation effort or was it uploaded as an example > > as part of a discussion (a search on "Clojure.png" in the group didn't > > produce any matches)? It would be nice to have some form of comments/ > > annotations about the files. > > That's a good point. Unfortunately, it doesn't look like Google Groups > supports any annotations on the files. Suggestions for alternatives > welcome. > > Rich --~--~-~--~~~---~--~~ 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 email to [EMAIL PROTECTED] For more options, visit this group at http://groups.google.com/group/clojure?hl=en -~--~~~~--~~--~--~---
Re: Pathetic n00b wonders how to deploy
mb <[EMAIL PROTECTED]> writes: > On 31 Okt., 04:46, JCB <[EMAIL PROTECTED]> wrote: --- %< --- >> 2) Does Clojure have anything similar to fasl files? It looks right >> now like the way to deploy a Clojure program is to deploy the source >> (.clj) files and (load) them, is this correct? > > My guess for deployment would be to create a .jar file, which > is distributed. The users put the .jar in their classpath and are > able to load the library with require/use. For this to work the file > layout has to follow the guidelines for namespace / filename > translation, of course. I have a project that's actually in live usage right now. I am taking the approach to making JARs detailed here: http://rpdillon.googlepages.com/creatingexecutablejarswithclojure In my case my customer is using Mac OS X and I use the rather natty little JAR bundler app in the OS X dev tools to make it into a native Java .app bundle. I would take the time right now to say that Clojure is the single most positive "first experience" of a programming language I have ever had. Building on the base of Java, but supporting concurrency and bringing in all that Lisp goodness means that Clojure is as close to my "dream language" as you can probably get. Thanks Rich, et al! -- Geoffrey Teale Freelance Software and Technology Consultant Munich, Germany --~--~-~--~~~---~--~~ 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 email to [EMAIL PROTECTED] For more options, visit this group at http://groups.google.com/group/clojure?hl=en -~--~~~~--~~--~--~---
Re: Clojure documentation via mind map diagram
On Fri, 31 Oct 2008 00:06:29 -0700 (PDT) bc <[EMAIL PROTECTED]> wrote: > > Hi all, > > On my blog, I've posted an alternative way to navigate the Clojure > documentation: > http://bc.tech.coop/blog/081031.html > > - Bill > > Thanks for the docs. I use freemind to try and organise myself :P and it's very good but the groovy scripting engine is just begging to be replaced with Clojure :) bd --~--~-~--~~~---~--~~ 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 email to [EMAIL PROTECTED] For more options, visit this group at http://groups.google.com/group/clojure?hl=en -~--~~~~--~~--~--~---
Re: Pathetic n00b wonders how to deploy
Hi, On 31 Okt., 04:46, JCB <[EMAIL PROTECTED]> wrote: > 1) does Clojure maintain the CL notion of a "running image" (ACL > terms), or a "core" (sbcl terms)? > > For example, in ACL I can do (dumplisp), and I think sbcl has > something called (save-lisp-and-die) .. I don't think so, no. > 2) Does Clojure have anything similar to fasl files? It looks right > now like the way to deploy a Clojure program is to deploy the source > (.clj) files and (load) them, is this correct? My guess for deployment would be to create a .jar file, which is distributed. The users put the .jar in their classpath and are able to load the library with require/use. For this to work the file layout has to follow the guidelines for namespace / filename translation, of course. I would use load only inside a ns to suck in different files for a namespace in case the implementation is split up. I would never use it to "load" a library. That's what require/use are for. To deploy a program one can create a Java class via gen-class, which contains a main function which "require"s the implementation of the program and starts the application running. In the MANIFEST.MF one can specify this class as Main-Class. So the user can do java -jar MyApp.jar to run the program. Just my 0.02€. Sincerely Meikel --~--~-~--~~~---~--~~ 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 email to [EMAIL PROTECTED] For more options, visit this group at http://groups.google.com/group/clojure?hl=en -~--~~~~--~~--~--~---
Re: Files in Clojure Google Groups
On Oct 30, 3:57 pm, bc <[EMAIL PROTECTED]> wrote: > Hi all, > > Is there any way to enter an annotation or comments when a file is > uploaded to the Clojure Google Groups file area? I've recently had a > look at a few things there and it would be nice to have some context > or background on why they were uploaded. For example, "tsp.zip" is a > Traveling Salesperson example but, unless you download it and look at > the code, how would you know that? Another example is "Clojure.png" > which has a nice graphical representation of the Clojure reader. Was > this part of a documentation effort or was it uploaded as an example > as part of a discussion (a search on "Clojure.png" in the group didn't > produce any matches)? It would be nice to have some form of comments/ > annotations about the files. > That's a good point. Unfortunately, it doesn't look like Google Groups supports any annotations on the files. Suggestions for alternatives welcome. Rich --~--~-~--~~~---~--~~ 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 email to [EMAIL PROTECTED] For more options, visit this group at http://groups.google.com/group/clojure?hl=en -~--~~~~--~~--~--~---
Pathetic n00b wonders how to deploy
Hi, I am totally new to Clojure, but not new to CL. I have been poking around a little bit and I have a couple questions: 1) does Clojure maintain the CL notion of a "running image" (ACL terms), or a "core" (sbcl terms)? For example, in ACL I can do (dumplisp), and I think sbcl has something called (save-lisp-and-die) .. 2) Does Clojure have anything similar to fasl files? It looks right now like the way to deploy a Clojure program is to deploy the source (.clj) files and (load) them, is this correct? Thanks, John --~--~-~--~~~---~--~~ 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 email to [EMAIL PROTECTED] For more options, visit this group at http://groups.google.com/group/clojure?hl=en -~--~~~~--~~--~--~---
Memory usage when iterating over lazy sequences
Hi all, I'm just getting started with Clojure, and I've got a bit of a beginner's question regarding memory usage of lazy sequences. I have an array of data that is too big to fit in memory, so I thought I would be clever and process it in manageable-sized chunks. My instinct was to do this using loop/recur using 'take' to bite off the next chunk, and 'drop' to give me the remainder for the next recursive call. Here's a contrived example: ;; Process the list one chunk at a time (defn do-something [biglist] (loop [rest (drop 1000 biglist)] (when rest (doall (take 1000 rest)) (recur (drop 1000 rest) ;; Lazily calculate our big data set and pass it along for processing (do (do-something (map (fn [n] (make-array java.lang.Character 10240)) (range 0 10))) nil) When I ran my code it very quickly ran out of memory and fell over. After thinking about it for a while I've realised it must be because my 'do-something' function call is hanging on to the head of the list, so as its elements are realised and cached it gradually eats up all my memory. Assuming my diagnosis is right, is there some sort of idiomatic way of dealing with this sort of issue? I suppose that if the JVM allowed for true tail recursion then this problem wouldn't arise? Many thanks, Mark -- Mark Triggs <[EMAIL PROTECTED]> --~--~-~--~~~---~--~~ 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 email to [EMAIL PROTECTED] For more options, visit this group at http://groups.google.com/group/clojure?hl=en -~--~~~~--~~--~--~---
Re: Modifying the classpath in Slime
Hi Pablo, On Thu, Oct 30, 2008 at 10:07 PM, J. Pablo Fernández <[EMAIL PROTECTED]> wrote: > Can the classpath be modified for Clojure running in Slime after it > has been started? being a clojure newbie I'm not sure if there aren't better ways to do it but using add-classpath worked for me: (add-classpath "file:///path/to/your/jar") Regards, Axel --~--~-~--~~~---~--~~ 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 email to [EMAIL PROTECTED] For more options, visit this group at http://groups.google.com/group/clojure?hl=en -~--~~~~--~~--~--~---
Clojure documentation via mind map diagram
Hi all, On my blog, I've posted an alternative way to navigate the Clojure documentation: http://bc.tech.coop/blog/081031.html - Bill --~--~-~--~~~---~--~~ 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 email to [EMAIL PROTECTED] For more options, visit this group at http://groups.google.com/group/clojure?hl=en -~--~~~~--~~--~--~---