The API documentation refers to EvalReader:
Quote
*read-eval* - var - When set to logical false, the EvalReader
(#=(...)) is disabled in the
read/load in the thread-local binding.
Unquote
Is #= an undocumented reader macro character?
And what is the EvalReader anyway? It doesn't appeared to be d
On Thu, Feb 18, 2010 at 11:18 PM, Mike K wrote:
> Hey Clojurians,
>
> I'm a Clojure and Common Lisp newbie. I heard that Norvig's PAIP was a
> good book to study idiomatic CL code, so I've embarked on a project to
> translate the examples to / work the exercises in Clojure. I hope to
> complete t
Hi,
I'm having problems with nested syntax-quotes, or something.
This works fine:
(use 'clojure.contrib.macro-utils)
(def *a* nil)
;; good
(defmacro my-macro [& body]
`(let [name# {#'*a* :new}]
(macrolet [(~(symbol 'with-my-macrolet) [& body#]
(concat (list
Oh, and so it's not too miserable to understand what my example is
doing, it's just binding *a* to :new using with-bindings. ;)
I know it looks like a Rube Goldberg way to do it, but it's a
distilled, abstract example taken from:
http://github.com/tjg/tjg-utils/blob/master/src/tjg-utils.clj#L92
Hi Mike,
I am also a newbie for Clojure.
On 19 February 2010 15:18, Mike K wrote:
> Regarding "append" from CL: ISTM that this is similar to "concat" in
> Clojure. I tried the following definition:
How about this?
user=> (defn append [& parts] parts)
#'user/append
user=> (append '(a b c) '(d
On Feb 19, 4:32 am, timc wrote:
> Is #= an undocumented reader macro character?
>
Interesting - I had never heard of it either. It appears to allow you
to execute code at read-time.
user=> (read-string "(foo (+ 2 3) bar)")
(foo (+ 2 3) bar)
user=> (read-string "(foo #=(+ 2 3) bar)")
(foo 5 bar)
On Feb 19, 1:12 pm, Chris Perkins wrote:
> On Feb 19, 4:32 am, timc wrote:
> > Is #= an undocumented reader macro character?
>
> Interesting - I had never heard of it either. It appears to allow you
> to execute code at read-time.
>
> user=> (read-string "(foo (+ 2 3) bar)")
> (foo (+ 2 3) bar)
Have a look at clojure/core_print.clj in the clojure source. It is
indeed used with serialization - see print-dup. Here's an example of
usage;
(import '(java.io File FileWriter PushbackReader FileReader))
(defn rec-save
"Save a clojure form to file. Returns the called form."
[#^File file frm]
Hi,
Is there something like a (stop-server) I don't see anything here
http://compojure.org/docs
thanks
Brian
--
You received this message because you are subscribed to the Google
Groups "Clojure" group.
To post to this group, send email to clojure@googlegroups.com
Note that posts from new memb
Unfortunately most of the examples don't illustrate how to set this is for
brevity's sake. In my own code I do the following:
(defonce *app* (atom nil))
(defn start-app []
(if (not (nil? @*app*))
(stop @*app*))
(reset! *app* (run-server {:port 8080}
"/*" (servl
On Tue, Feb 16, 2010 at 11:17 PM, joseph hirn wrote:
> I do not have a ~/.swank-clojure directory. I do have a swank-
> clojure-1.1.0 directory from the swank install via elpa in ~/.emacs.d/
> swank-clojure-1.1.0 but I have tried deleting that manually several
> times and reinstalling it via elpa,
You missed a quote (~name# -> ~'name#); this works fine:
(defmacro my-macro [& body]
`(let [name# {#'*a* :new}]
(macrolet [(~(symbol 'with-my-macrolet)
[& body#]
`(with-bindings ~'name#
~...@body#))]
~...@body))
Since
With this approach how would I test the individual functions defined
inside of the let? Wouldn't they be invisible to me and the test
framework which would only see "sell-or-rent"?
On Feb 18, 4:27 pm, John Williams wrote:
> I'm no Clojure guru myself, but one approach you may want to consider is
Hi,
On Feb 19, 6:16 pm, Michał Marczyk wrote:
> You missed a quote (~name# -> ~'name#); this works fine:
>
> (defmacro my-macro [& body]
> `(let [name# {#'*a* :new}]
> (macrolet [(~(symbol 'with-my-macrolet)
> [& body#]
>`(with-bindings ~'name#
>
Hi!
I've been playing with error-kit, and like a ranting guy on the street
I'd like to share random thoughts...
* I'll probably come to rely on error-kit, or something like it.
Suppose you're playing with nakkaya's distributed computing thingie ¹;
you could hook simple listeners to do stuff when
It seems I have an example that shows difference between commute and
alter.
Here it is:
(defn my-inc [x] (dosync (Thread/sleep 1000) (inc x)))
alter***
(def x (ref 0))
(do
(def fut (future (do (Thread/sleep 300) (dosync (alter x inc))
@x)))
(dosync (println @x)(alter x my-inc)(pr
Thanks Timothy. That did the trick. One small comment below.
On Feb 19, 12:11 am, Timothy Pratley wrote:
> On 19 February 2010 18:04, Julien wrote:
>
>
>
> > Question #1
>
> > I want to write a vararg function that does something like this:
>
> > (map vector [1 2 3] [4 5 6])
> > which yields
> >
Two Question:
1. Is there a canonical method to limit eval execution time in the
REPL. i.e (A method to force a limitation on the number of seconds
allowed to evaluate an clojure input resulting in a short circuited
exit of the eval request.)
2. Is there a canonical method to limit the execution t
I'm doing some work with Amazon Web Services and have started to build a
thin wrapper for the typica and jets3t java-libraries. It is far from
complete, but has basic support to do real stuff with SQS, S3 and SDB.
http://github.com/ugglan/cljaws
Some example usage:
; enqueue the names of all my
Hello,
I would like to announce an implementation of ERB/JSP/etc -like
approach for templating with (I really believe) clear and idiomatic
syntax and design decisions.
Detailed description and code:
http://github.com/Flamefork/fleet
On Clojars:
http://clojars.org/fleet
I would appreciate any cr
I was totally misunderstood the question.
Please ignore my response.
Takasa
--
You received this message because you are subscribed to the Google
Groups "Clojure" group.
To post to this group, send email to clojure@googlegroups.com
Note that posts from new members are moderated - please be patie
Right, nesting everything inside a single function makes it impossible to
unit test the inner functions--they don't even have names in the global
scope! In retrospect, I think the solution I posted is more cute than it is
practical. Passing around a map of intermediate values seems to be the
winn
On Feb 17, 6:26 am, Timothy Pratley wrote:
> :test can be used to store a unit test (typically for a function) but
> you should use clojure.test for writing unit tests, just ignore :test
clojure.test uses :test metadata, so it is somewhat compatible.
-SS
--
You received this message because yo
> Looks pretty good to me. I like your use of preconditions and the
> number of tests. I think your indentation is a little deep (I go for
> two spaces, myself), and I never use :Capital keywords, but otherwise
> great.
>
The indentation was just what the Clojure plugin for Eclipse was set
t
I have to think that's preferable to submitting 30+ arguments to rent
and sell.
Or were you suggesting a different approach?
The different approach only works with a different approach :)
The way you've structured run-calculator, using the map is best,
because 30 arguments is crazy.
Your n
On 20 February 2010 07:22, p.bernard wrote:
> Two Question:
> 1. Is there a canonical method to limit eval execution time in the
> REPL. i.e (A method to force a limitation on the number of seconds
> allowed to evaluate an clojure input resulting in a short circuited
> exit of the eval request.)
Mike,
Finally, can anyone recommend a good free common lisp implementation
that runs well with slime / emacs under Windows?
SBCL is excellent. So is Clozure CL.
Regards,
BG
--
Baishampayan Ghose
--
You received this message because you are subscribed to the Google
Groups "Clojure" group.
To
27 matches
Mail list logo