>
> Macroexpansion is part of the expression evaluation mechanism. In your
> example
>
>
>(defn foo
> ([bar] (foo bar :default))
> (special-fn-spec))
>
> the whole defn-form is macroexpanded first, yielding something like
>
>(def foo (fn ([bar] (foo bar :default))
I am playing around with a macro to define accessor functions for a
closed-over atom. Here is a simplified example:
(defmacro hidden-atom []
(let [a (atom :hello)]
`(defn get-value [] (deref ~a
When I evaluate this macro, I get the error: "Can't embed object in
code, maybe print-dup not
Miki,
Thanks a lot - the mystery has been solved. It had to do with the way I was
handling the POST route.
It seems it needs explicit 'binding' as you mentioned
(POST "/" {params :params} (view-output (params "my_datum"
or
(POST "/" {{a "my_datum"} :params} ...)
Thanks again!
Victo
On Aug 7, 2:10 am, Mark Rathwell wrote:
> Anyone using lein-deamon and have success getting it working? When trying
> to start a daemon with 'lein daemon start daemon-name', I'm getting
> java.lang.IllegalArgumentException:
> No matching method: with-bindings (daemonProxy.clj:27). The entire erro
On Aug 7, 2:10 am, Mark Rathwell wrote:
> Anyone using lein-deamon and have success getting it working? When trying
> to start a daemon with 'lein daemon start daemon-name', I'm getting
> java.lang.IllegalArgumentException:
> No matching method: with-bindings (daemonProxy.clj:27). The entire erro
On Sep 17, 8:23 pm, David J wrote:
> I second faenvie's request for "applications of Clojure" books,
> especially on AI. AI is the reason I started looking at a Lisp in the
> first place. I'd also like to see Clojure become *the* language for
> statistics, though I understand that R statistician
you can also run into issues with things being on the classpath for
your project, but not being on the classpath for lein, but user.clj
being on the classpath for both, so when lein runs it can't find
things your user.clj tries to load
On Sat, Sep 11, 2010 at 8:17 AM, Stuart Sierra
wrote:
> Don't
OK, this feels like a really dumb question...
I'm playing around in the REPL, I type in a function, I use it and
continue to work on other stuff... I can't remember what the function
looked like and I want to display the source of it again...
I know I can go back through the REPL history but mayb
On Sat, Sep 18, 2010 at 1:12 PM, Eric Lavigne wrote:
> It has been built into a library, so you won't need to implement it.
>
> http://github.com/alienscience/cache-dot-clj
Thanx! I saw this mentioned in another thread recently but didn't make
the connection with the strategy-based caches.
--
Se
> It would be great if something like this was built into the standard
> libraries... or am I in a minority of users with such requirements?
>
> At least it gives me some pointers on how to implement timed caches...
>
It has been built into a library, so you won't need to implement it.
http://git
On Sat, Sep 18, 2010 at 11:00 AM, Wilson MacGyver wrote:
> Check out http://kotka.de/blog/2010/03/The_Rule_of_Three.html for a very
> flexible implementation of memoiz
Very nice. A good illustration of a lot of Clojure features too,
especially with the detailed follow-up:
http://kotka.de/blog/20
On Sat, Sep 18, 2010 at 10:40 AM, Sean Corfield wrote:
> Since memoize seems to be 'forever' and caching in general smells of
> mutable state, I wondered how folks are tackling this sort of thing in
> Clojure? Are you simply dropping down to Java libraries and being
> 'non-functional' or is there
Check out http://kotka.de/blog/2010/03/The_Rule_of_Three.html for a very
flexible implementation of memoiz
On Sep 18, 2010 1:40 PM, "Sean Corfield" wrote:
Working in the web dev world, I'm fairly used to systems offering ways
to cache data for a period of time to improve performance - to reduce
Working in the web dev world, I'm fairly used to systems offering ways
to cache data for a period of time to improve performance - to reduce
database traffic, to reduce complex data manipulation. The pattern is
pretty much always:
if ( thing not in cache ) {
do expensive calculation / data loa
> http://github.com/alienscience/cache-dot-clj
Thanks for the link. That is helpful.
> Would JDBC suit your needs as a storage medium?
I suppose that would work, but I am thinking that an ehcache based
plugin for cache-dot-clj might be a good solution.
-David
--
You received this message beca
On 18 Sep 2010, at 07:15, Stuart Campbell wrote:
In the following contrived example, I get an error when
macroexpanding (defn foo ...):
(defmacro special-fn-spec []
'([bar baz] (println bar baz)))
(defn foo
([bar] (foo bar :default))
(special-fn-spec))
The error is:
Parameter declarat
in a (def f [] E), only a E is going to be macro-expanded. (I think
the rule of thumb is that macro are only expanded in a position
where an expression is.)
You can build :
(defmacro macro-expanding-defn [name l]
) using a combination of macro-expand, defn and macro?
(You can also do a simpler
On Sep 18, 3:00 am, David McNeil wrote:
> Is there a disk-backed memoize available? I have an application where
> I would like the cache of values to survive restarts of the app.
>
I don't know of one but in the next few weeks I was planning to add
memcache functionality to cache-dot-clj to suppo
18 matches
Mail list logo