> Hope that helps.
>
> Sincerely
> Meikel
Thanks! That helped.
--
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 patient with your
Hi,
On 12 Okt., 07:05, Aravindh Johendran wrote:
> (def *cont* identity)
> (defmacro =values [& retvals]
> `(*cont* ~...@retvals))
>
> why would the following two expressions throw errors???
> (binding [*cont* (fn [m n] (=values (list m n)))] (*cont* 'a 'b))
So what happens here: The macro =v
On Tue, Oct 12, 2010 at 12:45 AM, Mark Engelberg
wrote:
> I'm playing around with couchdb. I'm using the version that lein gets
> with the following command:
> [clojure-couchdb "0.4.4"]
> which as far as I can tell is the most recently maintained version.
>
> When I do a bunch of rapid calls to
I'm working on the chapter on continuations in On Lisp (Chapter 20)
and am trying to translate the code to clojure
However, I am running into some issues.
With the following definitions:
(def *cont* identity)
(defmacro =values [& retvals]
`(*cont* ~...@retvals))
why would the following two ex
I'm playing around with couchdb. I'm using the version that lein gets
with the following command:
[clojure-couchdb "0.4.4"]
which as far as I can tell is the most recently maintained version.
When I do a bunch of rapid calls to document-create in a tight loop,
after about 3000 or so documents ha
On Oct 11, 2010, at 10:28 PM, Vilson Vieira wrote:
> i've started a new lein project. it's my project.clj:
>
> (defproject test-processing "0.1.0-SNAPSHOT"
> :description "Test Processing"
> :dependencies [[org.clojure/clojure "1.2.0-master-SNAPSHOT"]
> [org.clojure/clojure-
On Oct 11, 2010, at 8:53 PM, John Stoneham wrote:
> For another point of view: take a look at what Brian Marick's been
> doing with a framework called Midje to do outside-in TDD. It helps you
> mock out function dependencies and might get you where you want to go.
> It's just maturing now but I fo
Fantastic! Great job David and everyone else who contributed.
Mike
--
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 patient wi
Fantastic! Great job David and everyone else who contributed.
Mike
--
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 patient wi
Fantastic! Great job David and everyone else who contributed.
Mike
--
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 patient wi
hello,
i've started a new lein project. it's my project.clj:
(defproject test-processing "0.1.0-SNAPSHOT"
:description "Test Processing"
:dependencies [[org.clojure/clojure "1.2.0-master-SNAPSHOT"]
[org.clojure/clojure-contrib "1.2.0-SNAPSHOT"]
[org.clojars.f
On Mon, Oct 11, 2010 at 6:06 PM, Felix H. Dahlke wrote:
> This made me wonder if test-driven development was desirable in Clojure
> at all, or even in functional programming in general.
For another point of view: take a look at what Brian Marick's been
doing with a framework called Midje to do ou
When a var's definition has a "lazy reference" to itself, as primes does below,
then your results will be dependent on the lazy/chunky/strict-ness of the calls
leading to the lazy reference.
The functions range, rest, and remove are chunk-aware, so the range-based
version of primes consumes a b
> (def nums (cons 2 (lazy-seq (map inc nums
> (def primes (cons (first nums)
> (lazy-seq (->>
> (rest nums)
> (remove
> (fn [x]
> (let [dividors (take-while #(<= (* % %) x)
> primes)]
> (some #(=
Hi,
I'm new to Clojure, using it for a reasonably sized project for the
first time, and I'm trying to do test-driven development.
While it does work well technically - clojure.test is very nice to use
and feels a lot like JUnit 4's assertThat() - I'm wondering if I'm
trying to program Java in Cl
ok i have made a (ugly) trick to make it work, copying tools.jar in
cdt/lib and changing cdt.el:
(defun cdt-query-cmdline ()
(let ((path (strip-trail cdt-dir)))
(format "java -classpath%s/lib/clojure-1.2.0.jar;%s/lib/clojure-
contrib-1.2.0.jar;%s/lib/debug-repl-0.3.0-20091229.021828-3.jar;%s
ok i have made a (ugly) trick to make it work, copying tools.jar in
cdt/lib and changing cdt.el:
(defun cdt-query-cmdline ()
(let ((path (strip-trail cdt-dir)))
(format "java -classpath%s/lib/clojure-1.2.0.jar;%s/lib/clojure-
contrib-1.2.0.jar;%s/lib/debug-repl-0.3.0-20091229.021828-3.jar;%s
On Oct 12, 12:48 am, atreyu wrote:
> Hi folks and congrats to George Jahad for this great work.
> Hoewer the cdt dont work on my windows vista. After some changes on my
> own i get the same error of Greg Willams:
>
> java.lang.ClassNotFoundException: com.sun.jdi.Bootstrap (cdt.clj:28)
>
> i've t
Hi folks and congrats to George Jahad for this great work.
Hoewer the cdt dont work on my windows vista. After some changes on my
own i get the same error of Greg Willams:
java.lang.ClassNotFoundException: com.sun.jdi.Bootstrap (cdt.clj:28)
i've tried add-classpath of tool.jar (where is the class
Check out the downloads area on http://github.com/richhickey/clojure-clr.
Grab clojure-clr-1.2.0.zip. Unzip, start up Clojure.Main.exe and you
should be running. The zip also contains Clojure.Compile.exe, which
you can invoke with command line arguments indicating files to
compile. The support D
I confess I'm a bit baffled by this too, but I have a couple
suggestions that don't address your problem :)
(drop 2 (range)) is the same as (iterate inc 2), and the same as your
convoluted lazy-seq, except that the iterate works here, while for
some reason the range doesn't.
You might consider ze
On Mon, Oct 11, 2010 at 12:21 PM, Ivan Willig wrote:
> I often run into this issue where I am follow a Java documentation where
> they developers fail to explain where they import packages from. In most
> Java IDE's you can search your classpath for reference types. It would be
> great is if was
Hi,
I tried experimenting with lazy sequences and wrote this program
(def nums (cons 2 (lazy-seq (map inc nums
(def primes (cons (first nums)
(lazy-seq (->>
(rest nums)
(remove
(fn [x]
(let [dividors (take-whil
Hi list,
I often run into this issue where I am follow a Java documentation where
they developers fail to explain where they import packages from. In most
Java IDE's you can search your classpath for reference types. It would be
great is if was possible to do the same in slime. I looked around the
David Nolen writes:
> On Mon, Oct 11, 2010 at 10:02 AM, Steve Purcell
> wrote:
>
> Well, taking a brief look over your code, it seems like the main
> difference is that scriptjure is macro-based, so all the code
> generation
> gets done at compile-time.
>
>
> js-gen generate
It's fairly common to let over a function, e.g.:
(let [a (atom 0)]
(defn next-id []
(swap! a inc)))
In the above, the atom can only be referenced from within the lexical
scope of the let, hence essentially private to the next-id function.
On Oct 11, 8:03 am, lprefonta...@softaddicts.ca wro
>> You going to do some speech recognition in Clojure?
Unfortunately, no. I just have some hand RSI problems, and I use
Dragon NaturallySpeaking for writing e-mails and documenting Clojure
code. You can see an example of the notes I've taken while going
through the labrepl exercises at
http://www
On Mon, Oct 11, 2010 at 10:02 AM, Steve Purcell wrote:
> Well, taking a brief look over your code, it seems like the main
> difference is that scriptjure is macro-based, so all the code generation
> gets done at compile-time.
>
js-gen generates js at compile time.
>
> That makes scriptjure fas
(:use [clojure.contrib.def])
(defvar- x ...)
A bit shorter than writing the meta-data by hand.
Def provides a number of other interesting shortcuts. Have a look at
def.clj in contrib.
I prefer to keep things private and avoid cluttering the use
clause with a long :only list. I use :only only wh
Thanks this does seem to solve the problem of the servlet being
reinitialized on every run.
On Oct 10, 11:10 pm, Adrian Cuthbertson
wrote:
> Hi Dmitri,
>
> The problem is probably related to calling init with args. It requires
> that super() gets called - I can't remember where I saw the
> docume
Well, taking a brief look over your code, it seems like the main
difference is that scriptjure is macro-based, so all the code generation
gets done at compile-time.
That makes scriptjure faster, but at the expense of needing an unquote
form - "(clj ...)" - to splice clojure expressions into the ja
On Oct 10, 2010, at 3:05 PM, HiHeelHottie wrote:
> I'm running lein swank and using slime-connect from emacs. When I use
> lein compile after making changes to a method, they don't appear to
> get picked up unless I bring down lein swank, bring it up again, slime-
> connect, etc.
>
> Is there a
I've heard of scriptjure but never used it or looked at it. My
interests took me in another direction and I've never circled back. I
would be interested to know how the differ.
Thanks,
Jim
On Oct 11, 3:21 am, Steve Purcell wrote:
> jim writes:
> > Due to popular demand*, I resuscitated my code
Hi,
On 11 Okt., 13:29, Ulises wrote:
> sorry for the confusion and the silly questions,
Ehm. Nope. To cite the (german) sesame street:
Wer? Wie? Was?
Wieso? Weshalb? Warum?
Wer nicht fragt bleibt dumm!
Just keep asking. :)
Sincerely
Meikel
--
You received this message because you are subsc
> Hope, that helps.
It does indeed.
So, def either creates or looks up a var of the name of the symbol
given and then every time eval comes across a symbol it tries to
lookup a var of the same name?
(just read http://clojure.org/special_forms#def which I should've read
before posting)
Cheers an
Hi,
I'm afraid I'm new to Clojure, so I'm not even going to attempt a
patch, but I get a NullPointerException when I pass an empty map
(e.g., {} or {:something {}}) to lazy-xml/emit.
The stacktrace is below, if anyone's interested.
Regards,
Ed O'Loughlin
-
2010-10-10 19:08:16.111::W
Hi,
or a maybe clearer example, which shows the different states:
; No Var, yet.
user=> (var foo)
java.lang.Exception: Unable to resolve var: foo in this context
(NO_SOURCE_FILE:1)
; Var is now defined. Hence it can be resolved. But it has to root
value, ie. it is "unbound", yet.
user=> (def foo
Hi,
On 11 Okt., 12:45, Ulises wrote:
> user> (def foo)
> #'user/foo
> user> foo
> ;Var user/foo is unbound.
> ; [Thrown class java.lang.IllegalStateException]
> user>
>
> I guess this means there's no var named user/foo and hence the symbol
> cannot get its closest match in name?
You are confu
> Eh. No. I don't think so. The Var has a name and the symbol has a
> name. And an unqualified symbol is resolved to the "closest" Var with
> the same name (conveniently derefing the var to get its contents).
> This might be in the same namespace or in a different namespace which
> was :use'd. I'm
Hi,
On 11 Okt., 12:26, Ulises wrote:
> so in theory one could have a symbol foo bound to a var bar?
Eh. No. I don't think so. The Var has a name and the symbol has a
name. And an unqualified symbol is resolved to the "closest" Var with
the same name (conveniently derefing the var to get its con
> So I would say: "Unqualified symbols in the namespace the def happened
> in will resolve to the def'd Var." (of course only after the def
> happened!)
so in theory one could have a symbol foo bound to a var bar?
U
--
You received this message because you are subscribed to the Google
Groups "C
Hi,
On 11 Okt., 11:44, Laurent PETIT wrote:
> I guess one should use "mapping" instead of "binding". The var is mapped to
> the symbol "foo" in the namespace *ns*.
>
> I'm saying that because functions for inspecting namespaces are (ns-map),
> etc.
In a determined attempt to increase confusion,
> I guess one should use "mapping" instead of "binding". The var is mapped to
> the symbol "foo" in the namespace *ns*.
> I'm saying that because functions for inspecting namespaces are (ns-map),
Ah! Excellent, thanks.
U
--
You received this message because you are subscribed to the Google
Grou
2010/10/11 Ulises
> Hi,
>
> I'm sure this has been asked before (although I couldn't find anything
> other than this StackOverflow thread
> http://stackoverflow.com/questions/2320348/symbols-in-clojure) and, in
> addition to that thread, I have a clarifying question:
>
> Am I right if I say that
you are right (at least as far as I know)
--
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 patient with your
first post.
To unsu
Hi,
I'm sure this has been asked before (although I couldn't find anything
other than this StackOverflow thread
http://stackoverflow.com/questions/2320348/symbols-in-clojure) and, in
addition to that thread, I have a clarifying question:
Am I right if I say that when I do (def foo "1") I'm creati
Hi,
On 11 Okt., 09:22, HiHeelHottie wrote:
> I want to define and use a map that is private to a namespace and used
> by several functions in that namespace. Is the idiomatic way simply
> to def it within the namespace? Is there another way to hide it?
(def ^{:private true} my-map {:a :b :c :
;; some_ns/internal.clj
(ns some-ns.internal)
(def private-map {:k1 10 :k2 20})
;;end-of-file
;; some_ns.clj
(ns some-ns
(:use some-ns.internal))
;; ..functions..
(defn foo
[]
;; do something with private-map
..)
;;end-of-file
This is how
jim writes:
> Due to popular demand*, I resuscitated my code to generate javascript
> from s-expressions. This was what I coded to learn about logic
> programming in Clojure.
>
> Github: http://github.com/jduey/js-gen
> Clojars: http://clojars.org/net.intensivesystems/js-gen
>
> *actually it was
I want to define and use a map that is private to a namespace and used
by several functions in that namespace. Is the idiomatic way simply
to def it within the namespace? Is there another way to hide it?
--
You received this message because you are subscribed to the Google
Groups "Clojure" gro
50 matches
Mail list logo