On Fri, Jul 17, 2009 at 11:52 PM, Rowdy Rednose rowdy.redn...@gmx.netwrote:
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
On Sat, Jul 18, 2009 at 1:22 AM, Meikel Brandmeyer m...@kotka.de 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
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
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,
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
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
On Jul 18, 4:54 pm, James Reeves weavejes...@googlemail.com 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
Hi,
Am 18.07.2009 um 18:07 schrieb James Reeves:
On Jul 18, 4:54 pm, James Reeves weavejes...@googlemail.com 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
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 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
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
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
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 b c))
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
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 goes
On Jul 18, 6:47 pm, Meikel Brandmeyer m...@kotka.de 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
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
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
On Jul 19, 12:53 pm, Richard Newman holyg...@gmail.com 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:
19 matches
Mail list logo