Announcing KR v1.4.2 :: RDF and SPARQL support using clojure data / interfaces

2012-06-14 Thread Kevin Livingston
Hello everyone, I just wanted to announce the open-sourcing of a RDF and SPARQL (and more) library that has been under development and use for quite a while in our lab. It supports the use of clojure symbols and lists as rdf resources and triples, and it can form triple patterns into sparql qu

clojure.core.unify and exceptions

2012-06-06 Thread Kevin Livingston
I was surprised to find that clojure.core.unify returns an exception when something does not unify rather than something like nil (false) when they don't. If you always expect something to unify, I guess sure, but a very standard use of a unifier is to test if two things unify or not, where it's a

Re: Addition of new a priori distinct element to a vector

2011-09-22 Thread Kevin Livingston
what's the actual use case where you want this? it seems pretty weird just on it's own. it may in practice be more clever than other solutions, but that's not clear yet. if you just want a unique symbol there's (gensym) regarding vectors, I found this a helpful read a while back, it's a few yea

Re: Spread work onto multiple threads (in pure Clojure)

2011-09-22 Thread Kevin Livingston
if the list is quite large, is there anything preventing the option below from creating way too many threads? there is presumably an inflection point where this will cost you. pmap is trying to keep that in check, right? Kevin On Sep 21, 5:28 pm, Nathan Sorenson wrote: > Futures begin executing

emacs clojure.test and unmatched delimiter error

2011-09-22 Thread Kevin Livingston
I have some code in a test ns that uses clojure.test. When I open that code in emacs (with a slime connection) I get a slime error: "Unmatched delimiter: )" except my code is balanced just fine as far as I can tell. the tests all run just fine with maven, everything compiles. it's just emacs an

emacs clojure.test and unmatched delimiter error

2011-09-22 Thread Kevin Livingston
I have some code in a test ns that uses clojure.test. When I open that code in emacs (with a slime connection) I get a slime error: "Unmatched delimiter: )" except my code is balanced just fine as far as I can tell. the tests all run just fine with maven, everything compiles. it's just emacs an

Re: defining tests for an api to be called by the implementations

2011-08-16 Thread Kevin Livingston
were in scope in the pom running my repl, but not in the one running the test. lesson learned. Kevin On Aug 15, 11:31 pm, Alan Malloy wrote: > On Aug 15, 10:16 pm, Kevin Livingston > > > > > > > > > > wrote: > > I am working on an api that has an interfa

Re: Problem with Greeks!

2011-08-16 Thread Kevin Livingston
I don't know about the clojure compiler. But we've run into some issues with the java compiler. There are flags to inform it what file encodings are being used in a file. For example, http://java.sun.com/javase/technologies/core/basic/intl/faq.jsp#set-default-locale Java will make assumptions

defining tests for an api to be called by the implementations

2011-08-15 Thread Kevin Livingston
I am working on an api that has an interface and two distinct implementations lets call them: foo and bar. I have a testing routine with a bunch of functions that each call a function to get a clean instance of an implementation, initializes it with some data and then interrogate it. with the exc

Re: Managing the classpath

2010-07-01 Thread Kevin Livingston
> If you have a directory containing Clojure a source code tree for LibA > on the classpath for ProjB then you should be able to replace the > files without changing any classpath. right, I've just been trying to figure out how to do that in Maven when LibA and ProjB are separate projects (with se

Re: Managing the classpath

2010-07-01 Thread Kevin Livingston
Some of the build tools like Maven can help a lot. However, one different/related issue I have is when I have multiple projects I am developing, say a library, LibA, and a project that uses it ProjB, if I want to co-develop them, it can get a little hairy, and I haven't figured out the solution...

Re: getting compiler-like meta data from read

2010-04-21 Thread Kevin Livingston
Thank you the LineNumberingPushbackReader is exactly what is needed. The other metadata I can add fairly straightforwardly so good, this is *far* more sane than that monstrosity I conjured up. Kevin On Apr 20, 3:15 am, Ilia Ablamonov wrote: > I've encountered the same problem (as far as I unde

