Re: Implementing an interface with core/proxy results in UnsupportedOperationException

2012-01-23 Thread Tassilo Horn
Michael Klishin  writes:

Hi Michael,

> I am trying to make it possible to use functions as Quartz jobs for my
> Clojure DSL on top of Quartz [1]. For that, I need to implement a
> simple 1-method interface. Both gen-class and defrecord with
> additional methods work great but seem too heavyweight in many cases
> so I am trying to add function support using core/proxy.
>
> The interface I need to implement looks like this:
>
> https://gist.github.com/63989c1a081737813f99
>
> and my code is basically this:
>
> https://gist.github.com/a83687aed4ea62c915f5
>
> However, when Quartz tries to execute a new job instance,
> UnsupportedOperationException is raised as if execute was not
> implemented.

I don't know Quartz, but checking your gist, it seems that you don't
actually do anything with the proxy object except getting its class and
"registering" it with some JobBuilder.

Although the class generated by proxy can be instantiated using a
zero-args constructor, those new instances don't behave like the object
returned by proxy itself.

Here's an example without additional deps illustrating the issue.

--8<---cut here---start->8---
(defn using-fn [f]
  (let [prx (proxy [java.util.concurrent.Delayed] []
  (getDelay [tu]
(f 0)))
clazz (class prx)]
[prx clazz]))  ;; return the proxy object and its class

;; Calling getDelay on the proxy object works
(.getDelay (first (using-fn inc)) java.util.concurrent.TimeUnit/SECONDS)
;=> 1

;; Creating a new instance of the class generated by proxy also works
(.newInstance (second (using-fn inc)))
;=> #

;; However, that new instance doesn't work as expected
(.getDelay (.newInstance (second (using-fn inc))) 
java.util.concurrent.TimeUnit/SECONDS)
; getDelay
;   [Thrown class java.lang.UnsupportedOperationException]
; Evaluation aborted.
--8<---cut here---end--->8---

Generally, proxy is for creating proxy objects, and the generation of a
class is more or less a side effect.

Do I see it correctly that you need a way (1) to have objects
implementing Job which (2) can be instantiated with a zero-args
constructor and (3) whose execute behavior is customizable by providing
an arbitrary function f on the JobExecutionContext?

If so, I don't see a too good way.  deftype would be usable if the
function f would be specified as a field of the type, but then it has no
zero-args constructor...

