Re: Literate Programming in org-babel (ob-clojure.el) is broken under nrepl.el

2012-09-07 Thread lambdatronic
Thanks, Tim. This looks great. For those of you who don't want to go digging through the thread, here's the summary: Step 1. Download nrepl-0.1.4-preview from Marmalade or MELPA (depends on clojure-mode 1.11). Step 2. Add this code to your .emacs file: ;; Patch ob-clojure to work with nrepl

Literate Programming in org-babel (ob-clojure.el) is broken under nrepl.el

2012-09-06 Thread lambdatronic
For those people (like myself) who do a lot of Literate Programming in Emacs using Clojure and org-babel, migrating to nrepl and nrepl.el is somewhat non-trivial. This is because the existing Clojure support in org-babel (ob-clojure.el) relies on slime and swank-clojure when running

Re: Overtone - Live @ Arnolfini

2012-08-08 Thread lambdatronic
Eppccc!! On Friday, August 3, 2012 6:47:50 AM UTC-4, Sam Aaron wrote: Hi everyone, for those interested, I just put up a screencast of a performance I did with Overtone on Friday the 27th of July at the Arnolfini art gallery in Bristol, UK:

Re: defmulti and defmethods in separate namespaces without circular references?

2012-03-02 Thread lambdatronic
I built a modeling system that uses the multi-method namespace separation you are talking about. The solution that I use simply leverages the difference between require, use, and refer. In each namespace that implements the multi-method, put (refer 'parent) after the ns form. In the parent

Re: setting the classpath in cake+slime (was Re: Screencast: Clojure + Emacs + slime + swank + cake + Overtone)

2011-06-26 Thread lambdatronic
The classpath is specified in the lein and cake scripts respectively. lein is a shell script, and cake is a ruby script, so pop them open in your favorite text editor and take a look. ~Gary On Jun 24, 4:56 pm, Lee Spector lspec...@hampshire.edu wrote: Oops: Ignore my last BTW -- now load

Re: setting the classpath in cake+slime (was Re: Screencast: Clojure + Emacs + slime + swank + cake + Overtone)

2011-06-24 Thread lambdatronic
The way that cake and lein behave is generally this: 1) Search up the file tree starting from the directory in which cake or lein is called until a project.clj file is encountered. Consider this to be the project root. 2) Start a JVM in this directory with the classpath set to contain any files

Re: Screencast: Clojure + Emacs + slime + swank + cake + Overtone

2011-06-23 Thread lambdatronic
Lee, You're just making a simple typo. To get the REPL to switch to the source file's namespace, you have several options: 1) With the point in the source file, press C-c M-p ENTER 2) With the point in the REPL, type ,in ENTER overtoneproject.core ENTER 3) With the point in the REPL,

Re: map

2011-06-17 Thread lambdatronic
I just have to add that your code is really not idiomatic for Clojure. The do is not required here because there is an implicit do around the body of every fn (including one created with defn). Also, it's somewhat bad form to vertically align parentheses in Lisps. Finally, if you want to place

Re: Modelling complex data structures (graphs and trees for example)

2011-06-16 Thread lambdatronic
My 2c: Regarding learning how to model a complex data structure in a functional paradigm: I can think of few resources which sum up the proper mindset you need to get into better than the canonical Clojure essay on state and identity, found here: http://clojure.org/state Regarding how

Re: mapmap

2009-12-29 Thread lambdatronic
I've been using a number of similar functions in my own coding. This was my approach. (defn seq2map Constructs a map from a sequence by applying keyvalfn to each element of the sequence. keyvalfn should return a pair [key val] to be added to the map for each input sequence element.

Re: Mapping OOPS concepts to Clojure? Doable or Wrong thinking?

2009-12-14 Thread lambdatronic
Umm mbrodersen...I believe Laurent was merely pointing out that you can accomplish everything you did with your macros with regular functions. The functions are actually shorter and clearer to read than the macros as well. That is a pretty clear abuse of macros. The only thing macros do here is

Re: Idiomatic way to return the key of a map, which matches a vector containing a search value.

2009-12-12 Thread lambdatronic
This shaves 7 characters off Sean's solution and short circuits just as fast: (some #(and (some #{rabble} (val %)) (key %)) players) Happy hacking! On Dec 10, 3:29 pm, Sean Devlin francoisdev...@gmail.com wrote: Oops!  Slight mistake (ffirst (filter (comp (partial some #{rabble}) val)