Re: request for comments/code-review - clojure implementation of unifier

2010-04-21 Thread Kevin Livingston
Thank you for taking the time to provide feedback. > I can't think of a direct equivalent now, but it's straightforward > enough to supply your own equivalent, like my compound? function > (basically #(and (seq? %) (seq %))). This won't work on arrays and > other things which seq can operate upon,

Re: Coordinated, asynchronous modification of state?

2010-04-21 Thread Kevin Livingston
What you are talking about is commonly referred to as a "barrier" in parallel processing. All processes coordinated on a given barrier must each reach the barrier before any one may cross it. Simply putting a barrier check into the message queue of an Clojure agent would not be sufficient as I un

default maps with the :or keyword in parameters - bug? / feature request

2010-04-20 Thread Kevin Livingston
So it would strike me that with-defaults-bad (below) is a fairly straightforward way of using destructuring in Clojure yet it can't be done, instead of passing the same map in that's being destrucured you need a new "type" that has keys being the variable names instead of keys being keywords... it

Re: clojure unifier (also other symbolic reasoning support including rdf/owl/etc. ?)

2010-04-20 Thread Kevin Livingston
Thanks Jim, I'll definitely keep this in mind, I appreciate it. This seems mostly like a tool for constraint satisfaction, which I've been keeping my eyes on, but don't use as much as more 'open world' reasoning, back-chaining, and pattern matching etc. (which is why I was looking for a unifier)

Re: getting compiler-like meta data from read

2010-04-19 Thread Kevin Livingston
erify-name (struct-map rule ~...@params))) > >     ;; gets the metatdata from the var, but changes :name to rule's > > name > >     (let [reg-r# (with-meta r# (assoc (meta (var r#)) :name (:name > > r#)))] > >       (register-rule reg-r#) > >       re

Re: getting compiler-like meta data from read

2010-04-19 Thread Kevin Livingston
fy-name (struct-map rule ~...@params))) ;; gets the metatdata from the var, but changes :name to rule's name (let [reg-r# (with-meta r# (assoc (meta (var r#)) :name (:name r#)))] (register-rule reg-r#) reg-r#))) On Apr 17, 10:48 am, Per Vognsen wrote: > On Sat, Apr 17, 2

request for comments/code-review - clojure implementation of unifier

2010-04-19 Thread Kevin Livingston
I ported the unifier posted by Norvig in Common Lisp to Clojure... original lisp here: http://norvig.com/paip/unify.lisp from the paip directory it also uses code in patmatch and auxfns files. this revealed some things that I don't particularly care for in Clojure, and some things I'm clearly uns

clojure unifier (also other symbolic reasoning support including rdf/owl/etc. ?)

2010-04-19 Thread Kevin Livingston
does anyone have a clojure implementation of a unifier, eg. something that does this: http://norvig.com/paip/unify.lisp if not I'll do it, but just thought I'd grab it quick if it was out there. and any other good resources for symbolic reasoning? I've been looking but haven't seen much that is

getting compiler-like meta data from read

2010-04-17 Thread Kevin Livingston
I have an application that will read in a large number of structures from a file. those structures will be used throughout the application to produce additional data etc. since they are "user" configurable, it would be nice to know where they come from should one of them start misbehaving. the t

Re: multi project / multi library simultaneous development - best practice?

2010-04-14 Thread Kevin Livingston
Phil Hagelberg wrote: > On Wed, Apr 14, 2010 at 11:46 AM, Kevin Livingston > > wrote: > > My concern with the Maven and Leiningen approaches for active > > development is that they don't seem to allow for trivial co- > > development of libraries and projects

multi project / multi library simultaneous development - best practice?

2010-04-14 Thread Kevin Livingston
I have been reading through the newsgroup on how to set up and maintain a build/development environment for a large set of projects. Coming from a CommonLisp world of maintaining/developing multiple projects and libraries concurrently, the approach put forward in this post resonates well. http://g