Re: A New Core.logic Primer

2012-03-15 Thread Thorsten Wilms
On 03/14/2012 08:00 PM, David Nolen wrote: Thanks to Edmund Jackson we have a new primer for core.logic: https://github.com/clojure/core.logic/wiki/A-Core.logic-Primer Feedback appreciated! Hi! Does a run* expression evaluate to only the query-variable, while lvars introduced with fresh

Re: A New Core.logic Primer

2012-03-15 Thread Edmund
Hi Thorsten, Thanks for reading and the great feedback. In response, yes lvars introduced by fresh stay 'inside' the run* which only returns the query lvar. Your other comments are 100% correct and I will update the document to reflect them. Thanks again, Edmund On Thursday, 15 March

Re: A New Core.logic Primer

2012-03-15 Thread Milton Silva
This primer is a good introduction to core.logic operators. What I think is missing is a tutorial that answers these questions: What type of problems does core.logic excel at solving? How do you solve problems with core.logic? How does it enable simplicity? (Rich said in simple made easy that

Re: A New Core.logic Primer

2012-03-15 Thread David Nolen
On Thu, Mar 15, 2012 at 9:05 AM, Milton Silva milton...@gmail.com wrote: This primer is a good introduction to core.logic operators. What I think is missing is a tutorial that answers these questions: What type of problems does core.logic excel at solving? How do you solve problems with

((symbol whatever) 1 :a) evaluates to :a . How can this be?

2012-03-15 Thread Thumbnail
An expression yielding an arbitrary symbol, used as a function, returns its second argument. ((symbol whatever) 1 :a) = :a If it has one argument, it returns nil. ((symbol whatever) 1) = nil It does not accept more than two arguments. ((symbol whatever) 1 :a \z) = #ArityException

ANN Frinj 0.1.3

2012-03-15 Thread martintrojer
https://github.com/martintrojer/frinj New features; - Live unit feeds for currency conversion, precious and industrial metals plus agrarian commodities - New repl namespace for more convenient initialisation Frinj is a practical unit-of-measure calculator DSL for

Re: [ANN] clojure-scheme - Compiling Clojure to Scheme to C

2012-03-15 Thread Chip Collier
Holy excellent development Batman! On 3/14/12 2:08 PM, Nathan Sorenson wrote: I've modified the output of the ClojureScript compiler to emit Scheme code. At this point the core library is successfully compiled by Gambit Scheme. A nice advantage of this is that Gambit compiles code via C,

Re: how to restart Clojurescript One repl the right way?

2012-03-15 Thread Murphy McMahon
This is what I did on a project branched off of ClojureScript One: https://github.com/pandeiro/multiedit/blob/multi-edit/src/app/clj/one/sample/repl.clj It saves the server instance to an atom and adds (stop) and (restart) functions. Just an idea. M On Sat, Mar 10, 2012 at 6:36 AM, Pierre-Henry

Re: Can Clojure be as readable as Python or Ruby ?

2012-03-15 Thread daly
On Mon, 2012-03-12 at 21:59 +0900, Andrzej wrote: On Sun, Mar 11, 2012 at 2:56 AM, Softaddicts lprefonta...@softaddicts.ca wrote: About item 1: The first Lisp I used was runing on a DEC-10 with 256k 36 bits words of physical memory (magnetic-core memory). It had a structural editor.

Resolving vars and quoting

2012-03-15 Thread Paul Carey
Hi If I apply the following function to 4 and 6 (defn arith [x y] (map (fn [op] [(op x y) `(~op ~x ~y)]) [+ - / *])) I'd like to get a result of the form ([10 (+ 4 6)] [-2 (- 4 6)] ...) but instead I get something like ([10 (#core$_PLUS_ clojure.core$_PLUS_@4f6de641 4 6)] ... How do I

Re: proper clojure hammocks/alternatives

2012-03-15 Thread Phil Dobbin
-BEGIN PGP SIGNED MESSAGE- Hash: SHA1 On 12/03/2012 16:09, Gary Trakhman wrote: Seriously considering some kind of apparatus to facilitate hammock-driven-development in the office. Has anyone implemented a hammock in their workspace? How about one of those giant bean bag chairs?

'contains?' on 'sorted-set-by' based on the comparator only? (possible bug?)

2012-03-15 Thread mnicky
It seems that when using the sorted set with my own comparator (sorted-set-by), the lookup via 'contains?' function is based only on the part of the items that participate in the ordering: (contains? (sorted-set [1 :a] [2 :b]) [2 :c]) ;= false (contains? (sorted-set-by #( (%1 0) (%2 0)) [1 :a]

Re: A New Core.logic Primer

2012-03-15 Thread Jim - FooBar();
amazing stuff guys!!! Jim On 14/03/12 19:00, David Nolen wrote: Thanks to Edmund Jackson we have a new primer for core.logic: https://github.com/clojure/core.logic/wiki/A-Core.logic-Primer Feedback appreciated! David -- You received this message because you are subscribed to the Google

[ANN] [shen.clj 0.1.0]

2012-03-15 Thread Håkan Råberg
神.clj | Shen for Clojure 0.1.0 Shen[1] is a portable functional programming language by Mark Tarver[2] that offers * pattern matching, * λ calculus consistency, * macros, * optional lazy evaluation, * static type checking, * an integrated fully functional Prolog, * and an inbuilt

Resolving vars and quoting

2012-03-15 Thread Paul Carey
Hi If I apply the following function to 4 and 6 (defn arith [x y] (map (fn [op] [(op x y) `(~op ~x ~y)]) [+ - / *])) I'd like to get a result of the form ([10 (+ 4 6)] [-2 (- 4 6)] ...) but instead I get something like ([10 (#core$_PLUS_ clojure.core$_PLUS_@4f6de641 4 6)] ... How do I

Re: Which emacs packages?

2012-03-15 Thread Mike Bridge
midje-mode + midje is a nice way doing TDD with emacs---if you modify it so it prints PASSED instead of a random quotation. -Mike On Thursday, 8 March 2012 10:10:15 UTC-7, AndyK wrote: Curious about which emacs packages folks use for increased Clojure productivity (beyond the obvious, like

ANN: A Brief Beginner's Guide to Clojure

2012-03-15 Thread John Gabriele
Hi all, I wrote a [brief beginner's guide to Clojure][1] that might interest those who are brand new to Clojure. [1]: http://www.unexpected-vortices.com/clojure/brief-beginners-guide/ First paragraph: The purpose of this brief (and sometimes opinionated) guide is to get new users quickly set up

Lein compilation error how to fix dependencies

2012-03-15 Thread ashu
Hello, I am using lein deps for storm-starter. It said the first ran lein, it would propogate dependencies. But the first time, I ran it in a wrong place and got the following error. Then I moved to project root and did lein deps again. I got the same error. How to fix the dependencies?

[ANN] shen.clj 0.1.0

2012-03-15 Thread Håkan Råberg
https://github.com/hraberg/shen.clj | [shen.clj 0.1.0] Shen is a portable functional programming language by Mark Tarver: The Shen mission is to develop an ultra-portable version of Qi ... The means of achieving this involves developing a small fast Lisp called Kl which is rich enough to

Re: Which emacs packages?

2012-03-15 Thread Phil Dobbin
On 12/03/2012 19:03, Sean Devlin wrote: vim :-p +1 ;-) On Thursday, March 8, 2012 12:10:15 PM UTC-5, AndyK wrote: Curious about which emacs packages folks use for increased Clojure productivity (beyond the obvious, like slime/swank-clojure)... -- You received this message

Re: Resolving vars and quoting

2012-03-15 Thread Jack Moffitt
If I apply the following function to 4 and 6 (defn arith [x y]  (map (fn [op] [(op x y) `(~op ~x ~y)]) [+ - / *])) I'd like to get a result of the form ([10 (+ 4 6)] [-2 (- 4 6)] ...) but instead I get something like ([10 (#core$_PLUS_ clojure.core$_PLUS_@4f6de641 4 6)] ... You want to

Re: ((symbol whatever) 1 :a) evaluates to :a . How can this be?

2012-03-15 Thread Jack Moffitt
What's going on? Symbols, like keywords, are functions that look themselves up in maps. In the 2 arg version, you're supplying an invalid map and a not-found value, and it's returning not-found. In the 1 arg version, it returns the default not-found of nil. jack. -- You received this message

Re: Resolving vars and quoting

2012-03-15 Thread Stuart Halloway
As an aside, when playing around with quoting and unquoting, I noticed that the result of ('+ 3 5) is 5. I'm not sure what I would have expected (maybe an error?) but it wasn't the third item of the list. Is there any reason for this? From http://clojure.org/data_structures: Symbols, just

Re: A New Core.logic Primer

2012-03-15 Thread Daniel Gagnon
Could this tutorial explain the foremost question people have when seeing core.logic: why is o appened to the names of all those functions? -- 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

Re: A New Core.logic Primer

2012-03-15 Thread David Nolen
On Thu, Mar 15, 2012 at 12:59 PM, Daniel Gagnon redalas...@gmail.comwrote: Could this tutorial explain the foremost question people have when seeing core.logic: why is o appened to the names of all those functions? It's a convention from The Reasoned Schemer. It's just an easy way to

Re: A New Core.logic Primer

2012-03-15 Thread Phil Hagelberg
David Nolen dnolen.li...@gmail.com writes: On Thu, Mar 15, 2012 at 12:59 PM, Daniel Gagnon redalas...@gmail.com wrote: Could this tutorial explain the foremost question people have when seeing core.logic: why is o appened to the names of all those functions? It's a convention

Re: Lein compilation error how to fix dependencies

2012-03-15 Thread Phil Hagelberg
ashu ash...@gmail.com writes: I am using lein deps for storm-starter. It said the first ran lein, it would propogate dependencies. But the first time, I ran it in a wrong place and got the following error. Then I moved to project root and did lein deps again. I got the same error. How to fix

Re: A New Core.logic Primer

2012-03-15 Thread David Nolen
On Thu, Mar 15, 2012 at 1:41 PM, Phil Hagelberg p...@hagelb.org wrote: David Nolen dnolen.li...@gmail.com writes: On Thu, Mar 15, 2012 at 12:59 PM, Daniel Gagnon redalas...@gmail.com wrote: Could this tutorial explain the foremost question people have when seeing core.logic:

Re: A New Core.logic Primer

2012-03-15 Thread Sean Corfield
On Thu, Mar 15, 2012 at 10:49 AM, David Nolen dnolen.li...@gmail.com wrote: It's a convention from The Reasoned Schemer. It's just an easy way to differentiate goals from regular functions. What's the rationale in TRS for that? (and conde) Like Phil (and no doubt others) it seems an odd

Re: A New Core.logic Primer

2012-03-15 Thread Daniel Gagnon
On Thu, Mar 15, 2012 at 3:08 PM, Sean Corfield seancorfi...@gmail.comwrote: On Thu, Mar 15, 2012 at 10:49 AM, David Nolen dnolen.li...@gmail.com wrote: It's a convention from The Reasoned Schemer. It's just an easy way to differentiate goals from regular functions. What's the rationale

Re: A New Core.logic Primer

2012-03-15 Thread David Nolen
On Thu, Mar 15, 2012 at 3:08 PM, Sean Corfield seancorfi...@gmail.comwrote: In other words, you want access to both unqualified cons and conso, rest and resto etc in the same code? Yet core.logic overrides == and so you either have to namespace that or exclude it (the examples seem to do the

Re: Resolving vars and quoting

2012-03-15 Thread Tassilo Horn
Paul Carey paul.p.ca...@gmail.com writes: Hi If I apply the following function to 4 and 6 (defn arith [x y] (map (fn [op] [(op x y) `(~op ~x ~y)]) [+ - / *])) I'd like to get a result of the form ([10 (+ 4 6)] [-2 (- 4 6)] ...) but instead I get something like ([10 (#core$_PLUS_

Re: Resolving vars and quoting

2012-03-15 Thread Tassilo Horn
Tassilo Horn tass...@member.fsf.org writes: As an aside, when playing around with quoting and unquoting, I noticed that the result of ('+ 3 5) is 5. I'm not sure what I would have expected (maybe an error?) but it wasn't the third item of the list. Is there any reason for this? Symbol

Re: A New Core.logic Primer

2012-03-15 Thread Sean Corfield
On Thu, Mar 15, 2012 at 12:21 PM, David Nolen dnolen.li...@gmail.com wrote: It has nothing to do w/ qualified or not qualified, namespaces or anything else. In some programs you may want to freely mix functions and relations. But that's what namespaces are for in Clojure, yes? Seems like this

Re: A New Core.logic Primer

2012-03-15 Thread David Nolen
On Thu, Mar 15, 2012 at 4:28 PM, David Nolen dnolen.li...@gmail.com wrote: On Thu, Mar 15, 2012 at 4:21 PM, Sean Corfield seancorfi...@gmail.comwrote: On Thu, Mar 15, 2012 at 12:21 PM, David Nolen dnolen.li...@gmail.com wrote: It has nothing to do w/ qualified or not qualified, namespaces

Re: A New Core.logic Primer

2012-03-15 Thread Sean Corfield
On Thu, Mar 15, 2012 at 1:28 PM, David Nolen dnolen.li...@gmail.com wrote: On Thu, Mar 15, 2012 at 4:21 PM, Sean Corfield seancorfi...@gmail.com wrote: (require '[clojure.core.logic :as ?]) (?/run [q] ;; instead of run*  (?/cons 1 q (cons 1 [2 3]))) ;; instead of (conso 1 q (cons 1 [2 3]))

Re: A New Core.logic Primer

2012-03-15 Thread Baishampayan Ghose
On Thu, Mar 15, 2012 at 2:04 PM, Sean Corfield seancorfi...@gmail.com wrote: And why is it run* and not run? There is run, but `run` takes an extra argument `n` and will solve for only `n` results while `run*` solves for all. Also, core.logic is essentially a faithful port of miniKanren and

Re: A New Core.logic Primer

2012-03-15 Thread David Nolen
On Thu, Mar 15, 2012 at 5:16 PM, Baishampayan Ghose b.gh...@gmail.comwrote: On Thu, Mar 15, 2012 at 2:04 PM, Sean Corfield seancorfi...@gmail.com wrote: And why is it run* and not run? There is run, but `run` takes an extra argument `n` and will solve for only `n` results while `run*`

Re: A New Core.logic Primer

2012-03-15 Thread Sean Corfield
On Thu, Mar 15, 2012 at 2:16 PM, Baishampayan Ghose b.gh...@gmail.com wrote: There is run, but `run` takes an extra argument `n` and will solve for only `n` results while `run*` solves for all. Ah, OK. That makes sense. Perhaps that could be added to the primer? (just curious: why not run-all?)

Re: A New Core.logic Primer

2012-03-15 Thread David Nolen
On Thu, Mar 15, 2012 at 5:41 PM, Sean Corfield seancorfi...@gmail.comwrote: On Thu, Mar 15, 2012 at 2:16 PM, Baishampayan Ghose b.gh...@gmail.com wrote: There is run, but `run` takes an extra argument `n` and will solve for only `n` results while `run*` solves for all. Ah, OK. That makes

Parallel SSH and system monitoring in Clojure

2012-03-15 Thread Chris McBride
Hi, I releases two simple clojure libraries to help running commands via SSH on multiple servers. Hopefully someone will find it useful. http://info.rjmetrics.com/blog/bid/54114/Parallel-SSH-and-system-monitoring-in-Clojure https://github.com/RJMetrics/Parallel-SSH

Re: A New Core.logic Primer

2012-03-15 Thread Edmund
Righto, I'll add this to the discussion. On Thursday, 15 March 2012 21:53:51 UTC, David Nolen wrote: On Thu, Mar 15, 2012 at 5:41 PM, Sean Corfield seancorfi...@gmail.comwrote: On Thu, Mar 15, 2012 at 2:16 PM, Baishampayan Ghose b.gh...@gmail.com wrote: There is run, but `run` takes an

Re: 'contains?' on 'sorted-set-by' based on the comparator only? (possible bug?)

2012-03-15 Thread Stuart Campbell
Actually, sorted-map-by does behave the same way, but in your example you tried to lookup a value instead of a key: user (def m (sorted-map-by #( (%1 0) (%2 0)) [1 :a] [2 :b])) #'user/m user (get m [1 :foo]) [2 :b] It looks like

Re: Resolving vars and quoting

2012-03-15 Thread Stuart Campbell
Almost, but you do need to resolve the symbols to functions when you evaluate the operation: (defn arith [x y] (map (fn [op] [((resolve op) x y) (list op x y)]) '[+ - / *])) Regards, Stuart On 16 March 2012 02:52, Jack Moffitt j...@metajack.im wrote: If I apply the following function to 4

ANN: core.logic 0.6.8

2012-03-15 Thread David Nolen
It's been a while since we cut a core.logic release. Some small enhancements as well as a bug fix which was affecting Kibit, https://github.com/jonase/kibit/ Cheers, David Enhancments * Allow retraction of facts Fixed * LOGIC-32: fix unification with sets * LOGIC-29: fix defrel bug

Re: 'contains?' on 'sorted-set-by' based on the comparator only? (possible bug?)

2012-03-15 Thread Mark Engelberg
It's not a problem with Clojure, it's also how Java behaves. For sorted-sets to work properly, your comparator *must* satisfy the trichotomy property of orderings. Consider a comparison predicate less?. The trichotomy property states that for all x,y, exactly one of the following hold: (less? x

Re: 'contains?' on 'sorted-set-by' based on the comparator only? (possible bug?)

2012-03-15 Thread Alan Malloy
And this is exactly as it should be. The sorted set has no way to compare items other than by your comparator. If it just arbitrarily decided to use = instead of checking that (zero? (compare x y)) it would not be using your comparator. Note also that the behavior of contains? is consistent with

Re: Which emacs packages?

2012-03-15 Thread jaime
Ha~! :) :) 在 2012年3月13日星期二UTC+8下午12时50分06秒,Cedric Greevey写道: On Mon, Mar 12, 2012 at 11:09 PM, jaime xiejianm...@gmail.com wrote: Is there any materials to introduce how to setup emacs env for a beginner? Yes, this single word: Don't. :) -- You received this message because you

Re: ANN: core.logic 0.6.8

2012-03-15 Thread Ambrose Bonnaire-Sergeant
Thanks David, and Jonas! Ambrose On Fri, Mar 16, 2012 at 7:30 AM, David Nolen dnolen.li...@gmail.com wrote: It's been a while since we cut a core.logic release. Some small enhancements as well as a bug fix which was affecting Kibit, https://github.com/jonase/kibit/ Cheers, David

Re: Parallel SSH and system monitoring in Clojure

2012-03-15 Thread dennis zhuang
There is a clojure-control: https://github.com/killme2008/clojure-control 2012/3/16 Chris McBride cmm7...@gmail.com Hi, I releases two simple clojure libraries to help running commands via SSH on multiple servers. Hopefully someone will find it useful.

Re: [ANN] clojure-scheme - Compiling Clojure to Scheme to C

2012-03-15 Thread Ambrose Bonnaire-Sergeant
Wow, nice work Nathan! Ambrose On Thu, Mar 15, 2012 at 5:08 AM, Nathan Sorenson n...@sfu.ca wrote: I've modified the output of the ClojureScript compiler to emit Scheme code. At this point the core library is successfully compiled by Gambit Scheme. A nice advantage of this is that Gambit