You probably could rewrite your using-fn as a macro where a call like
(using-fn foo) expands into something like

  (deftype MyJob_foo []
Job
(execute [ctx]
  (foo ctx))

for any function foo, plus the registration of MyJob_foo with that
JobBuilder thingy.  Of course, a second call (using-fn foo) should skip
the definition of that already existing type.

Bye,
Tassilo

-- 
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
Note that posts from new members are moderated - please be patient with your 
first post.
To unsubscribe from this group, send email to
clojure+unsubscr...@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/clojure?hl=en


Re: Implementing an interface with core/proxy results in UnsupportedOperationException

2012-01-23 Thread Cedric Greevey
On Mon, Jan 23, 2012 at 3:54 AM, Tassilo Horn  wrote:
> Michael Klishin  writes:
>
> Hi Michael,
>
>> I am trying to make it possible to use functions as Quartz jobs for my
>> Clojure DSL on top of Quartz [1]. For that, I need to implement a
>> simple 1-method interface. Both gen-class and defrecord with
>> additional methods work great but seem too heavyweight in many cases
>> so I am trying to add function support using core/proxy.
>>
>> The interface I need to implement looks like this:
>>
>> https://gist.github.com/63989c1a081737813f99
>>
>> and my code is basically this:
>>
>> https://gist.github.com/a83687aed4ea62c915f5
>>
>> However, when Quartz tries to execute a new job instance,
>> UnsupportedOperationException is raised as if execute was not
>> implemented.
>
> I don't know Quartz, but checking your gist, it seems that you don't
> actually do anything with the proxy object except getting its class and
> "registering" it with some JobBuilder.
>
> Although the class generated by proxy can be instantiated using a
> zero-args constructor, those new instances don't behave like the object
> returned by proxy itself.
>
> Here's an example without additional deps illustrating the issue.
>
> --8<---cut here---start->8---
> (defn using-fn [f]
>  (let [prx (proxy [java.util.concurrent.Delayed] []
>              (getDelay [tu]
>                (f 0)))
>        clazz (class prx)]
>    [prx clazz]))  ;; return the proxy object and its class
>
> ;; Calling getDelay on the proxy object works
> (.getDelay (first (using-fn inc)) java.util.concurrent.TimeUnit/SECONDS)
> ;=> 1
>
> ;; Creating a new instance of the class generated by proxy also works
> (.newInstance (second (using-fn inc)))
> ;=> # user.proxy$java.lang.Object$Delayed$333735ab@7746e075>
>
> ;; However, that new instance doesn't work as expected
> (.getDelay (.newInstance (second (using-fn inc))) 
> java.util.concurrent.TimeUnit/SECONDS)
> ; getDelay
> ;   [Thrown class java.lang.UnsupportedOperationException]
> ; Evaluation aborted.
> --8<---cut here---end--->8---
>
> Generally, proxy is for creating proxy objects, and the generation of a
> class is more or less a side effect.
>
> Do I see it correctly that you need a way (1) to have objects
> implementing Job which (2) can be instantiated with a zero-args
> constructor and (3) whose execute behavior is customizable by providing
> an arbitrary function f on the JobExecutionContext?
>
> If so, I don't see a too good way.  deftype would be usable if the
> function f would be specified as a field of the type, but then it has no
> zero-args constructor...

(let [f (atom (fn [_] (throw (IllegalStateException.]
  (defn set-job-fn! [x]
(reset! f x))
  (deftype Job []
Job
(execute [ctx]
  (@f ctx

Elaborate as you see fit with e.g. a with-job-fn macro or whatever
inside the let.

-- 
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
Note that posts from new members are moderated - please be patient with your 
first post.
To unsubscribe from this group, send email to
clojure+unsubscr...@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/clojure?hl=en


Re: Best IDE

2012-01-23 Thread Stefan Kamphausen
Hi,

On Friday, January 20, 2012 9:40:53 AM UTC+1, Norman Gray wrote:
>
> Thus C-M-(, C-M-), C-M-f, -b, -u, -d and -k do most of what one wants, in 
> terms of creating and moving around balanced brackets.


why did nobody mention C-M-Space, yet?  To me it's one of the most 
important keystrokes across all modes in Emacs, that somehow support the 
sexp-concept.  One of the keystrokes that I miss in all the other modern 
editor components.  In particular, the way it handles being called several 
times in a row (more important in non-lisps, though).

Crucially, however, these same keys do mostly the same thing in other modes 
> (though of course they're less useful there), and they don't get in the way.
>
(inc)

That way the functions stored away in your finger-memory don't have to look 
into the global state reflecting the current major mode, which is usually 
stored in the brain (but may be cached in finger memory if you stay in one 
mode long enough). Thus, these functions are purely functional and avoid 
the slow read on global memory. :-)

(The one big exception is org-mode which has just too many bindings that 
interfere with everything else.  But that's rather off-topic.)

Regards,
Stefan

-- 
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
Note that posts from new members are moderated - please be patient with your 
first post.
To unsubscribe from this group, send email to
clojure+unsubscr...@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/clojure?hl=en

Re: Implementing an interface with core/proxy results in UnsupportedOperationException

2012-01-23 Thread Michael Klishin
Tassilo Horn:

> Generally, proxy is for creating proxy objects, and the generation of a
> class is more or less a side effect.
> 
> Do I see it correctly that you need a way (1) to have objects
> implementing Job which (2) can be instantiated with a zero-args
> constructor and (3) whose execute behavior is customizable by providing
> an arbitrary function f on the JobExecutionContext?
> 

Correct.

> If so, I don't see a too good way.  deftype would be usable if the
> function f would be specified as a field of the type, but then it has no
> zero-args constructor...
> 
> You probably could rewrite your using-fn as a macro where a call like
> (using-fn foo) expands into something like
> 
>  (deftype MyJob_foo []
>Job
>(execute [ctx]
>  (foo ctx))
> 
> for any function foo, plus the registration of MyJob_foo with that
> JobBuilder thingy.  Of course, a second call (using-fn foo) should skip
> the definition of that already existing type.

Yes, using a similar macro around defrecord or deftype was my backup plan.
Thank you.

MK


-- 
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
Note that posts from new members are moderated - please be patient with your 
first post.
To unsubscribe from this group, send email to
clojure+unsubscr...@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/clojure?hl=en


Re: Implementing an interface with core/proxy results in UnsupportedOperationException

2012-01-23 Thread Tassilo Horn
Cedric Greevey  writes:

Hi Cedric,

>> Do I see it correctly that you need a way (1) to have objects
>> implementing Job which (2) can be instantiated with a zero-args
>> constructor and (3) whose execute behavior is customizable by
>> providing an arbitrary function f on the JobExecutionContext?
>>
>> If so, I don't see a too good way.  deftype would be usable if the
>> function f would be specified as a field of the type, but then it has
>> no zero-args constructor...
>
> (let [f (atom (fn [_] (throw (IllegalStateException.]
>   (defn set-job-fn! [x]
> (reset! f x))
>   (deftype Job []
> Job
> (execute [ctx]
>   (@f ctx
>
> Elaborate as you see fit with e.g. a with-job-fn macro or whatever
> inside the let.

I suspect that won't work for the OP, because every Job instance's
execution will evaluate the function that is the atom f's value at that
time.  I have the impression that he wants both Jobs that bark and Jobs
that meow at the same time, and what they do should be specified at
definition time.  With your approach, you need to call set-job-fn!
somehow after the JobBuilder instantiated a Job and before it is
executed by the framework, which might be out of the OP's control.

Bye,
Tassilo

-- 
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
Note that posts from new members are moderated - please be patient with your 
first post.
To unsubscribe from this group, send email to
clojure+unsubscr...@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/clojure?hl=en


Re: Best IDE

2012-01-23 Thread Norman Gray

On 2012 Jan 23, at 10:50, Stefan Kamphausen wrote:

> On Friday, January 20, 2012 9:40:53 AM UTC+1, Norman Gray wrote:
>> 
>> Thus C-M-(, C-M-), C-M-f, -b, -u, -d and -k do most of what one wants, in 
>> terms of creating and moving around balanced brackets.
> 
> 
> why did nobody mention C-M-Space, yet? 

Ah yes, and that one.

There may be others -- making this list (mapping mode->(key->function) ) is 
probably something like O(N) with a large constant factor, whereas using it 
(mapping function->key) is much faster, being finger memory.  Ahem.

Norman


-- 
Norman Gray  :  http://nxg.me.uk



-- 
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
Note that posts from new members are moderated - please be patient with your 
first post.
To unsubscribe from this group, send email to
clojure+unsubscr...@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/clojure?hl=en


Re: Implementing an interface with core/proxy results in UnsupportedOperationException

2012-01-23 Thread Chris Perkins
You may want to dig a little deeper into why reify was not working for you. 
As far as I can tell, the classes created by reify do have a public, no-arg 
constructor, as you require:

user> (-> (reify Runnable (run [_])) type .getConstructors seq)
(# #)

- Chris

-- 
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
Note that posts from new members are moderated - please be patient with your 
first post.
To unsubscribe from this group, send email to
clojure+unsubscr...@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/clojure?hl=en

Call for Papers: ELS2102 Zadar, Croatia

2012-01-23 Thread Marco Antoniotti
Apologies for the multiple postings 

= 
European Lisp Symposium 2012, Zadar, Croatia. 

www.european-lisp-symposium.org 

The purpose of the European Lisp Symposium is to provide a forum for the 
discussion and dissemination of all aspects of design, implementation and 
application of any of the Lisp and Lisp-inspired dialects, including Common 
Lisp, Scheme, Emacs Lisp, AutoLisp, ISLISP, Dylan, Clojure, ACL2, 
ECMAScript, Racket, SKILL, and so on. We encourage everyone interested in 
Lisp to participate. 
The main theme of the 2012 European Lisp Conference is “Interoperabilty: 
Systems, Libraries, Workflows”. Lisp based and functional-languages based 
systems have grown a variety of solutions to become more and more 
integrated with the wider world of Information and Communication 
Technologies in current use. There are several dimensions to the scope of 
the solutions proposed, ranging from “embedding” of interpreters in C-based 
systems, to the development of abstractions levels that facilitate the 
expression of complex context dependent tasks, to the construction of 
exchange formats handling libraries, to the construction of theorem-provers 
for the “Semantic Web”. The European Lisp Symposium 2012 solicits the 
submission of papers with this specific theme in mind, alongside the more 
traditional tracks which have appeared in the past editions. 

We invite submissions in the following forms: 

Papers: Technical papers of up to 15 pages that describe original results 
or explain known ideas in new and elegant ways. 

Demonstrations: Abstracts of up to 4 pages for demonstrations of tools, 
libraries, and applications. 
Tutorials: Abstracts of up to 4 pages for in-depth presentations about 
topics of special interest for at least 90 minutes and up to 180 minutes. 

Lightning talks: Abstracts of up to one page for talks to last for no more 
than 5 minutes. 

All submissions should be formatted following the ACM SIGS guidelines and 
include ACM classification categories and terms. For more information on 
the submission guidelines and the ACM keywords, see: 
http://www.acm.org/sigs/publications/proceedings-templates and 
http://www.acm.org/about/class/1998. 

Important dates: 
Jan 31st 2012: submission deadline 
Feb 21st 2012: acceptance results 
April 30th 2012: Conference opens 

Program Committee. 

Chair: 
Marco Antoniotti, Università degli Studi di Milano Bicocca, Milan, ITALY 

Local organizers: 
Damir Ćavar, Eastern Michigan University 
Franjo Pehar, University of Zadar 
Damir Kero, University of Zadar 

Members: 
Giuseppe Attardi, Università degli Studi di Pisa, Pisa, ITALY 
Pascal Costanza, Intel, Bruxelles, BELGIUM 
Marc Feeley, Université de Montreal, Montreal, CANADA 
Scott McKay, Google, U.S.A. 
Kent Pitman, U.S.A. 
Christophe Rhodes, Department of Computing, Goldsmiths, University of 
London, London, UNITED KINGDOM 
Robert Strandh, LABRI, Université de Bordeaux, Bordaux, FRANCE 
Didier Verna, EPITA / LRDE, FRANCE 
Taiichi Yuasa, Kyoto University, JAPAN 

-- 
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
Note that posts from new members are moderated - please be patient with your 
first post.
To unsubscribe from this group, send email to
clojure+unsubscr...@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/clojure?hl=en

Re: Best IDE

2012-01-23 Thread Laurent PETIT
2012/1/23 Stefan Kamphausen 

> Hi,
>
>
> On Friday, January 20, 2012 9:40:53 AM UTC+1, Norman Gray wrote:
>>
>> Thus C-M-(, C-M-), C-M-f, -b, -u, -d and -k do most of what one wants, in
>> terms of creating and moving around balanced brackets.
>
>
> why did nobody mention C-M-Space, yet?  To me it's one of the most
> important keystrokes across all modes in Emacs, that somehow support the
> sexp-concept.  One of the keystrokes that I miss in all the other modern
> editor components.  In particular, the way it handles being called several
> times in a row (more important in non-lisps, though).
>

It isn't particularly helpful to just name things only by their keyboard
shortcuts, unless you only want positive feedback only from your fellow
emacsers ...


>
> Crucially, however, these same keys do mostly the same thing in other
>> modes (though of course they're less useful there), and they don't get in
>> the way.
>>
> (inc)
>
> That way the functions stored away in your finger-memory don't have to
> look into the global state reflecting the current major mode, which is
> usually stored in the brain (but may be cached in finger memory if you stay
> in one mode long enough). Thus, these functions are purely functional and
> avoid the slow read on global memory. :-)
>
> (The one big exception is org-mode which has just too many bindings that
> interfere with everything else.  But that's rather off-topic.)
>
> Regards,
> Stefan
>
>  --
> 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
> Note that posts from new members are moderated - please be patient with
> your first post.
> To unsubscribe from this group, send email to
> clojure+unsubscr...@googlegroups.com
> For more options, visit this group at
> http://groups.google.com/group/clojure?hl=en
>

-- 
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
Note that posts from new members are moderated - please be patient with your 
first post.
To unsubscribe from this group, send email to
clojure+unsubscr...@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/clojure?hl=en

Re: Best IDE

2012-01-23 Thread Norman Gray

On 2012 Jan 23, at 12:27, Laurent PETIT wrote:

>> On Friday, January 20, 2012 9:40:53 AM UTC+1, Norman Gray wrote:
>>> 
>>> Thus C-M-(, C-M-), C-M-f, -b, -u, -d and -k do most of what one wants, in
>>> terms of creating and moving around balanced brackets.
>> 
>> 
>> why did nobody mention C-M-Space, yet?  To me it's one of the most
>> important keystrokes across all modes in Emacs, that somehow support the
>> sexp-concept.  One of the keystrokes that I miss in all the other modern
>> editor components.  In particular, the way it handles being called several
>> times in a row (more important in non-lisps, though).
>> 
> 
> It isn't particularly helpful to just name things only by their keyboard
> shortcuts, unless you only want positive feedback only from your fellow
> emacsers ...

True enough, but I think this particular sub-thread was about the pros and cons 
of a particular editing mode within emacs (paredit), in which context it's 
reasonable to presume that the people taking an interest, are already of the 
faith.

For those using emacs but not familiar with those particular keystrokes, C-h k 
can provide documentation on what a particular keystroke means.

If you're interested, C-M-f, and -b move forward and backward by one balanced 
s-expression, C-M-u moves up a level of parentheses, and -d down, M-( (not 
C-M-( as I had above) inserts a balanced pair of parentheses, and M-) moves out 
of one, inserts a newline and re-indents.  Plus they do analogous things in 
other modes (for example C modes).

All the best,

Norman


-- 
Norman Gray  :  http://nxg.me.uk

-- 
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
Note that posts from new members are moderated - please be patient with your 
first post.
To unsubscribe from this group, send email to
clojure+unsubscr...@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/clojure?hl=en


Re: Implementing an interface with core/proxy results in UnsupportedOperationException

2012-01-23 Thread Cedric Greevey
On Mon, Jan 23, 2012 at 6:17 AM, Tassilo Horn  wrote:
> Cedric Greevey  writes:
>
> Hi Cedric,
>
>>> Do I see it correctly that you need a way (1) to have objects
>>> implementing Job which (2) can be instantiated with a zero-args
>>> constructor and (3) whose execute behavior is customizable by
>>> providing an arbitrary function f on the JobExecutionContext?
>>>
>>> If so, I don't see a too good way.  deftype would be usable if the
>>> function f would be specified as a field of the type, but then it has
>>> no zero-args constructor...
>>
>> (let [f (atom (fn [_] (throw (IllegalStateException.]
>>   (defn set-job-fn! [x]
>>     (reset! f x))
>>   (deftype Job []
>>     Job
>>     (execute [ctx]
>>       (@f ctx
>>
>> Elaborate as you see fit with e.g. a with-job-fn macro or whatever
>> inside the let.
>
> I suspect that won't work for the OP, because every Job instance's
> execution will evaluate the function that is the atom f's value at that
> time.  I have the impression that he wants both Jobs that bark and Jobs
> that meow at the same time, and what they do should be specified at
> definition time.  With your approach, you need to call set-job-fn!
> somehow after the JobBuilder instantiated a Job and before it is
> executed by the framework, which might be out of the OP's control.

Then he has a problem, since it doesn't work with reify and proxy, and
gen-class, deftype, and defrecord are top-level things that don't play
nice with putting them inside a defn.

I'm actually somewhat surprised that Clojure provides no good way
around this problem in that case.

The OP will basically just have to have a separate deftype for each
job class he needs. The parts that are repetitious can at least be
abstracted into a macro, something like (defmacro defjob [name & body]
`(deftype ~name [] Job (execute [ctx] ~@body))).

-- 
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
Note that posts from new members are moderated - please be patient with your 
first post.
To unsubscribe from this group, send email to
clojure+unsubscr...@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/clojure?hl=en


Re: Best IDE

2012-01-23 Thread Stefan Kamphausen
Hi,

On Monday, January 23, 2012 1:27:51 PM UTC+1, lpetit wrote:
>
> 2012/1/23 Stefan Kamphausen 
>
>> Hi,
>>
>>
>> On Friday, January 20, 2012 9:40:53 AM UTC+1, Norman Gray wrote:
>>>
>>> Thus C-M-(, C-M-), C-M-f, -b, -u, -d and -k do most of what one wants, 
>>> in terms of creating and moving around balanced brackets.
>>
>>
>> why did nobody mention C-M-Space, yet?  To me it's one of the most 
>> important keystrokes across all modes in Emacs, that somehow support the 
>> sexp-concept.  One of the keystrokes that I miss in all the other modern 
>> editor components.  In particular, the way it handles being called several 
>> times in a row (more important in non-lisps, though).
>>
>
> It isn't particularly helpful to just name things only by their keyboard 
> shortcuts, unless you only want positive feedback only from your fellow 
> emacsers ... 
>

You are right, I apologize.

C-M-Space calls mark-sexp which marks the current expression and works in 
many other major modes, e.g. in when working with Perl, Ruby, C, ..., 
reasonably well.

Regards,
Stefan 

-- 
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
Note that posts from new members are moderated - please be patient with your 
first post.
To unsubscribe from this group, send email to
clojure+unsubscr...@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/clojure?hl=en

Literate programming in emacs - any experience?

2012-01-23 Thread Colin Yates
Hi all,

There are some excellent resources on this mailing list regarding literate 
resources, but they are more based around the theory rather than actual use.

Has anybody got any "real world usage reports" regarding using literate 
programming in emacs?  In particular, does paredit and slime work inside 
the clojure "fragments" when using org.babel for example?

Finally - how are people finding practising TDD with literate programming? 
 I imagine that Clojure's excellent REPL (+ evaluating clojure forms from 
within a buffer) mean there are far less "type, extract tangled code, run 
tests" needed.  Hmmm, not sure that is clear.  What I mean is, do people 
find that the ability to evaluate a clojure form from within org.babel 
(assuming that is possible!) is sufficient for TDD or do you find you need 
to type, extract the tangled code and then run lein (for example) to run 
the tests?

Basically - how do y'all get on with TDDing in emacs following the approach 
of literate programming - any advice welcome!

Thanks all.

Col

-- 
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
Note that posts from new members are moderated - please be patient with your 
first post.
To unsubscribe from this group, send email to
clojure+unsubscr...@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/clojure?hl=en

Re: Best IDE

2012-01-23 Thread Meikel Brandmeyer (kotarak)
Hi,

Am Montag, 23. Januar 2012 14:13:33 UTC+1 schrieb Stefan Kamphausen:
>
> why did nobody mention C-M-Space, yet?  To me it's one of the most 
>>> important keystrokes across all modes in Emacs, that somehow support the 
>>> sexp-concept.  One of the keystrokes that I miss in all the other modern 
>>> editor components.  In particular, the way it handles being called several 
>>> times in a row (more important in non-lisps, though).
>>>
>>
>>
>> C-M-Space calls mark-sexp which marks the current expression and works in 
>> many other major modes, e.g. in when working with Perl, Ruby, C, ..., 
>> reasonably well.
>>
>>

For the case file: va( does that in vim. Works also with va[ for [], va{ 
for {}, va" for "" and vat for html tags. Thi vi versions might also be 
interesting to omit the delimiters (vi[, etc.). Works independent of file 
mode.


But please let us not dive down this hole. ;-P But on the other: "vim" and 
"modern", ..., hmmm

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
Note that posts from new members are moderated - please be patient with your 
first post.
To unsubscribe from this group, send email to
clojure+unsubscr...@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/clojure?hl=en

Re: seesaw texteditor.clj classpath error

2012-01-23 Thread Dave Ray
Jay,

That's enough.

You've asked this question and many related questions over the last
several months [1][2][3][4][5][6]. Usually the simplest answer is
download Leiningen [7] and learn to use it. The advice is the same
here. Since this is the point in a thread when you usually disappear
only to resurface somewhere else a week or two later I'll leave it at
that. I don't know how to help you.

Dave

p.s. That example hasn't looked like that in 8 months. You'll find the
latest here: 
https://github.com/daveray/seesaw/blob/develop/test/seesaw/test/examples/text_editor.clj


[1] 
https://groups.google.com/group/seesaw-clj/browse_thread/thread/69155ac1d1f11e67
[2] 
https://groups.google.com/group/seesaw-clj/browse_thread/thread/79f6d47baad95a72
[3] 
https://groups.google.com/group/clojure/browse_thread/thread/2a0d85c5fee9f59d/
[4] 
https://groups.google.com/group/clojure/browse_thread/thread/5931c8f60a36b3b4/
[5] 
https://groups.google.com/group/clojure/browse_thread/thread/5fc68b5233698d7c
[6] 
https://groups.google.com/group/clojure/browse_thread/thread/3475c70556c03746/
[7] https://github.com/technomancy/leiningen

On Sun, Jan 22, 2012 at 11:24 PM, jayvandal  wrote:
> I get this error with classpath. I This is not leiningen  but should
> be simple
>
> c:/opt/jars contains seesaw-1.2.2.jar
>
> Classpath = c:/opt/jars/*;
> Program is by Daveray. I copied it and changed name(line 1) to
> seeeditor.core
>
> (ns seeeditor.core
>  (:use seesaw.core
>        [clojure.java.io :only [file]])
>  (:import [javax.swing JFileChooser JEditorPane JScrollPane
> BorderFactory]
>           java.awt.Font)
>  (:gen-class))
>
> I run this and line
> java -jar c:/opt/jars/clojure.jar c:/aproject/seeeditor.clj
>  and got this
>
> C:\Aproject>java -jar c:/opt/jars/clojure.jar c:/aproject/
> seeeditor.clj
> Exception in thread "main" java.io.FileNotFoundException: Could not
> locate seesa
> w/core__init.class or seesaw/core.clj on classpath:  (seeeditor.clj:1)
>
> --
> 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
> Note that posts from new members are moderated - please be patient with your 
> first post.
> To unsubscribe from this group, send email to
> clojure+unsubscr...@googlegroups.com
> For more options, visit this group at
> http://groups.google.com/group/clojure?hl=en

-- 
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
Note that posts from new members are moderated - please be patient with your 
first post.
To unsubscribe from this group, send email to
clojure+unsubscr...@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/clojure?hl=en


Re: How to loop over several sequences in parallel for side-effects?

2012-01-23 Thread Meikel Brandmeyer (kotarak)
And (dorun (map )) is creating a cons with a random value (most likely nil) 
and traverses it and throws it away at every sequence step. YMMV.

-- 
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
Note that posts from new members are moderated - please be patient with your 
first post.
To unsubscribe from this group, send email to
clojure+unsubscr...@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/clojure?hl=en

Re: ANN: ClojureScript revision 927 release

2012-01-23 Thread Marko Kocić
Nice.
All we need now is clojurescriptone release and lein plugin.

-- 
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
Note that posts from new members are moderated - please be patient with your 
first post.
To unsubscribe from this group, send email to
clojure+unsubscr...@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/clojure?hl=en

Re: Literate programming in emacs - any experience?

2012-01-23 Thread Sam Ritchie
I've been wondering this as well -- I'm specifically curious about how one
might jump back and forth between literate source like
this
and
the REPL. I know you can evaluate code snippets into the repl; I'm thinking
of early steps like loading an entire namespace into the repl when its code
exists in separate code blocks. Some command like "evaluate all code
snippets that'll be tangled into this file."

I will blog the hell out of this once I figure it out. My goal is to
rewrite Cascalog as a literate program.

On Mon, Jan 23, 2012 at 5:14 AM, Colin Yates  wrote:

> Hi all,
>
> There are some excellent resources on this mailing list regarding literate
> resources, but they are more based around the theory rather than actual use.
>
> Has anybody got any "real world usage reports" regarding using literate
> programming in emacs?  In particular, does paredit and slime work inside
> the clojure "fragments" when using org.babel for example?
>
> Finally - how are people finding practising TDD with literate programming?
>  I imagine that Clojure's excellent REPL (+ evaluating clojure forms from
> within a buffer) mean there are far less "type, extract tangled code, run
> tests" needed.  Hmmm, not sure that is clear.  What I mean is, do people
> find that the ability to evaluate a clojure form from within org.babel
> (assuming that is possible!) is sufficient for TDD or do you find you need
> to type, extract the tangled code and then run lein (for example) to run
> the tests?
>
> Basically - how do y'all get on with TDDing in emacs following the
> approach of literate programming - any advice welcome!
>
> Thanks all.
>
> Col
>
> --
> 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
> Note that posts from new members are moderated - please be patient with
> your first post.
> To unsubscribe from this group, send email to
> clojure+unsubscr...@googlegroups.com
> For more options, visit this group at
> http://groups.google.com/group/clojure?hl=en




-- 
Sam Ritchie, Twitter Inc
703.662.1337
@sritchie09

(Too brief? Here's why! http://emailcharter.org)

-- 
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
Note that posts from new members are moderated - please be patient with your 
first post.
To unsubscribe from this group, send email to
clojure+unsubscr...@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/clojure?hl=en

Re: Literate programming in emacs - any experience?

2012-01-23 Thread daly
On Mon, 2012-01-23 at 05:14 -0800, Colin Yates wrote:
> Hi all,
> 
> 
> There are some excellent resources on this mailing list regarding
> literate resources, but they are more based around the theory rather
> than actual use.
> 
> 
> Has anybody got any "real world usage reports" regarding using
> literate programming in emacs?  In particular, does paredit and slime
> work inside the clojure "fragments" when using org.babel for example?

I've been using literate programming for years in Axiom.
Basically I write in a buffer containing latex, my literate tool
of choice. I have a *shell* buffer open running Lisp.

The lisp code is in a "chunk" delimited by
\begin{chunk}{chunkname}
   (this is the lisp code)
\end{chunk}

All I have to do is clip the lisp code, yank it into the *shell*
buffer, and it gets evaluated.

Once I've developed a small piece of program (about 20 lines
or so), I do a complete system rebuild and run all of the tests.
If all of the tests pass I git-commit the result, push it to
the public servers, and start writing again.

> 
> 
> Finally - how are people finding practising TDD with literate
> programming?  I imagine that Clojure's excellent REPL (+ evaluating
> clojure forms from within a buffer) mean there are far less "type,
> extract tangled code, run tests" needed.  Hmmm, not sure that is
> clear.  What I mean is, do people find that the ability to evaluate a
> clojure form from within org.babel (assuming that is possible!) is
> sufficient for TDD or do you find you need to type, extract the
> tangled code and then run lein (for example) to run the tests?

Axiom has a directory of tests, all of which are also literate
documents. When I create a new test I write the new tests, run
the tests, and capture the output. The captured output is part
of the literate test document. 

When I do a system build the new test is run as part of the whole
test suite. The test results are compared against the stored
results and failures are noted.

I've attached an example of a literate test case.
> 
> 
> Basically - how do y'all get on with TDDing in emacs following the
> approach of literate programming - any advice welcome!
> 
> 
> Thanks all.
> 
> 
> Col
> 
> -- 
> 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
> Note that posts from new members are moderated - please be patient
> with your first post.
> To unsubscribe from this group, send email to
> clojure+unsubscr...@googlegroups.com
> For more options, visit this group at
> http://groups.google.com/group/clojure?hl=en

-- 
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
Note that posts from new members are moderated - please be patient with your 
first post.
To unsubscribe from this group, send email to
clojure+unsubscr...@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/clojure?hl=en\documentclass{article}
\usepackage{axiom}
\setlength{\textwidth}{400pt}
\begin{document}
\title{\$SPAD/src/input clifford.input}
\author{Timothy Daly}
\maketitle
\begin{abstract}
\end{abstract}
\eject
\tableofcontents
\eject
\section{Overview}
CliffordAlgebra(n, K, Q) defines a vector space of dimension 2**n
over K, given a quadratic form Q on K**n.
\begin{verbatim}
  If e[i]  1<=i<=n is a basis for K**n then
 1, e[i] 1<=i<=n, e[i1]*e[i2] 1<=i1e3, e2*e3->e1, e3*e1->e2.
\end{verbatim}
\begin{chunk}{*}
--S 30 of 39
dual2 a ==
coefficient(a,[2,3])$Ext * i + _
coefficient(a,[3,1])$Ext * j + _
coefficient(a,[1,2])$Ext * k 
--R 
--R   Type: Void
--E 30

\end{chunk}
The vector cross product is then given by
\begin{chunk}{*}
--S 31 of 39
dual2(x*y)
--R 
--R   Compiling function dual2 with type CliffordAlgebra(3,Fraction 
--R  Polynomial Integer,MATRIX) -> CliffordAlgebra(3,Fraction 
--R  Polynomial Integer,MATRIX) 
--R
--R   (31)  (x2 y3 - x3 y2)e  + (- x1 y3 + x3 y1)e  + (x1 y2 - x2 y1)e
--R 1 2   3
--R  Type: CliffordAlgebra(3,Fraction Polynomial Integer,MATRIX)
--E 31

\end{chunk} 
The Dirac Algebra used in Quantum Field Theory.
\begin{chunk}{*}
)clear p qf
 
--S 32 of 39
K := FRAC INT
--R 
--R
--R   (32)  Fraction Integer
--R Type: Domain
--E 32

--S 33 of 39
g: SQMATRIX(4, K) := [[1,0,0,0],[0,-1,0,0],[0,0,-1,0],[0,0,0,-1]]
--R 
--R
--R +1   000 +
--R ||
--R |0  - 1   00 |
--R   (33)  ||
--R |0   0   - 1   0 |
--R ||
--R +0   00   - 1+
--R   Type: SquareMatrix(4,Fraction Integer)
--E 33

--S 34 of 39
qf: QFORM(4, K) := quadraticForm g
--R 
--R
--R 

[ANN] Lacij v.0.6.0

2012-01-23 Thread Pierre Allix
Hello,

A new version of Lacij is available. No big changes but bug fixes were
done and the library now supports Clojure 1.3!

https://github.com/pallix/lacij

-- 
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
Note that posts from new members are moderated - please be patient with your 
first post.
To unsubscribe from this group, send email to
clojure+unsubscr...@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/clojure?hl=en


[ANN] Lacij v.0.6.0

2012-01-23 Thread Pierre Allix
Hello,

A new version of the Tikkba and Lacij libraries are available. No big
changes but bug fixes were
done and the libraries now supports Clojure 1.3!

https://github.com/pallix/tikkba

https://github.com/pallix/lacij

-- 
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
Note that posts from new members are moderated - please be patient with your 
first post.
To unsubscribe from this group, send email to
clojure+unsubscr...@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/clojure?hl=en


Re: Literate programming in emacs - any experience?

2012-01-23 Thread daly
On Mon, 2012-01-23 at 07:18 -0800, Sam Ritchie wrote:
> I've been wondering this as well -- I'm specifically curious about how
> one might jump back and forth between literate source like this and
> the REPL. I know you can evaluate code snippets into the repl; I'm
> thinking of early steps like loading an entire namespace into the repl
> when its code exists in separate code blocks. Some command like
> "evaluate all code snippets that'll be tangled into this file."

It is trivial to write a lisp program which reads a literate file,
collects the chunks into a hash table, and writes out the chunks
into a standard text file which you can load. 

I've attached a common lisp file that I use for that purpose.
It accepts either noweb syntax for chunks, as in:
<>=
  (this is lisp code)
@
or latex syntax for chunks, as in:
\begin{chunk}{chunkname}
  (this is lisp code)
\end{chunk}

You could also write one to process straight HTML, as in:
http://axiom-developer.org/axiom-website/litprog.html

I would even be trivial to write an elisp version that runs
as an emacs command, although I've never felt the need.

Tim Daly

-- 
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
Note that posts from new members are moderated - please be patient with your 
first post.
To unsubscribe from this group, send email to
clojure+unsubscr...@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/clojure?hl=en;  0 AUTHOR and LICENSE
;  1 ABSTRACT
;  2 THE LATEX SUPPORT CODE
;  3 GLOBALS
;  4 THE TANGLE COMMAND
;  5 THE TANGLE FUNCTION
;  6 GCL-READ-FILE (aka read-sequence)
;  7 GCL-HASHCHUNKS
;  8 GCL-EXPAND
;  9 ISCHUNK-LATEX
; 10 ISCHUNK-NOWEB
; 11 ALLCHUNKS
; 12 makeHelpFiles
; 13 makeInputFiles



;;; 0 AUTHOR and LICENSE

;;; Timothy Daly (d...@axiom-developer.org) 
;;; License: Public Domain


;;; 1 ABSTRACT

;;; This program will extract the source code from a literate file

;;; A literate lisp file contains a mixture of latex and lisp sources code.
;;; The file is intended to be in one of two formats, either in latex
;;; format or, for legacy reasons, in noweb format.

;;; Latex format files defines a newenvironment so that code chunks
;;; can be delimited by \begin{chunk}{name}  \end{chunk} blocks
;;; This is supported by the following latex code.


;;; 2 THE LATEX SUPPORT CODE

;;; The verbatim package quotes everything within its grasp and is used to
;;; hide and quote the source code during latex formatting. The verbatim
;;; environment is built in but the package form lets us use it in our
;;; chunk environment and it lets us change the font.
;;;
;;; \usepackage{verbatim}
;;; 
;;; Make the verbatim font smaller
;;; Note that we have to temporarily change the '@' to be just a character
;;; because the \verbatim@font name uses it as a character
;;;
;;; \chardef\atcode=\catcode`\@
;;; \catcode`\@=11
;;; \renewcommand{\verbatim@font}{\ttfamily\small}
;;; \catcode`\@=\atcode

;;; This declares a new environment named ``chunk'' which has one
;;; argument that is the name of the chunk. All code needs to live
;;; between the \begin{chunk}{name} and the \end{chunk}
;;; The ``name'' is used to define the chunk.
;;; Reuse of the same chunk name later concatenates the chunks

;;; For those of you who can't read latex this says:
;;; Make a new environment named chunk with one argument
;;; The first block is the code for the \begin{chunk}{name}
;;; The second block is the code for the \end{chunk}
;;; The % is the latex comment character

;;; We have two alternate markers, a lightweight one using dashes
;;; and a heavyweight one using the \begin and \end syntax
;;; You can choose either one by changing the comment char in column 1
 
;;; \newenvironment{chunk}[1]{%   we need the chunkname as an argument
;;; {\ }\newline\noindent%make sure we are in column 1
;;; %{\small $\backslash{}$begin\{chunk\}\{{\bf #1}\}}% alternate begin mark
;;; \hbox{\hskip 2.0cm}{\bf --- #1 ---}%  mark the beginning
;;; \verbatim}%   say exactly what we see
;;; {\endverbatim%process \end{chunk}
;;; \par{}%   we add a newline
;;; \noindent{}%  start in column 1
;;; \hbox{\hskip 2.0cm}{\bf --}%  mark the end
;;; %$\backslash{}$end\{chunk\}%  alternate end mark (commented)
;;; \par% and a newline
;;; \normalsize\noindent}%and return to the document

;;; This declares the place where we want to expand a chunk
;;; Technically we don't need this because a getchunk must always
;;;

Re: How to loop over several sequences in parallel for side-effects?

2012-01-23 Thread Armando Blancas
Can you point to where that's happening? I can only see an iteration
of next over the sequence returned by map.

On Jan 23, 6:43 am, "Meikel Brandmeyer (kotarak)" 
wrote:
> And (dorun (map )) is creating a cons with a random value (most likely nil)
> and traverses it and throws it away at every sequence step. YMMV.

-- 
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
Note that posts from new members are moderated - please be patient with your 
first post.
To unsubscribe from this group, send email to
clojure+unsubscr...@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/clojure?hl=en


Re: Literate programming in emacs - any experience?

2012-01-23 Thread Mark Engelberg
On Mon, Jan 23, 2012 at 5:14 AM, Colin Yates  wrote:
> Has anybody got any "real world usage reports" regarding using literate
> programming in emacs?  In particular, does paredit and slime work inside the
> clojure "fragments" when using org.babel for example?

I had major problems trying to get paredit to work with org.babel
mode, especially when you throw my preference for CUA mode into the
mix.  Too many of the key bindings conflict with one another.  I also
couldn't figure out how to make any of the typical keystrokes (C-c
c-k, for example, to compile a whole file) do anything useful in org
mode.

My top three wishlist for more blog reports:
1. Literate programming workflow within a typical Clojure setup (Tim's
workflow description is interesting, but as far as I can tell his way
of doing things wouldn't transfer over to my setup.  Would also be
nice to see reports from users of Eclipse, etc.).
2. "Here's how I debugged this problem" reports in various IDEs and/or
emacs setups.
3. "Here's how I profiled this program" reports in various IDEs and/or
emacs setups.

--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
Note that posts from new members are moderated - please be patient with your 
first post.
To unsubscribe from this group, send email to
clojure+unsubscr...@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/clojure?hl=en


Re: Clojure for Cocoa

2012-01-23 Thread Jeff Heon
I know it's not a Clojure variant, but you might be interested in Nu,
an object-oriented Lisp I read about on Disclojure which targets
Objective-C.

http://programming.nu/index

-- 
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
Note that posts from new members are moderated - please be patient with your 
first post.
To unsubscribe from this group, send email to
clojure+unsubscr...@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/clojure?hl=en


Re: Literate programming in emacs - any experience?

2012-01-23 Thread Colin Yates
Excellent - very nice!

-- 
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
Note that posts from new members are moderated - please be patient with your 
first post.
To unsubscribe from this group, send email to
clojure+unsubscr...@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/clojure?hl=en

Re: ANN: ClojureScript revision 927 release

2012-01-23 Thread Robert Levy
On Mon, Jan 23, 2012 at 10:09 AM, Marko Kocić  wrote:
> Nice.
> All we need now is clojurescriptone release and lein plugin.

Earlier today I updated lein-clojurescript and submitted a pull
request, so that should be available to use soon.

Rob

>
> --
> 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
> Note that posts from new members are moderated - please be patient with your
> first post.
> To unsubscribe from this group, send email to
> clojure+unsubscr...@googlegroups.com
>
> For more options, visit this group at
> http://groups.google.com/group/clojure?hl=en

-- 
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
Note that posts from new members are moderated - please be patient with your 
first post.
To unsubscribe from this group, send email to
clojure+unsubscr...@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/clojure?hl=en


Re: How to loop over several sequences in parallel for side-effects?

2012-01-23 Thread Jeff Palmucci
Shameless plug: If you want to do this type of iteration efficiently, try my 
library at https://github.com/jpalmucci/clj-iterate

user> (iter {for x in '(1 2 3)}
  {for y in '(a b c)}
  (println x y))
1 a
2 b
3 c
nil
user> 

Expands into a fast loop/recur form. No intermediate data structures

On Jan 20, 2012, at 8:18 AM, joachim wrote:

> Hi All,
> 
> Here is a simple problem for which I nevertheless can't seem to find
> the right solution: How to run over several sequences in parallel for
> side-effects? Here is one way:
> 
> (dorun (map some-fn-with-side-effects sequence-1 sequence-2))
> 
> However, I was told that the form "(dorun (map ... ))" indicates that
> doseq should be used instead because it is faster, and I can use
> speed. I think that this is not possible however because doseq only
> allows to loop over a single sequence at a time? I was wondering what
> is the idiomatic clojure way in this case?
> 
> Thanks! Jm.
> 
> -- 
> 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
> Note that posts from new members are moderated - please be patient with your 
> first post.
> To unsubscribe from this group, send email to
> clojure+unsubscr...@googlegroups.com
> For more options, visit this group at
> http://groups.google.com/group/clojure?hl=en

-- 
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
Note that posts from new members are moderated - please be patient with your 
first post.
To unsubscribe from this group, send email to
clojure+unsubscr...@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/clojure?hl=en


Re: Literate programming in emacs - any experience?

2012-01-23 Thread Cedric Greevey
On Mon, Jan 23, 2012 at 11:19 AM, daly  wrote:
> It accepts either noweb syntax for chunks, as in:
>    <>=
>      (this is lisp code)
>    @

A rather unfortunate choice of delimiter if you wanted to use this
with Clojure code, since Clojure code frequently has internal @-signs
for other purposes. I don't suppose that noweb syntax was developed
with Clojure in mind, though, or vice-versa.

-- 
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
Note that posts from new members are moderated - please be patient with your 
first post.
To unsubscribe from this group, send email to
clojure+unsubscr...@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/clojure?hl=en


Re: How to loop over several sequences in parallel for side-effects?

2012-01-23 Thread Meikel Brandmeyer
Hi,

Am 23.01.2012 um 17:40 schrieb Armando Blancas:

> Can you point to where that's happening? I can only see an iteration
> of next over the sequence returned by map.

Exactly. And what does (map f xs) return? (cons (f (first xs)) (map f (rest 
xs))). Each such a cons is created for one step of the input sequence(s). The 
fact that you don't use the first part of the cons, does not mean it's not 
created.

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
Note that posts from new members are moderated - please be patient with your 
first post.
To unsubscribe from this group, send email to
clojure+unsubscr...@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/clojure?hl=en


Re: How to loop over several sequences in parallel for side-effects?

2012-01-23 Thread Meikel Brandmeyer
Ah. Nevermind.

-- 
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
Note that posts from new members are moderated - please be patient with your 
first post.
To unsubscribe from this group, send email to
clojure+unsubscr...@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/clojure?hl=en


Re: Literate programming in emacs - any experience?

2012-01-23 Thread Andy Fingerhut
I've only briefly scanned what I think is the relevant code in tangle.lisp
posted by Tim Daly, but it appears that the @ must be the first character
on a line, which with indenting I've never seen in a Clojure source file.
It would be a tiny change to make the @ required to be on a line by itself,
which would make it even less likely to ever appear in a source file.

Of course, there is nothing magic about the syntax or the tangle.lisp
source code that parses it that says a developer must use them -- I think
one of Tim's points is that these tangle programs are so simple you can
cook up one of your own very easily.  That can be an advantage or a
disadvantage, depending upon whether you want a de facto standard used by
many developers for this purpose.

Andy

On Mon, Jan 23, 2012 at 1:17 PM, Cedric Greevey  wrote:

> On Mon, Jan 23, 2012 at 11:19 AM, daly  wrote:
> > It accepts either noweb syntax for chunks, as in:
> ><>=
> >  (this is lisp code)
> >@
>
> A rather unfortunate choice of delimiter if you wanted to use this
> with Clojure code, since Clojure code frequently has internal @-signs
> for other purposes. I don't suppose that noweb syntax was developed
> with Clojure in mind, though, or vice-versa.
>
> --
> 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
> Note that posts from new members are moderated - please be patient with
> your first post.
> To unsubscribe from this group, send email to
> clojure+unsubscr...@googlegroups.com
> For more options, visit this group at
> http://groups.google.com/group/clojure?hl=en
>

-- 
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
Note that posts from new members are moderated - please be patient with your 
first post.
To unsubscribe from this group, send email to
clojure+unsubscr...@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/clojure?hl=en

Re: How to loop over several sequences in parallel for side-effects?

2012-01-23 Thread Alan Malloy
(dorun (map f xs ys zs)) creates and discards a cons for each
iteration, no argument there. But its first element is very cheap:
just the result of f, which you had to compute anyway.

(doseq [[x y z] (map vector xs ys zs)] (f x y z)) similarly creates a
cons for each iteration. But its value, rather than being the result
of f, is a vector constructed simply for bookkeeping purposes. Then
before you can call f you must tear apart that vector to get at the
pieces. If performance (either amount of garbage or number of
operations) were the only factor, I can't see any way that this could
be better than the dorun/map approach.

On Jan 23, 6:43 am, "Meikel Brandmeyer (kotarak)" 
wrote:
> And (dorun (map )) is creating a cons with a random value (most likely nil)
> and traverses it and throws it away at every sequence step. YMMV.

-- 
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
Note that posts from new members are moderated - please be patient with your 
first post.
To unsubscribe from this group, send email to
clojure+unsubscr...@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/clojure?hl=en


Re: Literate programming in emacs - any experience?

2012-01-23 Thread daly
On Mon, 2012-01-23 at 16:17 -0500, Cedric Greevey wrote:
> On Mon, Jan 23, 2012 at 11:19 AM, daly  wrote:
> > It accepts either noweb syntax for chunks, as in:
> ><>=
> >  (this is lisp code)
> >@
> 
> A rather unfortunate choice of delimiter if you wanted to use this
> with Clojure code, since Clojure code frequently has internal @-signs
> for other purposes. I don't suppose that noweb syntax was developed
> with Clojure in mind, though, or vice-versa.
> 

The noweb syntax was chosen by Norman Ramsey, the author.
Since the tangle program processes the literate document,
the REPL would never see the chunk syntax. The unfortunate
side effect is that latex DOES see the chunk syntax so you
have to use a "weave" program to get straight latex.

Instead I implemented a new latex environment called "chunk"
so I could use \begin{chunk} as the delimiter. This means
that the weave step is no longer required and my document
is straight latex.

In the HTML version I used  so that
the weave step is not required either.

For Eclipse I suppose we could invent a chunk syntax
and create a plugin. If people are interested perhaps we
could create a Literate Clojure plugin for Eclipse. See
http://www.eclipse.org/articles/Article-Your%20First%
20Plug-in/YourFirstPlugin.html
That would make Clojure and Literate much more useful
to Eclipse users.

Tim Daly



-- 
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
Note that posts from new members are moderated - please be patient with your 
first post.
To unsubscribe from this group, send email to
clojure+unsubscr...@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/clojure?hl=en


language agnostic nrepl client test suite

2012-01-23 Thread Martin DeMello
It is often convenient to have an nrepl client in a non-jvm language -
so far I've written one in ocaml and Meikel Brandmeyer has one in
factor, that I know of. I'd like to get some ideas for a way to test
client compliance in a language agnostic manner - this will be
especially helpful when nrepl.next is rolled out.

One idea I had was to maintain a text file with a list of
request/response pairs, where  was a string and 
was the expected nrepl response encoded in a standard third-party
format like json (though i'm not sure how well that copes with binary
blobs) - clients could then submit the request to a running server,
decode both the nrepl response and the testfile response, and compare
the resulting in-memory data structures. As a bonus, the official
clojure client test suite could use this too.

The other option would be to run all the requests against the server,
collect the responses as literal strings, and decode those in the
client. The advantage of this would be that it would not need a server
running (always a good thing for tests); on the other hand it's easier
to get out of sync, or miss testing network-related issues.

martin

-- 
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
Note that posts from new members are moderated - please be patient with your 
first post.
To unsubscribe from this group, send email to
clojure+unsubscr...@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/clojure?hl=en


Re: Implementing an interface with core/proxy results in UnsupportedOperationException

2012-01-23 Thread Michael Klishin
Chris Perkins:

> You may want to dig a little deeper into why reify was not working for you. 
> As far as I can tell, the classes created by reify do have a public, no-arg 
> constructor, as you require:
> 
> user> (-> (reify Runnable (run [_])) type .getConstructors seq)
> (# 
> #)

I have tried using a patched version of Quartz that did more aggressive 
exception logging and neither the message
nor the stack trace gave any clue. I started to suspect class loader issues 
(Quartz instantiates jobs in a separate
thread) but had no time to prove or disprove this so far.

MK

-- 
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
Note that posts from new members are moderated - please be patient with your 
first post.
To unsubscribe from this group, send email to
clojure+unsubscr...@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/clojure?hl=en


Re: Implementing an interface with core/proxy results in UnsupportedOperationException

2012-01-23 Thread Michael Klishin
Cedric Greevey:

> Then he has a problem, since it doesn't work with reify and proxy, and
> gen-class, deftype, and defrecord are top-level things that don't play
> nice with putting them inside a defn.
> 

I do not need them to be inside defn. They will be used as defn and defrecord 
are
used, in the top-level namespace code.

> I'm actually somewhat surprised that Clojure provides no good way
> around this problem in that case.
> 

I personally find this an edge case with how Quartz works, see my reply in this 
thread
about possible class loading problems.

> The OP will basically just have to have a separate deftype for each
> job class he needs. The parts that are repetitious can at least be
> abstracted into a macro, something like (defmacro defjob [name & body]
> `(deftype ~name [] Job (execute [ctx] ~@body))).

I find it fine for my needs.

MK

-- 
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
Note that posts from new members are moderated - please be patient with your 
first post.
To unsubscribe from this group, send email to
clojure+unsubscr...@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/clojure?hl=en


Logic program and hierarchical data

2012-01-23 Thread Base
Hi -

I am attempting to model some hierarchical data for use in my first
logic program and am having some problems understanding how to create
a “typeof?” relationship with my data.

Defining parent child is easy enough of course; however I would like
to design a generic way of defining a subclass or superclass such
that, given some set of hierarchical data, for example:

Domain - Eukarya
Kingdom - Animalia/Metazoa
Phylum - Chordata
Class - Mammalia
Order - Primate
Family - Hominidae
Genus - Homo
Species - Homo sapiens

(typeof? “Mammalia” “Eukarya”)  and
(typeof? “Primate” “Eukarya”) and
(typeof? “Hominidae” Eukarya”)

all are true using the same mechanism without having to explicitly
define the order one by one like:

(defrel typeof? p c)
(fact typeof? “Homo”  “Homo sapiens”)
(fact typeof? “Hominidae” “Homo sapiens”)
(fact typeof? “Primate” “Homo sapiens”)
(fact typeof? “Mammalia” “Homo sapiens”)
...

Any help getting started on this would be most appreciated!

Thanks!

Base

-- 
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
Note that posts from new members are moderated - please be patient with your 
first post.
To unsubscribe from this group, send email to
clojure+unsubscr...@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/clojure?hl=en


Re: Literate programming in emacs - any experience?

2012-01-23 Thread Cedric Greevey
On Mon, Jan 23, 2012 at 6:23 PM, daly  wrote:
> On Mon, 2012-01-23 at 16:17 -0500, Cedric Greevey wrote:
>> On Mon, Jan 23, 2012 at 11:19 AM, daly  wrote:
>> > It accepts either noweb syntax for chunks, as in:
>> >    <>=
>> >      (this is lisp code)
>> >    @
>>
>> A rather unfortunate choice of delimiter if you wanted to use this
>> with Clojure code, since Clojure code frequently has internal @-signs
>> for other purposes. I don't suppose that noweb syntax was developed
>> with Clojure in mind, though, or vice-versa.
>>
>
> The noweb syntax was chosen by Norman Ramsey, the author.
> Since the tangle program processes the literate document,
> the REPL would never see the chunk syntax.

But the tangle program would, and would interpret the chunk as
stopping at the first use of @my-atom or @some-ref or @a-future...

> Instead I implemented a new latex environment called "chunk"
> so I could use \begin{chunk} as the delimiter. This means
> that the weave step is no longer required and my document
> is straight latex.

That works much better, since \end{chunk} is not valid Clojure, as
\end is not a valid character constant, and {chunk} is not a valid map
(one fewer values than keys!), so the end delimiter should never occur
accidentally inside of Clojure code. Well, there's the minor matter of
the slight chance of "\\end{chunk}" or some similar string literal, I
suppose, but it's a lot less likely than an @ character! And such a
string literal can be broken up using e.g. (str "\\en" "d{chunk}").
Though that's a bit of an ugly hack, it's only likely to arise in
exactly one instance: the Clojure code used to implement tangle
itself.

> In the HTML version I used  so that
> the weave step is not required either.

 being the delimiter, I presume. Another one that ought to be
rare in Clojure code and absent outside of string literals, though
given the frequent use of Clojure with Compojure/etc. to emit HTML,
it'll be more common there than \end{chunk}. I suppose it might also
be a valid symbol, but you'd have to be crazy to have (defn 
[foo] ...) in your code base. :)

> For Eclipse I suppose we could invent a chunk syntax
> and create a plugin. If people are interested perhaps we
> could create a Literate Clojure plugin for Eclipse. See
> http://www.eclipse.org/articles/Article-Your%20First%
> 20Plug-in/YourFirstPlugin.html
> That would make Clojure and Literate much more useful
> to Eclipse users.

Based on CCW, or a de novo effort?

-- 
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
Note that posts from new members are moderated - please be patient with your 
first post.
To unsubscribe from this group, send email to
clojure+unsubscr...@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/clojure?hl=en


Re: Literate programming in emacs - any experience?

2012-01-23 Thread daly

> > For Eclipse I suppose we could invent a chunk syntax
> > and create a plugin. If people are interested perhaps we
> > could create a Literate Clojure plugin for Eclipse. See
> > http://www.eclipse.org/articles/Article-Your%20First%
> > 20Plug-in/YourFirstPlugin.html
> > That would make Clojure and Literate much more useful
> > to Eclipse users.
> 
> Based on CCW, or a de novo effort?
> 
Ah. I was unaware of CCW although it has been mentioned here.

I don't use Eclipse. I was just following the principle that
"advocacy is volunteering" and, since I'm advocating doing
literate programming and the topic is literate Clojure
under Eclipse, I felt I needed to set up some kind of
solution. I try to implement what I advocate (e.g. showing
tangle for lisp code and HTML code). Otherwise I'd be
expecting someone else to do stuff I want and that's not
really how open source should work. 

So, no, if CCW is already doing this then follow their lead.

Tim Daly


-- 
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
Note that posts from new members are moderated - please be patient with your 
first post.
To unsubscribe from this group, send email to
clojure+unsubscr...@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/clojure?hl=en


Re: Literate programming in emacs - any experience?

2012-01-23 Thread Cedric Greevey
On Mon, Jan 23, 2012 at 10:06 PM, daly  wrote:
>
>> > For Eclipse I suppose we could invent a chunk syntax
>> > and create a plugin. If people are interested perhaps we
>> > could create a Literate Clojure plugin for Eclipse. See
>> > http://www.eclipse.org/articles/Article-Your%20First%
>> > 20Plug-in/YourFirstPlugin.html
>> > That would make Clojure and Literate much more useful
>> > to Eclipse users.
>>
>> Based on CCW, or a de novo effort?
>>
> Ah. I was unaware of CCW although it has been mentioned here.
>
> I don't use Eclipse. I was just following the principle that
> "advocacy is volunteering" and, since I'm advocating doing
> literate programming and the topic is literate Clojure
> under Eclipse, I felt I needed to set up some kind of
> solution. I try to implement what I advocate (e.g. showing
> tangle for lisp code and HTML code). Otherwise I'd be
> expecting someone else to do stuff I want and that's not
> really how open source should work.
>
> So, no, if CCW is already doing this then follow their lead.

CCW isn't, to my knowledge, specifically doing literate-support. But
it is an existing Clojure IDE plugin for Eclipse, so building upon
that might make more sense than creating a whole new Eclipse Clojure
IDE plugin from scratch.

-- 
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
Note that posts from new members are moderated - please be patient with your 
first post.
To unsubscribe from this group, send email to
clojure+unsubscr...@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/clojure?hl=en


Re: Logic program and hierarchical data

2012-01-23 Thread Edmund
Hi Base,

In Dave Nolen's tutorial:
https://github.com/swannodette/logic-tutorial there is a section on
genealogy in which he composes child and child to create grandchild.
Seems similar, maybe helpful ?

 Edmund

On 24/01/2012 01:35, Base wrote:
> Hi -
> 
> I am attempting to model some hierarchical data for use in my
> first logic program and am having some problems understanding how
> to create a “typeof?” relationship with my data.
> 
> Defining parent child is easy enough of course; however I would
> like to design a generic way of defining a subclass or superclass
> such that, given some set of hierarchical data, for example:
> 
> Domain - Eukarya Kingdom - Animalia/Metazoa Phylum - Chordata Class
> - Mammalia Order - Primate Family - Hominidae Genus - Homo Species
> - Homo sapiens
> 
> (typeof? “Mammalia” “Eukarya”)  and (typeof? “Primate” “Eukarya”)
> and (typeof? “Hominidae” Eukarya”)
> 
> all are true using the same mechanism without having to explicitly 
> define the order one by one like:
> 
> (defrel typeof? p c) (fact typeof? “Homo”  “Homo sapiens”) (fact
> typeof? “Hominidae” “Homo sapiens”) (fact typeof? “Primate” “Homo
> sapiens”) (fact typeof? “Mammalia” “Homo sapiens”) ...
> 
> Any help getting started on this would be most appreciated! 
> 
Thanks!
> 
> Base
> 

-- 
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
Note that posts from new members are moderated - please be patient with your 
first post.
To unsubscribe from this group, send email to
clojure+unsubscr...@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/clojure?hl=en


Re: Logic program and hierarchical data

2012-01-23 Thread Cedric Greevey
On Mon, Jan 23, 2012 at 11:04 PM, Edmund  wrote:
> Hi Base,
>
>        In Dave Nolen's tutorial:
> https://github.com/swannodette/logic-tutorial there is a section on
> genealogy in which he composes child and child to create grandchild.
> Seems similar, maybe helpful ?

Caveat: I'm familiar with logic, but not with logic programming.

That said, I'd suggest defining a transitive "descended from"
relation, so "if A is descended from B, and B is descended from C,
then A is descended from C" is an axiom of the system.

Then define that "Homo sapiens is descended from Homo", and "Homo is
descended from Primates", and etc., and the transitive relations such
as "Homo sapiens is descended from Primates" will be theorems of the
system rather than having to be put in by hand.

It's just first-order logic so I doubt it's not possible with the
core.logic system. But again, I don't know the specific syntax. You
need something like (for all [x y z] (if (and (typeof? x y) (typeof? y
z)) (fact (typeof? x z but the for and if forms, at least, are
pseudo-code here. Someone who knows more about core.logic could tell
you how to specify something like this, syntactically speaking. Maybe
you know enough of the syntax to put the rest together without further
assistance.

-- 
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
Note that posts from new members are moderated - please be patient with your 
first post.
To unsubscribe from this group, send email to
clojure+unsubscr...@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/clojure?hl=en


Re: Logic program and hierarchical data

2012-01-23 Thread David Nolen
One way:

(ns hierarchy.core
  (:refer-clojure :exclude [==])
  (:use [clojure.core.logic]))

(def order [:domain :kingdom :phylum :class :order :family :genus :species])

(def homo-sapiens
  {:domain :eukarya
   :kingdom :animalia-metazoa
   :phylum :chordata
   :class :mammalia
   :order :primate
   :family :hominidae
   :genus :homo
   :species :homo-sapiens})

(defrel rank ^:index rank ^:index name)
(defrel typeof* ^:index a ^:index b)

(defn add-to-db [data]
  (doseq [[a b] (map (fn [a b]
   [(find data a)
(find data b)])
   order (rest order))]
(apply fact rank a)
(fact typeof* (second b) (second a

(defn typeof [a b]
  (conde
[(typeof* a b)]
[(fresh [x]
   (typeof* a x)
   (typeof x b))]))

(comment
  (add-to-db homo-sapiens)

  ; find all domains
  (run* [q]
(rank :domain q))

  ; (true)
  (run* [q]
(typeof :mammalia :eukarya)
(typeof :homo-sapiens :hominidae)
(typeof :homo-sapiens :primate)
(typeof :homo-sapiens :eukarya)
(== q true))
  )

On Mon, Jan 23, 2012 at 8:35 PM, Base  wrote:

> Hi -
>
> I am attempting to model some hierarchical data for use in my first
> logic program and am having some problems understanding how to create
> a “typeof?” relationship with my data.
>
> Defining parent child is easy enough of course; however I would like
> to design a generic way of defining a subclass or superclass such
> that, given some set of hierarchical data, for example:
>
> Domain - Eukarya
>Kingdom - Animalia/Metazoa
>Phylum - Chordata
>Class - Mammalia
>Order - Primate
>Family - Hominidae
>Genus - Homo
>Species - Homo
> sapiens
>
> (typeof? “Mammalia” “Eukarya”)  and
> (typeof? “Primate” “Eukarya”) and
> (typeof? “Hominidae” Eukarya”)
>
> all are true using the same mechanism without having to explicitly
> define the order one by one like:
>
> (defrel typeof? p c)
> (fact typeof? “Homo”  “Homo sapiens”)
> (fact typeof? “Hominidae” “Homo sapiens”)
> (fact typeof? “Primate” “Homo sapiens”)
> (fact typeof? “Mammalia” “Homo sapiens”)
> ...
>
> Any help getting started on this would be most appreciated!
> Thanks!
>
> Base
>
> --
> 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
> Note that posts from new members are moderated - please be patient with
> your first post.
> To unsubscribe from this group, send email to
> clojure+unsubscr...@googlegroups.com
> For more options, visit this group at
> http://groups.google.com/group/clojure?hl=en

-- 
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
Note that posts from new members are moderated - please be patient with your 
first post.
To unsubscribe from this group, send email to
clojure+unsubscr...@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/clojure?hl=en

Re: Logic program and hierarchical data

2012-01-23 Thread Cedric Greevey
On Mon, Jan 23, 2012 at 11:41 PM, David Nolen  wrote:
> (def homo-sapiens
>   {:domain :eukarya
>    :kingdom :animalia-metazoa
>    :phylum :chordata
>    :class :mammalia
>    :order :primate
>    :family :hominidae
>    :genus :homo
>    :species :homo-sapiens})

Looks like putting all the transitive relations in by hand to me.
Ideally, once you had a genus set up you'd only have to specify that
various species of the genus are species of that genus, and not have
to specify kingdom, phylum, class, order, or family for any of them
explicitly.

-- 
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
Note that posts from new members are moderated - please be patient with your 
first post.
To unsubscribe from this group, send email to
clojure+unsubscr...@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/clojure?hl=en


Re: Logic program and hierarchical data

2012-01-23 Thread David Nolen
On Tue, Jan 24, 2012 at 12:00 AM, Cedric Greevey  wrote:

> On Mon, Jan 23, 2012 at 11:41 PM, David Nolen 
> wrote:
> > (def homo-sapiens
> >   {:domain :eukarya
> >:kingdom :animalia-metazoa
> >:phylum :chordata
> >:class :mammalia
> >:order :primate
> >:family :hominidae
> >:genus :homo
> >:species :homo-sapiens})
>
> Looks like putting all the transitive relations in by hand to me.
> Ideally, once you had a genus set up you'd only have to specify that
> various species of the genus are species of that genus, and not have
> to specify kingdom, phylum, class, order, or family for any of them
> explicitly.


Sure, improvements left as an exercise for the reader ;)

David

-- 
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
Note that posts from new members are moderated - please be patient with your 
first post.
To unsubscribe from this group, send email to
clojure+unsubscr...@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/clojure?hl=en

Re: "including" Protocols in clojurescript

2012-01-23 Thread Dave Sann
I am still not sure what the definitive answer to this is.
Can anyone confirm?

thanks

Dave

-- 
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
Note that posts from new members are moderated - please be patient with your 
first post.
To unsubscribe from this group, send email to
clojure+unsubscr...@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/clojure?hl=en

Re: Clojure for Cocoa

2012-01-23 Thread Matthias Benkard
Hi,

David Nolen schrieb:
> * F-Script
> * JSCocoa
> * Clozure CL
> * MacRuby

Also,

* Toilet Lisp.  Git repo: https://matthias.benkard.de/code/toilet.git

Toilet Lisp is an incomplete implementation of Common Lisp hosted on
the Objective-C runtime.  It includes both an interpreter and an LLVM-
based compiler, which, IIRC, are actually complete.  (It's the
standard library that's missing.)

You might be able to leverage some of it.

If you have questions about anything related to Toilet Lisp
(installation, code internals, etc.), just ask.

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
Note that posts from new members are moderated - please be patient with your 
first post.
To unsubscribe from this group, send email to
clojure+unsubscr...@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/clojure?hl=en


Re: [ANN] oauth-clj

2012-01-23 Thread Dave Sann
Hi r0man,

I am curious as to similarities/differences of your library to: 
https://github.com/mattrepl/clj-oauth

Dave

-- 
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
Note that posts from new members are moderated - please be patient with your 
first post.
To unsubscribe from this group, send email to
clojure+unsubscr...@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/clojure?hl=en