Re: Radically simplified Emacs and SLIME setup

2011-05-30 Thread László Török
Then you might wanna double check whether you have the latest version (of emacs-starter-kit), as it worked for me with a week old snapshot. (Im on Mac, running Aquamacs). 2011/5/30 Mark Engelberg mark.engelb...@gmail.com On Sun, May 29, 2011 at 10:06 PM, László Török ltoro...@gmail.com wrote:

Aw: Odd error using CCW.

2011-05-30 Thread Meikel Brandmeyer
Hi, you might want to ask this on the counterclockwise mailing list: https://groups.google.com/forum/#!forum/clojuredev-devel That help Laurent to keep track of such issues. Sincerely Meikel -- You received this message because you are subscribed to the Google Groups Clojure group. To post

Protocol issues

2011-05-30 Thread Andreas Kostler
Hi all, I have two clj files with two namespaces: a.clj (ns a) (defrecord A [a b]) b.clj (ns b (:import [a A])) (defprotocol Foo (bar [s])) (extend-type A Foo (bar [s] (println s))) (def x (A. 1 2)) (bar x) Throws: No single method: bar of interface: b.Foo found for function: bar

Re: Odd error using CCW.

2011-05-30 Thread Laurent PETIT
Hi Ken, 2011/5/30 Ken Wesson kwess...@gmail.com: I get the following in problems in CCW when opening a particular Clojure project: Unable to resolve symbol: = in this context     sandbox.clj /sandbox/src     line 1     Clojure Compilation Problem The line in question is just this: (ns

Aw: Protocol issues

2011-05-30 Thread Meikel Brandmeyer
Hi, works for me in 1.2.0 and 1.3.0-alpha7. You might want to add a (:require a) to the import, but I doubt that this is the cause of the problem. Sincerely Meikel -- You received this message because you are subscribed to the Google Groups Clojure group. To post to this group, send email to

Re: Aw: Protocol issues

2011-05-30 Thread Andreas Kostler
My bad, I'm calling foo in yet another namespace: (ns c (:use b)) (def x (A. 1 2)) (bar x) and that's when I get: Throws: No single method: bar of interface: b.Foo found for function: bar of protocol: Foo [Thrown class java.lang.IllegalArgumentException] Cheers Andreas On 30/05/2011, at

Aw: Re: Aw: Protocol issues

2011-05-30 Thread Meikel Brandmeyer
Hi, still works for me, although your c has a missing (:import a.A). Would you mind posting the actual code with the true types stripped-down to the minimum? Or some other minimal example, which verifyably fails for you? Sincerely Meikel -- You received this message because you are

Re: :gen-class possibly missing a compile time check when extending abstract classes that implement interfaces

2011-05-30 Thread ckirkendall
I added an explanation of this a comment to the documentation on http://clojuredocs.org On May 29, 3:01 pm, Sean Corfield seancorfi...@gmail.com wrote: I also ran into this recently - doing the exact same thing (a log4j appender). I was a bit surprised and I wonder if Clojure is effectively

Re: :gen-class possibly missing a compile time check when extending abstract classes that implement interfaces

2011-05-30 Thread Armando Blancas
I was a bit surprised and I wonder if Clojure is effectively generating abstract classes rather than concrete classes? (Do we have no way to specify the difference? Is that only an artifact of the Java compiler, not the JVM bytecode?) I don't think Clojure will generate abstract classes; the

Aw: :gen-class possibly missing a compile time check when extending abstract classes that implement interfaces

2011-05-30 Thread Meikel Brandmeyer
Hi, I think, clojure just generates a class with stubs for all methods, which check whether an implementing function exists. If yes, they call it. If no, they pass on to super. If there is no such method in super, they throw a reasonable exception. Eg. I get the following for a class

Re: difference between Composite Form Special Form

2011-05-30 Thread Ken Wesson
On Mon, May 30, 2011 at 12:47 AM, iamcreasy quazir...@gmail.com wrote: Sort of. You can create a macro with defmacro, which like a special form controls the evaluation of its arguments instead of the arguments being evaluated first and the function only getting the results. Things like - and

Re: :gen-class possibly missing a compile time check when extending abstract classes that implement interfaces

2011-05-30 Thread ckirkendall
I disagree currently this is a compile time checks provided by javac. On May 30, 11:42 am, Meikel Brandmeyer m...@kotka.de wrote: Hi, I think, clojure just generates a class with stubs for all methods, which check whether an implementing function exists. If yes, they call it. If no, they

Re: Radically simplified Emacs and SLIME setup

2011-05-30 Thread Mark Engelberg
Has anyone tried this on Windows? I reinstalled emacs-starter-kit, then reinstalled clojure-mode. I downloaded the latest version of lein, and created a completely fresh new project. Then, I did lein plugin install swank-clojure 1.3.1. I opened up the core.clj from the newly created project in

Advanced keyword function

2011-05-30 Thread msappler
Hey, I developed a macro called defnks. I wrote a blogpost about it here: http://resatori.com/advanced-keyword-function You can look at the code here: https://gist.github.com/999256 --- It works like clojure.contrib.def/defnk but also asserting obligatory optional keys and being able to

Small Problem: Which Strings Differ at One Location

2011-05-30 Thread joshua-choi
Let's say that I have a set of strings, each three English letters long. How can I determine which strings differ only at one location (e.g. xxe and xbe)? Right now, I'm writing a loop that sequentially compares every string to every other string. I think that there's a better way, but I don't

Re: Clojure Editor

2011-05-30 Thread Shree Mulay
Well, my os crashed, and after a clean install was finally able to get Bluefish to work on Win7-64x. I'm happy that I was able to get a simple, stand alone ide that supports clojure to FINALLY work. Before this, I have been using geany and notepad++ interchangeably - but without clojure

Re: Small Problem: Which Strings Differ at One Location

2011-05-30 Thread Laurent PETIT
Hi, there's the levenshtein distance algorithm which will help you determine which string is one edit close to another (since all your strings are of length 3, then the distance will inevitably be a single replacement if of size one). Don't know if that helps, anyway here's a compact functional

Re: Small Problem: Which Strings Differ at One Location

2011-05-30 Thread joshua-choi
Thanks for the reply. Levenshtein distance would be especially useful for when I need to compare general strings, with a general amount of edits between them. Unfortunately, the problem isn't so much determining whether any two strings are one edit apart: that can be done just by checking if the

Re: Small Problem: Which Strings Differ at One Location

2011-05-30 Thread Jonathan Fischer Friberg
There is clj-diff for levenshtein and standard diff: https://github.com/brentonashworth/clj-diff Jonathan On Mon, May 30, 2011 at 10:19 PM, joshua-choi rbysam...@gmail.com wrote: Thanks for the reply. Levenshtein distance would be especially useful for when I need to compare general strings,

Re: Small Problem: Which Strings Differ at One Location

2011-05-30 Thread Michael Wood
On 30 May 2011 22:19, joshua-choi rbysam...@gmail.com wrote: Thanks for the reply. Levenshtein distance would be especially useful for when I need to compare general strings, with a general amount of edits between them. Unfortunately, the problem isn't so much determining whether any two

Re: Small Problem: Which Strings Differ at One Location

2011-05-30 Thread Ken Wesson
There's no really easy way to avoid O(n^2) comparison when you want to check everything against everything else in some set. One efficiency that halves the size of the job (but does not reduce big-O) is to check only against the later items: (defn pairs-off-one [strs] (let [istrs (map-indexed

Re: Idiomatic use of records vs. maps

2011-05-30 Thread James Reeves
On 30 May 2011 02:02, Ken Wesson kwess...@gmail.com wrote: I don't think either is non-idiomatic, but I'd probably just use the map. It's shorter and simpler code, more widely interoperable with other Clojure facilities, and the member access speedup using a record is unlikely to matter much

Re: Small Problem: Which Strings Differ at One Location

2011-05-30 Thread Jonathan Fischer Friberg
I got an idea which probably doesn't perform very well although I found it a little interesting. https://gist.github.com/999430 It simply groups the strings together, saying: * if the first and second characters are the same, they only differ in one position. * if the second and last characters

Re: Small Problem: Which Strings Differ at One Location

2011-05-30 Thread Ken Wesson
On Mon, May 30, 2011 at 4:58 PM, Jonathan Fischer Friberg odysso...@gmail.com wrote: I got an idea which probably doesn't perform very well although I found it a little interesting. https://gist.github.com/999430 It simply groups the strings together, saying: * if the first and second

Re: Radically simplified Emacs and SLIME setup

2011-05-30 Thread Phil Hagelberg
On May 30, 11:26 am, Mark Engelberg mark.engelb...@gmail.com wrote: Has anyone tried this on Windows? I actually just got a bug report a few days ago with a fix for Windows compatibility. I just pushed out a 1.9.2 release that includes that fix. So if you M-x package-install clojure-mode again

Re: Small Problem: Which Strings Differ at One Location

2011-05-30 Thread Ken Wesson
On Mon, May 30, 2011 at 5:19 PM, Ken Wesson kwess...@gmail.com wrote: Elapsed time: 53.93484 msecs nil As you can see, the loop/primitive/type-hinted version is ~20x faster; however, it is not lazy and might blow the heap with enough pairs of off-by-one strings in a big enough input seq.

Re: Small Problem: Which Strings Differ at One Location

2011-05-30 Thread David Sletten
On May 30, 2011, at 3:55 PM, joshua-choi wrote: Let's say that I have a set of strings, each three English letters long. How can I determine which strings differ only at one location (e.g. xxe and xbe)? Right now, I'm writing a loop that sequentially compares every string to every

Re: Aw: Re: Aw: Protocol issues

2011-05-30 Thread Andreas Kostler
Meikel, Adding import A to ns c did the trick! Thanks a lot. Andreas On 30/05/2011, at 10:42 PM, Meikel Brandmeyer wrote: Hi, still works for me, although your c has a missing (:import a.A). Would you mind posting the actual code with the true types stripped-down to the minimum? Or

Re: Radically simplified Emacs and SLIME setup

2011-05-30 Thread Mark Engelberg
The package installer saw the 1.9.2 release, which I installed. I'm still getting the cannot find the path specified error though. Thanks for all the help you all have provided so far; let me know if you have any other ideas for me to try. Thanks, Mark -- You received this message because

Re: Small Problem: Which Strings Differ at One Location

2011-05-30 Thread Arnoldo Muller
Have you considered sorting different permutations of your strings and then perform binary search on them? This paper talks about the technique: http://portal.acm.org/citation.cfm?id=1242592 On May 30, 9:55 pm, joshua-choi rbysam...@gmail.com wrote: Let's say that I have a set of strings,

Re: swank-clj 0.1.0 - a refactored swank-clojure, with sldb support

2011-05-30 Thread George Jahad
Just to clarify, there is an older GUD based front end to cdt, but swank-cdt, the one that I integrated with swank-clojure a few months ago, uses sldb. On May 23, 5:23 am, Hugo Duncan duncan.h...@gmail.com wrote: On Sun, 22 May 2011 16:59:24 -0400, Sam Aaron samaa...@gmail.com wrote: Very

Fwd: Can't start Remote unmanaged REPL

2011-05-30 Thread Bruce Fancher
Apologies for sending this to the general clojure list, but I've already tried and failed (twice) to get a response from the enclojure list and I thought that maybe someone here might be able to help. The answer (if there is one) might also be of general interest to people looking for remote

using reduce instead of loop recur

2011-05-30 Thread iz bash
so clojures like my first programming language. most of the time now ,i use map /reduce/.. with lazy sequences but sometimes i just cant seem to find a solution other than using loop-recur. then i read somewhere almost all loop recur situations can be translated into reduce. so ive posted a

Re: Radically simplified Emacs and SLIME setup

2011-05-30 Thread J.R. Garcia
Having worked with Lisp in the path, I didn't get that interactive feel with VimClojure. I didn't really enjoy using Nailgun either. That being said, VimClojure is certainly a great plugin. I also have been wanting to get used to the keybindings for emacs because of my daily work. I have to use

Re: Radically simplified Emacs and SLIME setup

2011-05-30 Thread Joop Kiefte
And Emacs has Viper-mode (and other Vi-keybinding-stuff) :) 2011/5/30 J.R. Garcia mrjohngar...@gmail.com: Having worked with Lisp in the path, I didn't get that interactive feel with VimClojure. I didn't really enjoy using Nailgun either. That being said, VimClojure is certainly a great

Re: using reduce instead of loop recur

2011-05-30 Thread Ken Wesson
On Mon, May 30, 2011 at 6:15 PM, iz bash killernemesisbl...@gmail.com wrote: so clojures like my first programming language. most of the time now ,i use map /reduce/.. with lazy sequences  but sometimes i just cant seem to find a solution other than using loop-recur. then i read somewhere

Re: using reduce instead of loop recur

2011-05-30 Thread Alan Malloy
On May 30, 7:56 pm, Ken Wesson kwess...@gmail.com wrote: On Mon, May 30, 2011 at 6:15 PM, iz bash killernemesisbl...@gmail.com wrote: so clojures like my first programming language. most of the time now ,i use map /reduce/.. with lazy sequences  but sometimes i just cant seem to find a

Re: using reduce instead of loop recur

2011-05-30 Thread Ken Wesson
On Mon, May 30, 2011 at 11:29 PM, Alan Malloy a...@malloys.org wrote: (filter identity (map f xs)) is more clearly written as (keep f xs), unless you're relying on the former to retain false (not nil) elements. Eh -- filter identity doesn't retain false: = (filter identity [false nil 42 foo