Re: Got a Clojure library?

2009-01-30 Thread Jan Rychter
Dan Larkin d...@danlarkin.org writes: Name: clojure-json URL: http://github.com/danlarkin/clojure-json/ Author: Dan Larkin Tags: parsing, web, data-interchange License: BSD Dependencies: clojure-contrib (only for running tests) Description: A JSON encoder/decoder for clojure. Supports

Re: Got a Clojure library?

2009-01-30 Thread Stuart Halloway
Lancet http://github.com/stuarthalloway/lancet Stuart Halloway Developer tool Same License as Clojure Lancet is a build tool like Ant or Rake. Lancet makes it easy to create build targets: any Clojure function can be a build target. Lancet can call Ant tasks, or shell out and call other

Re: Distributed Clojure

2009-01-30 Thread hank williams
On Thu, Jan 29, 2009 at 7:28 PM, Greg Harman ghar...@gmail.com wrote: Hank: I have looked at TC in the past, and took another look today at your suggestion. Terracotta certainly seems to have promise feature-wise, but I have to admit it's a heavier solution than I had been thinking of, and

Re: Alternatives to contains?

2009-01-30 Thread Mark Volkmann
On Thu, Jan 29, 2009 at 5:23 PM, Achim Passen achim.pas...@gmail.com wrote: Hi! Am 29.01.2009 um 23:52 schrieb Mark Volkmann: I'd like for that to be moved to core so I don't have to load it ... which is also verbose for something that is commonly needed. includes? being commonly needed

Re: Cells using agents and watchers

2009-01-30 Thread Timothy Pratley
Hi Stuart, On Jan 30, 1:43 pm, Stuart Sierra the.stuart.sie...@gmail.com wrote: I have put together a another implementation of Cells. Cool! One of the things I really like about Cells is that it can really take the pain out of MVC style GUI building:

Re: Got a Clojure library?

2009-01-30 Thread Rich Hickey
The new library page is here: http://clojure.org/libraries Keep 'em coming! Rich On Jan 29, 10:04 am, Rich Hickey richhic...@gmail.com wrote: People regularly post here about Clojure libraries they are working on, and it is great to see the explosion of new libs for Clojure! I'd like to

Re: Cells using agents and watchers

2009-01-30 Thread Stuart Sierra
Thanks, Tim, glad you like it. I agree one of the most interesting uses for Cells is GUI programming. I'd love to see a library for building Swing GUIs this way, although I would want to keep the GUI functions separate from the cell library itself. From the libraries thread, I can see that

Re: time lies, even with doall

2009-01-30 Thread Michael Wood
On Mon, Jan 26, 2009 at 6:24 AM, e evier...@gmail.com wrote: ok, I'll check that stuff out. Thanks. It occurs to me this is being compared to something in ruby called partition. I like that name. partition-by ... but maybe it was opted to use the simpler name, which I can appreciate.

Re: clojure.contrib.sql and SQL Server = cast exceptions?

2009-01-30 Thread Stephen C. Gilardi
Hi Brian, On Jan 29, 2009, at 11:03 AM, BrianS wrote: Now that I am beginning to really investigate this cool part of the clojure-contrib library with SQL Server, I have hit the point where I would like to call parameterized stored procedures, which is why you said you changed the SQL

Re: Simple Examples of Concurrency?

2009-01-30 Thread wubbie
Hi Telman, Thanks, I got it. -sun On Jan 29, 9:58 pm, Telman Yusupov use...@yusupov.com wrote: Clojure sets the value of this var. If you call this var from REPL it will evaluate to nil: user= *file* nil If you pass a file to Clojure on the command line, Clojure will set it to the

Object system for Clojure?

2009-01-30 Thread Jan Rychter
There is something I don't understand about Clojure. There are multimethods (great), but I can't seem to find objects they can operate on. I come to Clojure from a Common Lisp background, having done a fair bit of CLOS programming. Mind you, I am not necessarily a fan of overly complex object

Should the memfn macro be updated for the new Java call convention?

2009-01-30 Thread Everyman
I have been reading through the API examples on: http://en.wikibooks.org/wiki/Clojure_Programming/Examples/API_Examples. For memfn we have: (map (memfn charAt i) [fred ethel lucy] [1 2 3]) - (\r \h \y) This still works, but I thought that: charAt aught to be .charAt following the new Java

Re: Should the memfn macro be updated for the new Java call convention?

