Re: Declarative Data Models

2011-05-04 Thread David Jagoe
Hey Stuart, On 4 May 2011 00:19, Stuart Sierra the.stuart.sie...@gmail.com wrote: No. Clojure template (which I wrote) is a backwards way of doing macros. It happens to be useful in clojure.test, but nowhere else. Thanks that's good to know. While we're on the subject, I'm curious about

Re: Lacij v.0.1 a graph visualization library

2011-05-04 Thread Pierre Allix
project.clj was missing during the first commit. It's corrected, you should be able to use lein run -m to run examples. 0.1.0-SNAPSHOT is effectively 0.1.0 ill-named but since I notice that the anelemma library was removed from Clojars, I added my own version and updated all dependencies. If you

Proposal: Ensure that c.c.lazy-xml/emit outputs XML

2011-05-04 Thread OGINO Masanori
Hello. In clojure-contrib 1.2, lazy-xml/emit outputs XML in most cases. However, if it gets HTML or similar format data, the output format is switched to HTML. That makes some differences at least on OpenJDK6. 1. In XML mode, output doesn't contain any extra \n if :indent is skipped. In HTML

Re: ANN: Java dependency injection in Clojure

2011-05-04 Thread Alessio Stalla
On 4 Mag, 06:53, Luc Prefontaine lprefonta...@softaddicts.ca wrote: Hi, being tired of wandering through a few thousand lines of XML Spring bean definitions, I finally wrote a library to start moving away from Spring/XML. It's definitively nicer doing dependency injection/auto-wiring using

Re: Closures in macros

