slime (swank-clojure) no longer working

2009-02-18 Thread Dimiter malkia Stanev
Hi guys, I've just updated to the latest (1289) version of clojure, and swank- clojure (slime) doesn't work anymore Here is what I'm getting from emacs: (add-classpath file:Users/malkia/p/swank-clojure/) (require 'swank.swank) (swank.swank/ignore-protocol-version 2009-02-14)

Re: Performance of (fn [] ...)?

2009-02-18 Thread Laurent PETIT
Hello, 2009/2/18 CuppoJava patrickli_2...@hotmail.com Hi, I've noticed that I'm creating a lot of maps of functions, and I'm wondering if there's a performance penalty for this. ie. (defn create_fn [] (fn [] (println hi))) If you use AOT compilation, you'll see that this code will add

Clojure.contrib: name changes in monads

2009-02-18 Thread Konrad Hinsen
The latest Clojure version broke many of my code by introducing the function sequence whose name collided with my sequence monad. So I decided that since now is the time for breaking changes, I should solve that kind of problem thoroughly. I just renamed all monads in

Re: Parenscript in clojure?

2009-02-18 Thread Konrad Hinsen
On Feb 18, 2009, at 9:39, Jan Rychter wrote: Is anyone working on a Parenscript (http://common-lisp.net/project/parenscript/) for Clojure? There's Chouser's ClojureScript in clojure.contrib. I don't know if it is similar to Parenscript, but it has similar goals: compile Clojure (or at

Re: Idiomatic Way to Write the Following:

2009-02-18 Thread James Reeves
On Feb 18, 5:38 am, CuppoJava patrickli_2...@hotmail.com wrote: (defn remove_at [coll indexes]   (map second        (remove #(some #{(first %)} indexes) (map vector (iterate inc 0) coll I'd have thought you could use dissoc, but it seems that only assoc works with vectors. I wonder if

Re: Performance of (fn [] ...)?

2009-02-18 Thread Laurent PETIT
Hello, There's something I don't understand : I've used this code : (ns clojure.examples.createfn) (defn create-fn [] (fn [] (println hi))) (defn test-create-fn [n] (time (dotimes [x n] (create-fn and made these tests : user= (require 'clojure.examples.createfn :reload) nil

Re: Performance of (fn [] ...)?

2009-02-18 Thread Christophe Grand
Laurent PETIT a écrit : When I call test-create-fn with 40, the elapsed time falls down to zero : I suspect it does nothing, and in the same time it does not seem to correctly crash by throwing an exception ? I've tested the correct handling of that high numeric values by

Re: Performance of (fn [] ...)?

2009-02-18 Thread Laurent PETIT
OK, should have read the doc more carefully, thanks, -- laurent 2009/2/18 Christophe Grand christo...@cgrand.net Laurent PETIT a écrit : When I call test-create-fn with 40, the elapsed time falls down to zero : I suspect it does nothing, and in the same time it does not seem

Re: Idiomatic Way to Write the Following:

2009-02-18 Thread Jeff Valk
Vectors are designed for contiguous/sequential data. The case below requires removing elements at arbitrary (keyed) locations in a collection. Idiomatically, a map is better suited to the job. With a vector you'll be left reassembling your key. It's worth noting that calling assoc on a vector

Re: Performance of (fn [] ...)?

2009-02-18 Thread Christophe Grand
CuppoJava a écrit : Hi, I've noticed that I'm creating a lot of maps of functions, and I'm wondering if there's a performance penalty for this. ie. (defn create_fn [] (fn [] (println hi))) ((create_fn)) --- Does this create a new function every-time it's called? Or is the function

Re: Fully lazy sequences are here!

2009-02-18 Thread Frantisek Sodomka
There is something that confuses me: user= (cycle []) () user= (= (cycle []) ()) true user= (= (cycle []) nil) true user= (= () nil) false Thanks for answering, Frantisek On Feb 18, 3:54 am, Rich Hickey richhic...@gmail.com wrote: On Feb 17, 4:16 pm, Frantisek Sodomka fsodo...@gmail.com

Re: Clojure on CLR/DLR

2009-02-18 Thread Marko Kocić
If only there were C/C-- port of clojure which will keep all of clojure ideas and instead of java use '.' for easy access to C/C++ libraries/functions. And it should also be able to compile to native code and create native executables. Just dreaming... On 18 феб, 04:54, dmiller

Re: compiling a GUI app and also: interference of Java's built-in architechture

2009-02-18 Thread Martin DeMello
On Feb 16, 9:33 pm, levand luke.vanderh...@gmail.com wrote: I agree, Jambi is a better all-round product... but why the Swing hate? It's fine for what it is. Most of it's drawbacks (horrible LF, poor performance) are things of the past, now. If nothing else, the fonts aren't antialiased (at

clojure.xml whitespace

2009-02-18 Thread Christophe Grand
clojure.xml currently removes significant whitespaces. I guess that people processing xml as data want this behavior (while people processing xml as mark-up don't). What's the best way to accomodate these to use cases? Through a *remove-all-whitespaces* var? Christophe -- Professional:

Re: Fully lazy sequences are here!

2009-02-18 Thread Frantisek Sodomka
I believe it's already done. Frantisek On Feb 18, 12:39 pm, Mark Volkmann r.mark.volkm...@gmail.com wrote: Now that next is recommended over rest, should nthrest be renamed to nthnext? -- R. Mark Volkmann Object Computing, Inc. --~--~-~--~~~---~--~~ You

Re: clojure.xml whitespace

2009-02-18 Thread Christophe Grand
Remco van 't Veer a écrit : Maybe *ignore-whitespace* is a beter name since it doesn't remove anything and will retain some of it. I would prefer it to default to true. I would prefer it to default to false since it's the standard way to handle whitespace in XML. (Ignorable whitespaces

Re: clojure.xml whitespace

2009-02-18 Thread Mark Volkmann
On Wed, Feb 18, 2009 at 7:40 AM, Christophe Grand christo...@cgrand.net wrote: Remco van 't Veer a écrit : Maybe *ignore-whitespace* is a beter name since it doesn't remove anything and will retain some of it. I would prefer it to default to true. I would prefer it to default to false

how to learn clojure ?

2009-02-18 Thread MarisO
All documentation I've seen about clojure assumes knowledge of lisp which I dont have. --~--~-~--~~~---~--~~ 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

bug affecting clojure.core/bean?

2009-02-18 Thread Rob
Hi, I'm wondering if I found a bug. I have the latest source from svn (r1291). user= (bean 1) java.lang.IllegalArgumentException: Wrong number of args passed to: core$bean--5161$fn--5179$thisfn It used to show the bean properties of the java.lang.Integer. Rob

Re: clojure.xml whitespace

2009-02-18 Thread Christophe Grand
Mark Volkmann a écrit : On Wed, Feb 18, 2009 at 7:40 AM, Christophe Grand christo...@cgrand.net wrote: Remco van 't Veer a écrit : Maybe *ignore-whitespace* is a beter name since it doesn't remove anything and will retain some of it. I would prefer it to default to true.

Re: how to learn clojure ?

2009-02-18 Thread Shawn Hoover
On Wed, Feb 18, 2009 at 9:04 AM, Joshua Fox joshuat...@gmail.com wrote: Try this book http://www.pragprog.com/titles/shcloj/programming-clojure Agreed, that book is a good introduction to Lisp and Clojure for programmers from other backgrounds, as are the Clojure for Java Programmers

Re: Fully lazy sequences are coming - feedback wanted!

2009-02-18 Thread Rich Hickey
On Feb 17, 10:52 pm, Mark Engelberg mark.engelb...@gmail.com wrote: Since there is no canonical empty sequence, this makes me wonder whether one particular empty sequence might have some kind of performance benefit over another. For example, if I were going to give a name to one empty

Re: Clojure on CLR/DLR

2009-02-18 Thread dmiller
When the rough edges are filed off, it should distributable as a set of DLLs (and a console EXE) like any other .NET application. It should be able to follow the DLR to Mono. On Feb 18, 3:23 am, Johan Berntsson johan.may...@gmail.com wrote: On Feb 17, 9:17 am, dmiller dmiller2...@gmail.com

Re: clojure and embedded derby

2009-02-18 Thread BrianS
Stuart, Yes, it is running in a REPL right now, but I have gone to the extent of unloading NetBeans (and I assume clojure) fully (no java processes running), and still the lock file remains. But it does not prevent me from reloading my clojure project in NetBeans and re- connecting. However,

Re: clojure.xml whitespace

2009-02-18 Thread Mark Volkmann
On Wed, Feb 18, 2009 at 8:04 AM, Christophe Grand christo...@cgrand.net wrote: Mark Volkmann a écrit : On Wed, Feb 18, 2009 at 7:40 AM, Christophe Grand christo...@cgrand.net wrote: Remco van 't Veer a écrit : Maybe *ignore-whitespace* is a beter name since it doesn't remove anything and

Re: Libraries? model and generic-functions

2009-02-18 Thread wlr
On Feb 17, 10:20 am, Raffael Cavallaro raffaelcavall...@gmail.com wrote: I am very interested in both of these subsystems and would love to see you package them as clojure.contrib libraries. Hopefully others feel the same and we'll see an announcement for them here soon. +1

Re: clojure.xml whitespace

2009-02-18 Thread Remco van 't Veer
On Wed, Feb 18, 2009 at 2:20 PM, mikel mev...@mac.com wrote: On Wed, Feb 18, 2009 at 12:59 PM, Christophe Grand clojure.xml currently removes significant whitespaces. I guess that people processing xml as data want this behavior (while people processing xml as mark-up don't). What's the

Re: bug affecting clojure.core/bean?

2009-02-18 Thread Chouser
On Wed, Feb 18, 2009 at 12:35 AM, Rob rob.nikan...@gmail.com wrote: I'm wondering if I found a bug. I have the latest source from svn (r1291). user= (bean 1) java.lang.IllegalArgumentException: Wrong number of args passed to: core$bean--5161$fn--5179$thisfn You sure did. The conversion

Re: how to learn clojure ?

2009-02-18 Thread David Nolen
Practical Common Lisp is also online and free. Though there are significant differences between the two languages many of the strange and beautiful concepts that Clojure embraces are covered there. Especially dynamic variables, macros, destructuring bind, and multiple dispatch. On Wed, Feb 18,

Re: bug affecting clojure.core/bean?

2009-02-18 Thread Rich Hickey
On Feb 18, 11:04 am, Chouser chou...@gmail.com wrote: On Wed, Feb 18, 2009 at 12:35 AM, Rob rob.nikan...@gmail.com wrote: I'm wondering if I found a bug. I have the latest source from svn (r1291). user= (bean 1) java.lang.IllegalArgumentException: Wrong number of args passed to:

Re: Fully lazy sequences are here!

2009-02-18 Thread Frantisek Sodomka
What about 'conj'? Documentation says: (conj nil item) returns (item). Currently: user= (conj nil 1) (1) user= (conj () 1) (1) Idiom conj nil is used in 'reverse': (reduce conj nil coll) Currently: user= (reverse [1 2]) (2 1) user= (reverse [1]) (1) user= (reverse []) nil It looks that now all

Re: Fully lazy sequences are here!

2009-02-18 Thread Frantisek Sodomka
Or maybe more general question: Is there any function in Clojure which when returning empty sequence, returns nil instead of () ??? user= (butlast [1 2 3]) (1 2) user= (butlast [1]) nil user= (butlast []) nil Thanks, Frantisek On Feb 18, 5:46 pm, Frantisek Sodomka fsodo...@gmail.com wrote:

Re: Fully lazy sequences are here!

2009-02-18 Thread Chouser
On Wed, Feb 18, 2009 at 11:46 AM, Frantisek Sodomka fsodo...@gmail.com wrote: What about 'conj'? Documentation says: (conj nil item) returns (item). Currently: user= (conj nil 1) (1) user= (conj () 1) (1) Is there something wrong with that? It looks right and like it matches the docs

Re: Performance of (fn [] ...)?

2009-02-18 Thread CuppoJava
Thanks for the replies. I have no qualms about creating functions now. =) On Feb 18, 3:15 am, Michael Wood esiot...@gmail.com wrote: On Wed, Feb 18, 2009 at 8:50 AM, David Nolen dnolen.li...@gmail.com wrote: new MBP 2.53ghz (defn create-fn []   (fn [] (println hi))) (time (dotimes [x

Re: bug affecting clojure.core/bean?

2009-02-18 Thread Frantisek Sodomka
Or maybe: next ??? :- Frantisek On Feb 18, 5:27 pm, Rich Hickey richhic...@gmail.com wrote: On Feb 18, 11:04 am, Chouser chou...@gmail.com wrote: On Wed, Feb 18, 2009 at 12:35 AM, Rob rob.nikan...@gmail.com wrote: I'm wondering if I found a bug.  I have the latest source from svn

clojure.core.read-line broken

2009-02-18 Thread Perry Trolard
On the most recent svn (r1293), read-line throws a ClassCastException when called: user= (read-line) java.lang.ClassCastException: clojure.lang.LineNumberingPushbackReader cannot be cast to java.io.BufferedReader (NO_SOURCE_FILE:0) Removing the type hint solves the issue: user= (source

Re: bug affecting clojure.core/bean?

2009-02-18 Thread Laurent PETIT
2009/2/18 Mark Volkmann r.mark.volkm...@gmail.com On Wed, Feb 18, 2009 at 10:27 AM, Rich Hickey richhic...@gmail.com wrote: On Feb 18, 11:04 am, Chouser chou...@gmail.com wrote: On Wed, Feb 18, 2009 at 12:35 AM, Rob rob.nikan...@gmail.com wrote: I'm wondering if I found a bug. I

Re: Fully lazy sequences are here!

2009-02-18 Thread Frantisek Sodomka
How should I say it... It just didn't look symmetrical to me. So, basically, there is a difference between functions returning sequences - depending on if they are lazy or eager. Hmm... user= (reverse []) nil user= (if (reverse []) true false) false user= (if (seq (reverse [])) true false)

Re: bug affecting clojure.core/bean?

2009-02-18 Thread David Nolen
If I've been following things correct: rest _used_ to force the seq, it does no longer. next forces the seq In my own mind i'm thinking next to mean (return the seq with the next value computed), rest now means just give me the uncomputed remaining values of the seq. On Wed, Feb 18, 2009 at

Re: Idiomatic Way to Write the Following:

2009-02-18 Thread Telman Yusupov
I tried to get the results using some clever one liner but couldn't come up with it. It looks like rolling your own function is the way to go (but I would love to see this proven wrong). It would be very helpful if there were a function that does vector difference, like the one for sets. For

Re: Questions about a Clojure Datalog

2009-02-18 Thread Telman Yusupov
Could this be of any help for your development? There is now a version of Datalog for PLT Scheme: Software: http://planet.plt-scheme.org/display.ss?package=datalog.pltowner=jaymccarthy Documentation:

Re: Questions about a Clojure Datalog

2009-02-18 Thread Jeffrey Straszheim
It is worth looking at. On Wed, Feb 18, 2009 at 12:42 PM, Telman Yusupov use...@yusupov.com wrote: Could this be of any help for your development? There is now a version of Datalog for PLT Scheme: Software: http://planet.plt-scheme.org/display.ss?package=datalog.pltowner=jaymccarthy

Re: Clojure on CLR/DLR

2009-02-18 Thread Marko Kocić
On 18 феб, 15:13, dmiller dmiller2...@gmail.com wrote: When the rough edges are filed off, it should distributable as a set of DLLs (and a console EXE)  like any other .NET application.   It should be able to follow the DLR to Mono. You mean DLR can create executables that don't need .NET

Re: Idiomatic Way to Write the Following:

2009-02-18 Thread Chouser
On Wed, Feb 18, 2009 at 12:30 PM, Telman Yusupov use...@yusupov.com wrote: I'm not sure which version is more idiomatic, but the last one seems to give me the best performance out of all versions. No prettier, but a bit faster: (defn remove-at42 [coll indexes] (let [iset (set indexes)]

Re: Performance of (fn [] ...)?

2009-02-18 Thread Michel Salim
On Feb 18, 3:17 am, Laurent PETIT laurent.pe...@gmail.com wrote: Hello, 2009/2/18 CuppoJava patrickli_2...@hotmail.com Hi, I've noticed that I'm creating a lot of maps of functions, and I'm wondering if there's a performance penalty for this. ie. (defn create_fn []  (fn []

Re: clojure.core.read-line broken

2009-02-18 Thread Stephen C. Gilardi
On Feb 18, 2009, at 12:05 PM, Perry Trolard wrote: On the most recent svn (r1293), read-line throws a ClassCastException when called: user= (read-line) java.lang.ClassCastException: clojure.lang.LineNumberingPushbackReader cannot be cast to java.io.BufferedReader (NO_SOURCE_FILE:0) Removing

Re: how to learn clojure ?

2009-02-18 Thread revoltingdevelopment
You got the recursion part down pat:-) If you want a Common Lisp book, Practical Common Lisp is very good, very practical, and you can read it online for free: http://www.gigamonkeys.com/book/ On Feb 18, 7:53 am, MarisO maris.orbid...@gmail.com wrote: All documentation I've seen about clojure

Clojure documentation for offline use?

2009-02-18 Thread Oliver
Hi, I'm wondering if there's any way of getting hold of the Clojure documentation for usage offline? There's no download link online and it doesn't appear in SVN. I attempted to scrape the site but it ended in failure, and there probably should be a better way than having to rely on scraping.

Re: Idiomatic Way to Write the Following:

2009-02-18 Thread Jeff Valk
Here's another. (defn remove-at [v idxs] (vec (for [i (range (count v)) :when (not ((set idxs) i))] (v i - Jeff On Wednesday 18 February 2009 12:07, Chouser wrote: On Wed, Feb 18, 2009 at 12:30 PM, Telman Yusupov use...@yusupov.com wrote: No prettier, but a bit faster: (defn

Re: Clojure documentation for offline use?

2009-02-18 Thread Dudley Flanders
On Feb 18, 10:18 am, Oliver halo...@gmail.com wrote: Hi, I'm wondering if there's any way of getting hold of the Clojure documentation for usage offline? There's no download link online and it doesn't appear in SVN. I attempted to scrape the site but it ended in failure, and there

Re: Clojure documentation for offline use?

2009-02-18 Thread Craig Andera
If you're just looking for the API documentation, then you could use this file [1]. If you're looking for the rest of the stuff on the site, then I'm not sure. [1] http://clojure.googlegroups.com/web/clj-libs%20(3).html On Wed, Feb 18, 2009 at 11:18 AM, Oliver halo...@gmail.com wrote: Hi,

Re: Questions about a Clojure Datalog

2009-02-18 Thread Jeffrey Straszheim
I see nothing in his code or documentation for handling negation or stratification. Also, it appears to be a top down evaluator, and I don't see any fixed-point or other recursion handling. I *suspect* this does not guarantee termination over arbitrary safe rules. It is not real Datalog. On

Re: Fully lazy sequences are here!

2009-02-18 Thread Stefan Rusek
On Wed, Feb 18, 2009 at 8:02 PM, Rich Hickey richhic...@gmail.com wrote: On Feb 18, 12:20 pm, Frantisek Sodomka fsodo...@gmail.com wrote: How should I say it... It just didn't look symmetrical to me. So, basically, there is a difference between functions returning sequences - depending on

Re: Idiomatic Way to Write the Following:

2009-02-18 Thread Telman Yusupov
Ahh, this is the best one looking yet! :-) On Feb 18, 1:45 pm, Jeff Valk jv-li...@tx.rr.com wrote: Here's another. (defn remove-at [v idxs]   (vec (for [i (range (count v)) :when (not ((set idxs) i))] (v i - Jeff And this one is definitely the fastest one: On Wednesday 18 February

Re: Performance of (fn [] ...)?

2009-02-18 Thread Jeffrey Straszheim
Creating a small object like that is cheap on the JVM. There are much better places to put optimization effort. On Wed, Feb 18, 2009 at 1:07 PM, Michel Salim michel.syl...@gmail.comwrote: On Feb 18, 3:17 am, Laurent PETIT laurent.pe...@gmail.com wrote: Hello, 2009/2/18 CuppoJava

Re: Libraries? model and generic-functions

2009-02-18 Thread Rich Hickey
On Feb 18, 10:17 am, wlr geeked...@gmail.com wrote: On Feb 17, 10:20 am, Raffael Cavallaro raffaelcavall...@gmail.com wrote: I am very interested in both of these subsystems and would love to see you package them as clojure.contrib libraries. Hopefully others feel the same and we'll

Re: how to learn clojure ?

2009-02-18 Thread rob
Paul Graham's book On Lisp is one of my all-time favorites. That one uses Common Lisp. Another good thing to check out are the free MIT videos of Abelson and Sussman's Structure and Interpretation of Computer Programs, and the book these lectures follow. That uses the Scheme dialect of Lisp.

Re: Fully lazy sequences are here!

2009-02-18 Thread Rich Hickey
On Feb 18, 2:09 pm, Stefan Rusek sru...@gmail.com wrote: On Wed, Feb 18, 2009 at 8:02 PM, Rich Hickey richhic...@gmail.com wrote: On Feb 18, 12:20 pm, Frantisek Sodomka fsodo...@gmail.com wrote: How should I say it... It just didn't look symmetrical to me. So, basically, there is a

Re: Clojure documentation for offline use?

2009-02-18 Thread Krešimir Šojat
If you want offline version of clojure.org: hg clone https://bitbucket.org/ksojat/truba/ cd truba ant clojure-org-download (requires wget) When finished, it will place it in dist/clojure.org directory. Or you can just copy wget command from clojure-org-download target. -- Krešimir Šojat

Re: clojure.core.read-line broken

2009-02-18 Thread Perry Trolard
On Feb 18, 12:27 pm, Stephen C. Gilardi squee...@mac.com wrote: This is from issue 47, svn 1229. It's unfortunate that a class can't   be both a BufferedReader and a PushbackReader simultaneously. Those   classes were implemented using class inheritance rather than via   interfaces. In this

Static member and classes

2009-02-18 Thread BerlinBrown
I was trying to access a public inner class and a field within that field. For example: fc.map(FileChannel.MapMode.READ_ONLY, 0, sz); public abstract class FileChannel public static class MapMode { public static final MapMode READ_ONLY = new MapMode(READ_ONLY); .

Re: how to learn clojure ?

2009-02-18 Thread Christopher
These are the resources that I've found to be most useful when initially learning lisp: - SICP lectures (http://groups.csail.mit.edu/mac/classes/6.001/abelson- sussman-lectures/) - Peter Seibel's book Practical Common Lisp (http://gigamonkeys.com/ book/) - Paul Graham's book ASNI Common Lisp

Re: Static member and classes

2009-02-18 Thread Stephen C. Gilardi
On Feb 18, 2009, at 2:48 PM, BerlinBrown wrote: I was trying to access a public inner class and a field within that field. For example: fc.map(FileChannel.MapMode.READ_ONLY, 0, sz); public abstract class FileChannel public static class MapMode { public static final MapMode

Re: Datalog update

2009-02-18 Thread Rich Hickey
On Feb 9, 8:46 am, Jeffrey Straszheim straszheimjeff...@gmail.com wrote: No, but I'm really learning as I go here. I'll look into it. On Mon, Feb 9, 2009 at 7:58 AM, Rich Hickey richhic...@gmail.com wrote: Looks like you're moving apace! Have you considered query/subquery optimization

Contributing

2009-02-18 Thread Joshua
I am currently in a masters level Compiler class. We have a final project for the class and I was wondering if there would be any defects/enhancements that I could do in Clojure. I have about 5 years of professional Java experience with dabbling with some other languages. (not an expert, but

(newbie) idiomatic way to update a vector/list

2009-02-18 Thread linh
hello, what is the idiomatic way to do the following in clojure? # ruby pseudo arr = [3 9 4 5] arr[1] = 7 --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups Clojure group. To post to this group, send email to

Re: (newbie) idiomatic way to update a vector/list

2009-02-18 Thread James Reeves
On Feb 18, 8:25 pm, linh nguyenlinh.m...@gmail.com wrote: hello, what is the idiomatic way to do the following in clojure? # ruby pseudo arr = [3 9 4 5] arr[1] = 7 = (def arr [3 9 4 5]) #'user/arr = (assoc arr 1 7) [3 7 4 5] Note that because Clojure data structures are immutable, assoc

Re: Datalog update

2009-02-18 Thread Jeffrey Straszheim
Yes. I've been thinking about a database layer that would support indexing, constraints, and so on. One step at a time. (logic-rule (:fred :x ?x :y ?y) - (:sally :x ?x :z ?z) (becky :y ?y) (not! :janet :qqq ?z) (if ?x ?y)) Translated into positional notation

Re: Contributing

2009-02-18 Thread Jeffrey Straszheim
Did you cover logic programming? Any bottom up logic query techniques? (My motives are probably transparent.) On Wed, Feb 18, 2009 at 2:34 PM, Joshua jhaw...@gmail.com wrote: I am currently in a masters level Compiler class. We have a final project for the class and I was wondering if there

Re: Contributing

2009-02-18 Thread Chouser
On Wed, Feb 18, 2009 at 2:34 PM, Joshua jhaw...@gmail.com wrote: I am currently in a masters level Compiler class. We have a final project for the class and I was wondering if there would be any defects/enhancements that I could do in Clojure. I have about 5 years of professional Java

Re: how to learn clojure ?

2009-02-18 Thread Phil Hagelberg
MarisO maris.orbid...@gmail.com writes: All documentation I've seen about clojure assumes knowledge of lisp which I dont have. I'm working on a screencast for PeepCode (http://peepcode.com) that is aimed at teaching Clojure to users of other dynamic languages. It's not ready yet, but it

Re: Datalog update

2009-02-18 Thread Rich Hickey
On Feb 18, 3:51 pm, Jeffrey Straszheim straszheimjeff...@gmail.com wrote: Yes. I've been thinking about a database layer that would support indexing, constraints, and so on. One step at a time. Maybe I wasn't clear, I'm talking about the foundational layer. Instead of: (def data {

Re: Datalog update

2009-02-18 Thread Jeffrey Straszheim
Easy enough to do. The only drawback is I'd probably want to force it into a hash during the query. For large datasets (say 100,000 records) this might get expensive. On Wed, Feb 18, 2009 at 4:13 PM, Rich Hickey richhic...@gmail.com wrote: On Feb 18, 3:51 pm, Jeffrey Straszheim

Re: Parenscript in clojure?

2009-02-18 Thread jim
I've got something that's pretty close. There are some other things in the queue before I can get it cleaned up and ready for public consumption, but I'm working towards that. Jim On Feb 18, 2:39 am, Jan Rychter j...@rychter.com wrote: Is anyone working on a Parenscript

Re: Clojure.contrib: name changes in monads

2009-02-18 Thread jim
Konrad, Here's an updated state-m monad transformer. I dropped my CA in the mail today. I figure if I post a snippet of code to the list, it's public domain, so do with it as you wish. Or wait till Rich gets my CA. (defn state-t [m] (monad [m-result (with-monad m (fn

Re: (newbie) idiomatic way to update a vector/list

2009-02-18 Thread linh
thanks, i thought (assoc map key val) only works for maps, but i should have read the doc more carefully. On Feb 18, 9:34 pm, James Reeves weavejes...@googlemail.com wrote: On Feb 18, 8:25 pm, linh nguyenlinh.m...@gmail.com wrote: hello, what is the idiomatic way to do the following in

Re: Fully lazy sequences are here!

2009-02-18 Thread Frantisek Sodomka
At this point test-clojure doesn't generate any new failures or errors (except the old 'mod' function failures). Coverage is still relatively small, but (cycle []) bug and case of (reverse []) were caught with its help when rewriting tests :-) Thanks for all the fixes! Frantisek On Feb 18,

Re: Datalog update

2009-02-18 Thread Rich Hickey
On Feb 18, 4:32 pm, Jeffrey Straszheim straszheimjeff...@gmail.com wrote: Easy enough to do. The only drawback is I'd probably want to force it into a hash during the query. For large datasets (say 100,000 records) this might get expensive. What I envisioned was that while this was the

Re: Datalog update

2009-02-18 Thread Jeffrey Straszheim
Makes sense. That would work. It certainly looks cleaner. On Wed, Feb 18, 2009 at 4:51 PM, Rich Hickey richhic...@gmail.com wrote: On Feb 18, 4:32 pm, Jeffrey Straszheim straszheimjeff...@gmail.com wrote: Easy enough to do. The only drawback is I'd probably want to force it into a

Re: Clojure.contrib: name changes in monads

2009-02-18 Thread Jeffrey Straszheim
I like that. It makes it clear what is a monad, and what is not. On Wed, Feb 18, 2009 at 3:24 AM, Konrad Hinsen konrad.hin...@laposte.netwrote: The latest Clojure version broke many of my code by introducing the function sequence whose name collided with my sequence monad. So I decided that

Re: My SLIME installation diary

2009-02-18 Thread David
I can't really claim to be handy with elisp, but I got by. (Is there a guide to elisp functions anywhere? The Lisp reference didn't include the Common Lisp emulation library, and I never did find an equivalent to the clojure filter()). Anyway, here's what I added to my .emacs: (defun

Re: Clojure documentation for offline use?

2009-02-18 Thread Tom Faulhaber
This is great Kresimir. I've wanted to do this for a while, but gave up after a very short attempt back in November. Expanding your ant task so that others can use it without deciphering everything if they want to: wget -krmnp -E -X/page,/message --no-check-certificate -P target

Re: Clojure on CLR/DLR

2009-02-18 Thread dmiller
like any other .NET application means needs the .NET runtime., but does not need Visual Studio or inserting Tab A into Slot B to get it all to work. On Feb 18, 11:51 am, Marko Kocić marko.ko...@gmail.com wrote: On 18 феб, 15:13, dmiller dmiller2...@gmail.com wrote: When the rough edges are

Re: how to learn clojure ?

2009-02-18 Thread Timothy Pratley
If you want to dive straight into Clojure I hope this might help: http://en.wikibooks.org/wiki/Clojure_Programming/By_Example --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups Clojure group. To post to this group,

Re: Creating executable Jars?

2009-02-18 Thread kkw
Hi Emeka, Where Lucio says: after that I execute this command in the same folder (c:\user \classes): I had success if I instead followed: after that I execute this command in the same folder (c:\user\apps \classes): Adding the c:\user\apps\classes directory to your classpath is

Yet another how do I make gen-class work? thread

2009-02-18 Thread mikel
So I'm looking at improving the implementation of generic functions, preparatory to making the library more generally available. One thing I ought to do, I think, is make a Java class, GenericFunction, a sibling to MultFn. GenericFunction's role is basically the same as MultiFn's, it just has a

Bug in clojure.contrib.lazy-xml: apostrophe not escaped correctly

2009-02-18 Thread Stephan Mühlstrasser
Hi, I believe the following is a bug in clojure.contrib.lazy-xm: user= (use 'clojure.contrib.lazy-xml) nil user= (emit { :tag :a, :attrs { :b bloody apostrophe's :-) }}) ?xml version='1.0' encoding='UTF-8'? a b='bloody apostrophe's :-)'/ nil The XML is broken, because the embedded apostrophe

Problem with clojure.xml/emit: unnecessary whitespace added

2009-02-18 Thread Stephan Mühlstrasser
clojure.xml/emit adds newlines before and after the content of an element, and as far as I can see there is no way to suppress it: user= (use 'clojure.xml) nil user= (emit {:tag :a, :content [b]}) ?xml version='1.0' encoding='UTF-8'? a b /a nil As whitespace within XML elements is significant,

Re: My SLIME installation diary

2009-02-18 Thread Phil Hagelberg
David dsieg...@yahoo.com writes: I can't really claim to be handy with elisp, but I got by. (Is there a guide to elisp functions anywhere? The Lisp reference didn't include the Common Lisp emulation library, and I never did find an equivalent to the clojure filter()). The Elisp CL emulation

Re: Yet another how do I make gen-class work? thread

2009-02-18 Thread Laurent PETIT
When trying your code, I encounter the same problem ... ... but what is the compiler error telling us ? [clojure.lang.AFn] is not a class ? ... maybe clojure.lang.AFn is ! Let's try (gen-class :name xg.gf.GenericFunction :extends clojure.lang.AFn ) (get rid of the square brackets !) It's

Re: Yet another how do I make gen-class work? thread

2009-02-18 Thread mikel
On Feb 18, 5:57 pm, Laurent PETIT laurent.pe...@gmail.com wrote: When trying your code, I encounter the same problem ... ... but what is the compiler error telling us ? [clojure.lang.AFn] is not a class ? ... maybe clojure.lang.AFn is ! Let's try (gen-class  :name

Re: Yet another how do I make gen-class work? thread

2009-02-18 Thread mikel
On Feb 18, 6:24 pm, mikel mev...@mac.com wrote: On Feb 18, 5:57 pm, Laurent PETIT laurent.pe...@gmail.com wrote: When trying your code, I encounter the same problem ... ... but what is the compiler error telling us ? [clojure.lang.AFn] is not a class ? ... maybe clojure.lang.AFn

Re: how to learn clojure ?

2009-02-18 Thread Jeffrey Straszheim
The Common Lisp and Scheme books suggested are great, of course, particularly _On Lisp_. However, I think learning CL or Scheme is an awfully roundabout way to learn Clojure. I think we should really be pushing the Pragmatic book. It is good and gets the user to Clojure in a straight line. On

Re: test-is integration via SLIME

2009-02-18 Thread Stuart Sierra
That's really nifty, Phil! I'll have to check it out. -Stuart Sierra On Feb 18, 7:07 pm, Phil Hagelberg p...@hagelb.org wrote: I've been cooking up a little tool to help with running tests using test-is. It's a little cumbersome to need to switch back and forth between the test buffer and

Re: Yet another how do I make gen-class work? thread

2009-02-18 Thread Stuart Sierra
On Feb 18, 7:49 pm, mikel mev...@mac.com wrote: (I assume there must be something simple I'm not noticing about how to set up my classpath properly). An attempt to make things clear... There are two directories involved in gen-class compilation: 1. your sources dir 2. your compiled files dir,

Re: Yet another how do I make gen-class work? thread

2009-02-18 Thread mikel
On Feb 18, 9:02 pm, Stuart Sierra the.stuart.sie...@gmail.com wrote: On Feb 18, 7:49 pm, mikel mev...@mac.com wrote: (I assume there must be something simple I'm not noticing about how to set up my classpath properly). An attempt to make things clear... There are two directories

Re: how to learn clojure ?

2009-02-18 Thread Timothy Pratley
Seeing this topic comes up a bit, I've taken the liberty of compiling a wiki list: http://en.wikibooks.org/wiki/Clojure_Programming/Further_Reading Please feel free to add to it. I noticed that the official FAQ http://code.google.com/p/clojure/wiki/FAQ has a few links on Lisp, but I think the

Re: Bug in clojure.contrib.lazy-xml: apostrophe not escaped correctly

2009-02-18 Thread Chouser
On Wed, Feb 18, 2009 at 6:20 PM, Stephan Mühlstrasser stephan.muehlstras...@web.de wrote: user= (use 'clojure.contrib.lazy-xml) nil user= (emit { :tag :a, :attrs { :b bloody apostrophe's :-) }}) ?xml version='1.0' encoding='UTF-8'? a b='bloody apostrophe's :-)'/ nil Fixed, thanks for the

Re: Fully lazy sequences are here!

2009-02-18 Thread mifrai
Thanks Rich! Do you think it's worthwhile to add `not-empty?' in the core? It just feels more natural to go: (when (not-empty? (filter even? [1 2])) ...) over (when (seq (filter ..)) ..) What do you think? - Mike On Feb 17, 11:43 am, Rich Hickey richhic...@gmail.com wrote: I've merged

Curiousity with dorun

2009-02-18 Thread mifrai
In the definition of dorun: (defn dorun When lazy sequences are produced via functions that have side effects, any effects other than those needed to produce the first element in the seq do not occur until the seq is consumed. dorun can be used to force any effects. Walks through the

  1   2   >