Hi,
Am 19.07.2009 um 06:06 schrieb Rowdy Rednose:
(defn db-push
([key val] (db-push key val *default-db*))
([key val db]
(swap! db assoc key (cons val (@db key)
But I think it's broken in the face of concurrency, as I capture the
value of @db at the time of the call to the function s
Hi,
Am 19.07.2009 um 01:20 schrieb James Reeves:
You should fine that indentation is messed up. I suspect this is
because the GetClojureIndentWorker function in indent/clojure.vim uses
"normal w" amongst other commands. Anyone who has altered keys like w
or l from their default bindings will ru
On Jul 19, 12:53 pm, Richard Newman wrote:
> > * Can the body of the db-push function be simplified?
>
> I think so. Untested:
>
> (defn db-push
> ([key val] (db-push key val *default-db*))
> ([key val db]
> (swap! db assoc key (cons val (db key))
If I add an @ it runs:
(defn db-pu
Jeff Brown has released a clojure plugin for grails.
http://grails.org/plugin/clojure
So you can now write clojure code in grails app.
--
Omnem crede diem tibi diluxisse supremum.
--~--~-~--~~~---~--~~
You received this message because you are subscribed to t
> * Is "function overloading" the idiomatic way to implement default
> params in clojure?
Typically, I think so. You could also use multimethods, but that might
be unnecessary flexibility.
Another approach is to emulate keyword arguments:
(defn foo [x y & args]
(let [{:keys [baz bar]} (app
Hi all,
in my quest to learn clojure (and lisp in general), I'm currently
trying to translate some the "On Lisp" code to clojure.
The first couple of functions and macros in Chapter 19 "A Query
Compiler" read:
(defun make-db (&optional (size 100))
(make-hash-table :size size))
(defvar *defau
As I said, the example was stripped down for simplicity, and that
simple version doesn't make much sense other than for communicating my
problem.
My real val-fn is not a map, it's indeed a couple of functions,
applied to some data that's passed in. But the result of that acts
like a map: it retur
On Jul 18, 6:47 pm, Meikel Brandmeyer wrote:
> I don't see this here.
>
> Which vim are you using?
> Which VimClojure?
> Does it happen also in a different file?
> Can you send me an example file where this happens?
I cleared down my Vim settings back to the defaults, and indentation
started wor
> Is this just me, or does anyone else have this issue?
I haven't had your exact problem, but sometimes it seems to
incorrectly maintain depth at the top level, so I'll end up with
something like
(defn foo [x y]
...)
(defn bar [a]
...)
(defn baz [...]
...)
| < cursor goe
Hi Jarkko,
Am 18.07.2009 um 22:02 schrieb Jarkko Oranen:
That looks a lot like map destructuring, though:
(let [{:keys [a b c]} {:a 1 :b 2 :c 3}]
(list a b c))
-> (1 2 3)
Yes. But val-fn might also be exactly that: a function
which gets the value by some others means than
a map. I'm not su
> user=> (macroexpand-1 '(let-coll [a b c] {:a 1 :b 2 :c 3} (println a b
> c)))
> (clojure.core/let [val-fn__23 {:a 1, :b 2, :c 3}
> a (val-fn__23 :a)
> b (val-fn__23 :b)
> c (val-fn__23 :c)]
> (println a
Hi Tim,
the issue is already in the tracker:
http://www.assembla.com/spaces/clojure/tickets/31
Sincerely
Meikel
smime.p7s
Description: S/MIME cryptographic signature
Hi, Tim,
I'm not 100% certain what is going on here, but I do know that, in
general, binding and loop/recur should not be mixed.
"recur" is not true recursion -- it's more like a GOTO. The "binding"
macro establishes thread-local bindings using the static methods
clojure.lang.Var/pushThreadBind
Hi Rowdy,
Am 18.07.2009 um 20:35 schrieb Rowdy Rednose:
your negative answer actually helped me analyze my problem better and
get the distinction run time / expansion time straight. I figured that
the names of the bindings are already there at expansion time and it's
only the values that I need
Thanks Meikel,
your negative answer actually helped me analyze my problem better and
get the distinction run time / expansion time straight. I figured that
the names of the bindings are already there at expansion time and it's
only the values that I need to retrieve at run time.
So this version
Hi,
Am 18.07.2009 um 18:07 schrieb James Reeves:
On Jul 18, 4:54 pm, James Reeves wrote:
Does anyone else suffer from occassional incorrect indentations in
VimClojure? It looks like VimClojure is preferring the indentation
layer of a previous set of [] over the current set of ().
A quick u
On Jul 18, 4:54 pm, James Reeves wrote:
> Does anyone else suffer from occassional incorrect indentations in
> VimClojure? It looks like VimClojure is preferring the indentation
> layer of a previous set of [] over the current set of ().
A quick update; it looks like it's doing it even without t
Hi folks,
Does anyone else suffer from occassional incorrect indentations in
VimClojure? It looks like VimClojure is preferring the indentation
layer of a previous set of [] over the current set of (). For example:
(defn foo [x]
(+ x
1))
When I hit enter after the se
Thanks, started tracking the 1.0 compat branch of clojure.contrib
On 7/17/09, Meikel Brandmeyer wrote:
>
> Hi,
>
> On Jul 17, 6:21 am, Wilson MacGyver wrote:
>
>> Can clojure-contrib be used with clojure-1.0? Or in order to use it, I
>> also
>> need to build clojure from github?
>
> There is a
Hi,
Am 15.07.2009 um 05:12 schrieb e:
i vote for zero config, option 1.
I'm not a big fan of option 1, because you have to
duplicate all efforts to install Vim on the different
systems. The Windows installers and MacVim
show, that this is not trivial, especially if you want
to provide python,
Hi,
Am 14.07.2009 um 22:35 schrieb Justin Johnson:
That sounds reasonable to me. I would only be able to work on the
Windows installer but I'd be willing to collaborate with others to
incorporate other installers into the project.
I can try on a Mac installer. I'm not that something
like
Hi,
I'm trying to set up Clojure, Slime and Aquamacs on a powerbook.
I obtained http://github.com/technomancy/clojure-mode
M-x clojure-install produces this error:
Checking out source... this will take a while...
Loading cl-macs...done
Initialized empty Git repository in /Users/gef/src/clojure/
On Sat, Jul 18, 2009 at 1:22 AM, Meikel Brandmeyer wrote:
> Using eval is not really a solution.
>
> (def foo '[a 1 b 2])
> (let-coll foo ...)
>
> will probably work with eval, but
>
> (let [foo '[a 1 b 2]]
> (let-coll foo ...))
>
> will not.
>
No, for that you need to make the "macro" run-time
On Fri, Jul 17, 2009 at 11:52 PM, Rowdy Rednose wrote:
>
> How can I lexically bind names like "let" does in a macro, when names
> and values for those bindings are passed in?
>
> This here works fine when I pass a literal collection:
>
> (defmacro let-coll
> [coll & body]
> `(let ~(vec coll) ~.
24 matches
Mail list logo