2009-01-30 Thread Christophe Grand
Everyman a écrit : I have been reading through the API examples on: http://en.wikibooks.org/wiki/Clojure_Programming/Examples/API_Examples. For memfn we have: (map (memfn charAt i) [fred ethel lucy] [1 2 3]) - (\r \h \y) This still works, but I thought that: charAt aught to be .charAt

Re: clojure.contrib.sql and SQL Server = cast exceptions?

2009-01-30 Thread BrianS
Steve Thanks, this works as described, I am going to look into what it would take to do a call to a parameterized stored proc. BTW, I did get a parameterized SP working, here is my sample code: (defn sp-test test of stored procedures [min max] (sql/with-connection db

Re: Object system for Clojure?

2009-01-30 Thread David Nolen
At this point you have to roll your own, I have an experimental thing I plan on fleshing out temporarily called CLJOS. I've implemented field inheritance, type inheritance, basic multiple inheritance, basic introspection. Search the mailing list for CLJOS and you'll see more details. It only

Re: Object system for Clojure?

2009-01-30 Thread Graham Fawcett
On Fri, Jan 30, 2009 at 1:09 PM, Jan Rychter j...@rychter.com wrote: From what I read, the reasoning is that Clojure provides extremely general multimethods where you have to define a dispatch function. On the object side, there is metadata and you can do with it whatever you want. But this

Re: Object system for Clojure?

2009-01-30 Thread Colin Walters
On Jan 30, 3:16 pm, Stuart Sierra the.stuart.sie...@gmail.com wrote: I think the goal is to provide object-like capabilities without needing actual objects. Why is that the goal? I mean, the JVM provides a well defined, high performance object oriented system. Clojure can already generate

Re: Object system for Clojure?

2009-01-30 Thread David Nolen
(defn make-window [id] {:tag ::window, :id id}) (defn make-color-window [id color] (assoc (make-window id) :tag ::color-window :color color)) (derive ::color-window ::window) (defmulti describe-window :tag) (defmethod describe-window ::window [w] (println Window with ID

Re: Object system for Clojure?

2009-01-30 Thread David Nolen
On Jan 30, 3:16 pm, Stuart Sierra the.stuart.sie...@gmail.com wrote: I think the goal is to provide object-like capabilities without needing actual objects. Why is that the goal? I mean, the JVM provides a well defined, high performance object oriented system. Clojure can already

Documenting Clojure Code

2009-01-30 Thread Kevin Albrecht
How are people generating HTML or text documentation from their Clojure code? --~--~-~--~~~---~--~~ 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

Re: Documenting Clojure Code

2009-01-30 Thread bOR_
Related. (defn myfunc a nice description here [coll] (apply + coll)) but no (def myvar ; cant do a nice description here, even though hash-maps can stand in for functions. (hash-map :a 1 :b 3)) On Jan 30, 10:42 pm, Kevin Albrecht onlya...@gmail.com wrote: How are people generating

Re: Documenting Clojure Code

2009-01-30 Thread Meikel Brandmeyer
Hi, Am 30.01.2009 um 22:49 schrieb bOR_: (def myvar ; cant do a nice description here, even though hash-maps can stand in for functions. (hash-map :a 1 :b 3)) Currently only (def #^{:doc A Foo} foo ...) is possible. Alternatively clojure.contrib.def/defvar: (defvar foo (hash-map :a :b)

Re: Documenting Clojure Code

2009-01-30 Thread Stephen C. Gilardi
On Jan 30, 2009, at 4:49 PM, bOR_ wrote: (def myvar ; cant do a nice description here, even though hash-maps can stand in for functions. (hash-map :a 1 :b 3)) clojure.contrib.def/defvar offers some help with that: - clojure.contrib.def/defvar

Clojure Plugin for Netbeans Pre-Alpha Release-20090130

2009-01-30 Thread Ffailla
A new Clojure Plugin for Netbeans is available at http://code.google.com/p/enclojure-nb-clojure-plugin/. Some issues addressed are: - Enabled Windows support (only Windows XP has been tested) - Project Support * Enabled Clojure Project Run/Debug functionality * Clojure Project Debugging

Documentation of lazy-cat should contain a warning

2009-01-30 Thread André Thieme
Some minutes ago I found out that there is a mismatch between my interpretation of lazy-cats docstring and the actual behaviour of that macro. Its docstring says: Expands to code which yields a lazy sequence of the concatenation of the supplied colls. Each coll expr is not evaluated until it

Re: Got a Clojure library?

2009-01-30 Thread Mark Fredrickson
Name: Dejcartes URL: http://www.markmfredrickson.com/code Category: reporting, UI License: LGPL Depends: JFreeChart (included with source) A wrapper around JFreeChart (jfree.org), a Java graphing/charting libraries. Allows use of native Clojure collections in charts (e.g. pie charts, scatter

Re: Documenting Clojure Code

2009-01-30 Thread Kevin Albrecht
Using #^{:doc ...} documents the code, but are there any tools out there for creating HTML API documentation from the documented code? Stephen C. Gilardi wrote:         (def           #^{:doc a nice description here}           myvar           (hash-map :a 1 :b 3))

Re: Loading two namespaces that :use each other.

2009-01-30 Thread CuppoJava
Mmm, I could create a third namespace that contained the common functionality. But it is an artificial separation. If a user read through the source code, he would think why is this code separated into two files, when it's dealing with the same thing? Anyway, here's my use-case: I wrote a

Re: Documentation of lazy-cat should contain a warning

2009-01-30 Thread Daniel Renfer
user= (take 0 (lazy-cat [(println 10)] [(println 20)])) 10 nil What you see here is not an issue with lazy-cat, but rather an issue with take. The current implementation of take evaluates one more than the n passed to it. So in this case, 1 element of the seq is evaluated and 10 is printed. I

Re: Documentation of lazy-cat should contain a warning

2009-01-30 Thread Jason Wolfe
I think this behavior is as-intended, although I agree that it is confusing. The reason for this stems from the fact that lazy-cat returns a seq, and the only allowed representation for the empty seq is nil (i.e., Java null). Thus, lazy-cat must always do enough evaluation to know whether to

Re: Documentation of lazy-cat should contain a warning

2009-01-30 Thread Jason Wolfe
On Jan 30, 5:44 pm, Daniel Renfer d...@kronkltd.net wrote: user= (take 0 (lazy-cat [(println 10)] [(println 20)])) 10 nil What you see here is not an issue with lazy-cat, but rather an issue with take. The current implementation of take evaluates one more than the n passed to it. Hmm, I

Re: Documenting Clojure Code

2009-01-30 Thread Mark McGranaghan
Hi Kevin, You should try clj-doc: http://github.com/mmcgrana/clj-doc clj-doc generates HTML API documentation that is searchable via JavaScript and includes source snippets for the code that defined each var. I update clj-doc tonight to include example docs, just clone my clj-doc repo and

Bug or desired behavior: contains? doesn't seem to work on java.util.Sets.

2009-01-30 Thread Jason Wolfe
While contains? treats Clojure maps and java.util.Maps the same, it doesn't seem to work on java.util.Sets: user (let [m (HashMap.)] (.put m test test) (contains? m test)) true user (let [s (HashSet.)] (.add s test) (contains? s test)) false user (let [s (HashSet.)] (.add s test) (contains? (set

Re: Questions about a Clojure Datalog

2009-01-30 Thread Jeffrey Straszheim
Doing something like Datalog would be terrific fun. I might contribute if there is interest. I'm not an academic, so most of my contributions would be on a practical level. We'd need someone else to provide the deeper aspects of theory. I've read Norvig's book, and understand his code, and my

That Zipper thing

2009-01-30 Thread Jeffrey Straszheim
Does anyone know of a gentle introduction to the Zipper stuff, and how it is used in Clojure? Thanks in advance. --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups Clojure group. To post to this group, send email to

Re: Documenting Clojure Code

2009-01-30 Thread Daniel E. Renfer
Mark, Glad to see you are putting some more work into clj-doc again. I tried compiling it a couple weeks ago, and after I downloaded the 4 or 5 libraries it depended on and fixed some of the references to code that had been moved, I got an exception when I tried running it. I gave up after that.

Clojure is not a serious language

2009-01-30 Thread Jon Harrop
Apologies if you've seen this before but I just thought it was absolutely hillarious: http://www.3ofcoins.net/2009/01/30/common-lisp-clojure-and-seriousness/ -- Dr Jon Harrop, Flying Frog Consultancy Ltd. http://www.ffconsultancy.com/?e --~--~-~--~~~---~--~~

Re: Clojure is not a serious language

2009-01-30 Thread David Nolen
Agreed :) On Fri, Jan 30, 2009 at 11:40 PM, Jon Harrop j...@ffconsultancy.com wrote: Apologies if you've seen this before but I just thought it was absolutely hillarious: http://www.3ofcoins.net/2009/01/30/common-lisp-clojure-and-seriousness/ -- Dr Jon Harrop, Flying Frog Consultancy