Re: Can't build clojure cloned from github - 2 tests failed - when running from cygwin

2011-11-23 Thread Michael Jaaka
Here is a diff of fix http://pastebin.com/KE6U3Pqb On Nov 23, 12:13 am, Michael Jaaka michael.ja...@googlemail.com wrote: Well, it is easy to break tests on any system. All you need to do is to put space into file name path. For example in clojure https://github.com/clojure/clojure /

Re: Literate Programming in Emacs?

2011-11-23 Thread ck
Andrew: Make sure you have (require 'ob-clojure) in your controlling emacs file (mine is username.el). -ck On Nov 23, 12:00 pm, Andrew ache...@gmail.com wrote: Here's my attempt at following the steps athttp://orgmode.org/worg/org-contrib/babel/languages/ob-doc-clojure.html. *The

Re: Literate Programming in Emacs?

2011-11-23 Thread Andrew
Thanks! Next step: org-babel-execute:clojure:Cannot open load file: swank-clojure ... -- 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

Re: use namespace locally in a function

2011-11-23 Thread Nils Bertschinger
Clojure is a Lisp, so it should be possible to extend it yourself ... What about something like this? (defmacro locally-using Allows to use symbols from other namespace in the local scope of the macro body. Syntax: (locally-using [symbol*] :from namespace body) [symbols from ns-name

Re: deprecating butlast?

2011-11-23 Thread Nils Bertschinger
Hi, you're right that drop-last is more general than butlast. So why does butlast exist at all? I would say, that it is there for a very good reasons. It solves a common problem, namely to drop the last element of a sequence and reads better in this case than the equivalent idiom using drop-last.

[core.logic] Incorporating a database as a source of facts

2011-11-23 Thread Mark
I'd like to incorporate a relational database as a source of facts into the core.logic fact system. Several years ago, I worked with a Java backwards reasoning system called Mandarax (http://mandarax.sourceforge.net/) which defined an interface between the logic engine and a fact store. The

Re: [core.logic] Incorporating a database as a source of facts

2011-11-23 Thread David Nolen
Sounds interesting. I can't offer much guidance on how to build such a system but I'm certainly interested in improvements to core.logic's interface to make implementing such things simpler. What exactly do you expect core.logic to do in this case? David On Wed, Nov 23, 2011 at 5:52 PM, Mark

Re: [core.logic] Incorporating a database as a source of facts

2011-11-23 Thread Mark
Let's take a specific example: Suppose I have a Person table with id, name and gender columns. Then, I have a Parent-Child table that contains two id columns, both of which are foreign keys back into the Person table. I'd could use the logic system to define a set of rules about family

Re: [core.logic] Incorporating a database as a source of facts

2011-11-23 Thread Mark
It occurs to me I may not have fully answered your question. I'd like core.logic to supply a set on constraints which my code would convert into a SELECT statement and then return a seq of something (vectors? maps? facts?) that the engine would then use to reason, potentially driving

Clojure 1.3.0 and reduce order of evaluation

2011-11-23 Thread James Reeves
Hi folks, I've just noticed that the evaluation order for reduce differs slight between Clojure 1.2.1 and 1.3.0. If you have a lazy seq xs, (b c d ...) and an expression (reduce f a xs), then the initial evaluation order in 1.2.1 is what you'd expect: a, b, (f a b) But in 1.3.0, it's slightly

Re: [core.logic] Incorporating a database as a source of facts

2011-11-23 Thread David Nolen
Seems possible but I can't say much more than that. core.logic operates on tuples, so you could extract the resultset form the DB and pass them along to core.logic to constrain further without much difficulty. David On Wed, Nov 23, 2011 at 6:24 PM, Mark markaddle...@gmail.com wrote: It occurs

Re: [core.logic] Incorporating a database as a source of facts

2011-11-23 Thread Mark
Cool! I'll keep an eye out for the update. Thanks -- 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

Re: Clojure 1.3.0 and reduce order of evaluation

2011-11-23 Thread Kevin Downey
On Wed, Nov 23, 2011 at 3:33 PM, James Reeves jree...@weavejester.com wrote: Hi folks, I've just noticed that the evaluation order for reduce differs slight between Clojure 1.2.1 and 1.3.0. If you have a lazy seq xs, (b c d ...) and an expression (reduce f a xs), then the initial evaluation

Lookup on a symbol?

2011-11-23 Thread Sean Corfield
@lloyda2 posted on Twitter: (reduce 'and '(false true)) = true ...Huh? I must admit, it looked odd to me... but I realized (after some REPL experimentation) this seems to be equivalent to ('some-symbol :some-key :some-default) and that attempts (and fails) to somehow lookup :some-key in

Re: Lookup on a symbol?

2011-11-23 Thread Alan Malloy
Other way round. It behaves like a keyword, looking itself up in a map: ('x '{x 1 y 2}) yields 2. You see the same behavior with (reduce :and [5 10]), yielding 10. On Nov 23, 9:32 pm, Sean Corfield seancorfi...@gmail.com wrote: @lloyda2 posted on Twitter: (reduce 'and '(false true)) = true

Re: use namespace locally in a function

2011-11-23 Thread Igor TN
Nils, thanks for the insight! I am relatively new to Lisps and your comment is worth analyzing. - Igor On Nov 23, 5:27 pm, Nils Bertschinger nils.bertschin...@googlemail.com wrote: Clojure is a Lisp, so it should be possible to extend it yourself ... What about something like this? (defmacro

Re: Lookup on a symbol?

2011-11-23 Thread Sean Corfield
On Wed, Nov 23, 2011 at 9:48 PM, Alan Malloy a...@malloys.org wrote: Other way round. It behaves like a keyword, looking itself up in a map: ('x '{x 1 y 2}) yields 2. You see the same behavior with (reduce :and [5 10]), yielding 10. Ah... I didn't realize that the lookup could be done without