On May 30, 6:15 pm, iz bash wrote:
> how'd you implement it using only higher order functions?
> (rem-dup " bb cc") => [\a \a \a \a \space \b \b
> \space \c \c]
(defn rem-dup [stri]
(->> stri
(partition-all 2 1)
(filter (partial apply not= \space))
(map fir
On Mon, May 30, 2011 at 11:29 PM, Alan Malloy 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" []])
(42 "foo"
On May 30, 7:56 pm, Ken Wesson wrote:
> On Mon, May 30, 2011 at 6:15 PM, iz bash 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
On Mon, May 30, 2011 at 6:15 PM, iz bash 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 almost all loop recur situati
And Emacs has Viper-mode (and other Vi-keybinding-stuff) :)
2011/5/30 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
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 V
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 functi
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 RE
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" wrote:
> On Sun, 22 May 2011 16:59:24 -0400, Sam Aaron wrote:
> > Very cool!
>
> Thanks.
>
> > Out of interes
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 wrote:
> Let's say that I have a set of strings, each three English le
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 y
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
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
On Mon, May 30, 2011 at 5:19 PM, Ken Wesson 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. Both versions
On May 30, 11:26 am, Mark Engelberg 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 you should pull
it in. He
On Mon, May 30, 2011 at 4:58 PM, Jonathan Fischer Friberg
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 characters are the
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 .
On 30 May 2011 02:02, Ken Wesson 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 in code that is
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 ve
On 30 May 2011 22:19, joshua-choi 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
> strings are one e
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 wrote:
> Thanks for the reply. Levenshtein distance would be especially useful
> for when I need to compare general strings, with a general amo
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
f
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
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 support
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'
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 inp
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 e
I disagree currently this is a compile time checks provided by
javac.
On May 30, 11:42 am, Meikel Brandmeyer 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 pass on to s
On Mon, May 30, 2011 at 12:47 AM, iamcreasy 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 defn are mac
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 implementi
> 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; t
I added an explanation of this a comment to the documentation on
http://clojuredocs.org
On May 29, 3:01 pm, Sean Corfield 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 generating abstract cl
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 subscribed
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 10:
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
Hi Ken,
2011/5/30 Ken Wesson :
> 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 sandbox)
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 of
37 matches
Mail list logo