2011-05-04 Thread Alessio Stalla
On 4 Mag, 01:34, Chris Perkins chrisperkin...@gmail.com wrote: On May 3, 5:22 pm, André Thieme splendidl...@googlemail.com wrote: Some of the limitations: 1. (defmacro x [] `(let [a# ~(atom 0)])) 2. (defmacro y [] `(let [a# ~(comp inc inc)])) ; from that link 3. (defmacro z [] `(let

Re: Closures in macros

2011-05-04 Thread Simon Katz
For example Common Lisp does support this. That's not true, or at least it's only partly true. Here's a translation of your example into Common Lisp (I added a use of a# in the macro to avoid compiler optimization making the problem go away): (defun f (x) (lambda () x)) (defparameter foo

I am new comer for clojure, I concern that when will clojure surpport Distribution function like erLang

2011-05-04 Thread yanzhao ye
I am new comer for clojure, I concern that when will clojure surpport Distribution function like erLang yeah, the up is my question. and I want to know is there any roadmap for clojure ? -- You received this message because you are subscribed to the Google Groups Clojure group. To post to this

Re: Clojure Atlas now available (an experimental visualization of the Clojure language standard library)

2011-05-04 Thread Chas Emerick
On May 3, 2011, at 10:21 PM, Sean Corfield wrote: FWIW, click-and-hold on the back or forward buttons in your browser will give you the breadcrumbs you're looking for. Hmm... that means taking the mouse out of the atlas and interacting with the chrome of its surroundings... Any

Re: I am new comer for clojure, I concern that when will clojure surpport Distribution function like erLang

2011-05-04 Thread Baishampayan Ghose
On Wed, May 4, 2011 at 11:57 AM, yanzhao ye yyt0...@gmail.com wrote: I am new comer for clojure, I concern that when will clojure surpport Distribution function like erLang yeah, the up is my question. and I want to know is there any roadmap for clojure ? Take a look at Jobim for Erlang

Re: I am new comer for clojure, I concern that when will clojure surpport Distribution function like erLang

2011-05-04 Thread Stuart Sierra
Clojure doesn't currently provide features for distributed computation across multiple machines. It focuses on the problem of concurrency within a single machine. However, there are many libraries for the JVM designed to support distributed computation. Message-queue systems like ActiveMQ

Re: Declarative Data Models

2011-05-04 Thread Stuart Sierra
apply-macro is a bad idea because it evaluates a macro at runtime. Macros are supposed to be evaluated at compile-time, so apply-macro breaks assumptions about how macros are supposed to work. It's basically a back door into `eval`, which is considered bad style in Lisp-like languages.

New contrib releases

2011-05-04 Thread Aaron Bedra
Hello all, I just pushed out two new releases. * [org.clojure/tools.macro 0.1.0] ** Includes all the bits from c.c.macro-utils and name-with-attributes from c.c.def. Thanks to Konrad who did the initial leg work for this * [org.clojure/core.incubator 0.1.0] ** Includes the bits from c.c.core

Re: Closures in macros

2011-05-04 Thread Marshall T. Vandegrift
André Thieme splendidl...@googlemail.com writes: Please try this minimal example in your REPL: (defn f [x] (fn [] x)) ; the closure factory (def foo (f 0)) ; a useful instance (defmacro bar [] `(let [a# ~foo])) and then call (bar) I'm new to Clojure and don't have much experience with Lisps

Re: Logos - core.logic

2011-05-04 Thread Frantisek Sodomka
Hello David, thanks for your work. It is very interesting addition. One thing that came to my mind, is a language Mercury: http://en.wikipedia.org/wiki/Mercury_(programming_language) http://www.mercury.csse.unimelb.edu.au/ Mercury is a new logic/functional programming language, which combines

Re: Logos - core.logic

2011-05-04 Thread David Nolen
On Wed, May 4, 2011 at 10:37 AM, Frantisek Sodomka fsodo...@gmail.comwrote: Hello David, thanks for your work. It is very interesting addition. One thing that came to my mind, is a language Mercury: http://en.wikipedia.org/wiki/Mercury_(programming_language)

Re: Closures in macros

2011-05-04 Thread Armando Blancas
3. (defmacro z [] `(let [a# ~((fn [x#] (fn [] x#)) 0)])) All three calls fail, (x) and (y) and (z). I see no plausible reason why it *should* be that way. As it's been pointed out, the compiler won't re-compile compiled code. Those macros work if you don't unquote the expressions: (defmacro x

[Enlive] Search for a node querying on attrs

2011-05-04 Thread Alfredo
Hi to everyone, due to the lack of documentation I'm struggling with the good Enlive library. I'm trying to get the meta keywords from a web page, to be clearer from this: meta name=keywords content=clojure, is, good / I want to extract only the content part. I've tried with something like this:

Re: Clojure group in DFW area

2011-05-04 Thread ch...@rubedoinc.com
Thanks everyone for attending the first meeting. It was great to talk clojure with some like minded people who are excited by the possibilities ! Our next meeting is scheduled for May 16th 630PM - 900PM @ Rubedo, inc. 14580 Beltwood Pkwy E Suite 103 Farmers Branch, TX 75244 (wifi available)

Re: Logos - core.logic

2011-05-04 Thread David Nolen
On Wed, May 4, 2011 at 11:11 AM, David Nolen dnolen.li...@gmail.com wrote: On Wed, May 4, 2011 at 10:37 AM, Frantisek Sodomka fsodo...@gmail.comwrote: Mercury is an amazing project. In fact the original miniKanren (on which core.logic is based) designers were well aware of it and even based

Re: Closures in macros

2011-05-04 Thread Alessio Stalla
On 4 Mag, 16:29, Marshall T. Vandegrift llas...@gmail.com wrote: André Thieme splendidl...@googlemail.com writes: Please try this minimal example in your REPL: (defn f [x] (fn [] x)) ; the closure factory (def foo (f 0)) ; a useful instance (defmacro bar [] `(let [a# ~foo])) and then

Re: Closures in macros

2011-05-04 Thread Jonathan Smith
On May 3, 5:22 pm, André Thieme splendidl...@googlemail.com wrote: Am 02.05.2011 23:14, schrieb David Nolen: The relevant clojure-dev thread. http://groups.google.com/group/clojure-dev/browse_thread/thread/f4907... It's not clear whether the core team and the various contributors are

Re: Closures in macros

2011-05-04 Thread Jonathan Smith
On May 4, 8:50 am, Simon Katz nomisk...@gmail.com wrote: For example Common Lisp does support this. That's not true, or at least it's only partly true. Here's a translation of your example into Common Lisp (I added a use of a# in the macro to avoid compiler optimization making the problem

Re: I am new comer for clojure, I concern that when will clojure surpport Distribution function like erLang

2011-05-04 Thread Jonathan Smith
You can use the erlang-otp Java library from Clojure. I think there are bindings on github. If not, they are simple to generate. (I actually had clojure hooked up to a yaws webserver (yaws pattern matches requests, clojure generates pages) for a while, using LFE and the OTP libraries. Clojure

Re: Clojure Atlas now available (an experimental visualization of the Clojure language standard library)

2011-05-04 Thread Sean Corfield
On Wed, May 4, 2011 at 6:20 AM, Chas Emerick cemer...@snowtide.com wrote: Any breadcrumb navigation would require mousing around a bit Unless it was entirely driven by keyboard shortcuts :) Perhaps you're hoping for an 'up' that was equivalent to two 'back' actions…? Probably. Like I say,

Re: Closures in macros

2011-05-04 Thread Marshall T. Vandegrift
Alessio Stalla alessiosta...@gmail.com writes: The key point is that in Lisp code does not mean text [1]. Code is made of data structures - lists, symbols, vectors, numbers, ... - and macros are just functions that operate on those data structures. Hmm, interesting. One of the things that's

Re: Clojure Atlas now available (an experimental visualization of the Clojure language standard library)

2011-05-04 Thread Chas Emerick
On May 4, 2011, at 2:52 PM, Sean Corfield wrote: On Wed, May 4, 2011 at 6:20 AM, Chas Emerick cemer...@snowtide.com wrote: Any breadcrumb navigation would require mousing around a bit Unless it was entirely driven by keyboard shortcuts :) Perhaps what might be useful is a quick way to

Re: Closures in macros

2011-05-04 Thread David Nolen
On Wed, May 4, 2011 at 6:31 PM, André Thieme splendidl...@googlemail.comwrote: You need to wrap it into eval-when or separate functions and macros from their use into different files and make sure the right load order is used. Then this will work in CL. Which are probably some of the reasons

Re: Closures in macros

2011-05-04 Thread Simon Katz
On May 4, 11:31 pm, André Thieme splendidl...@googlemail.com wrote: Am 04.05.2011 14:50, schrieb Simon Katz: For example Common Lisp does support this. That's not true, or at least it's only partly true. Here's a translation of your example into Common Lisp (I added a use of a# in the

Re: resultset-seq

2011-05-04 Thread Phlex
On 3/05/2011 23:58, Allen Johnson wrote: IMHO c.j.j/resultset-seq should perform something like the following: ;; i want my columns as strings exactly how they are in the db (resultset-seq rs) (resultset-seq rs identity) ;; i want my columns as lower-case keywords (resultset-seq rs (comp

Re: Closures in macros

2011-05-04 Thread Ken Wesson
On Wed, May 4, 2011 at 7:03 PM, Simon Katz nomisk...@gmail.com wrote: It is not possible to write out a function object (something returned by lambda, Common Lisp's equivalent of fn) to a compiled file.  No mix of eval-when, separating functions and macros, and load order can change that. The

Re: Closures in macros

2011-05-04 Thread Ken Wesson
On Wed, May 4, 2011 at 8:01 PM, Ken Wesson kwess...@gmail.com wrote: Note that instantiating the class with 4 gives us an add-4-to function instead of the original add-3-to function here. To actually convert that particular closure into code that reproduces it, the array of constructor

Re: Closures in macros

2011-05-04 Thread Ken Wesson
On Wed, May 4, 2011 at 8:16 PM, Ken Wesson kwess...@gmail.com wrote: Closures, including ones whose arguments can't be known until runtime, can easily be slapped with implements Serializable if they haven't been already. Indeed, an extends Serializable on IFn, on top of the above compiler

Re: resultset-seq

2011-05-04 Thread Sean Corfield
I don't think it's flexible enough to attach this to the connection. I work with databases where some groups of tables really need different naming strategies than others so I would definitely want these conversions available per operation - which is how c.j.j naming strategies currently work so