On Aug 15, 10:16 pm, Kevin Livingston
wrote:
> I am working on an api that has an interface and two distinct
> implementations lets call them: foo and bar.
>
> I have a testing routine with a bunch of functions that each call a
> function to get a clean instance of an implementation, initializes i
I am working on an api that has an interface and two distinct
implementations lets call them: foo and bar.
I have a testing routine with a bunch of functions that each call a
function to get a clean instance of an implementation, initializes it
with some data and then interrogate it.
with the exc
On Mon, Aug 15, 2011 at 11:13 AM, mrwizard82d1 wrote:
> I understand that the 1.3 beta plans to add an environment variable
> named clojure.load.path to provide a "CLASSPATH" mechanism for Clojure
> on the CLR.
>
> Although I use Windows, I have installed cygwin because I prefer the
> Unix tool se
Wow, forget everything I said, this has nothing to do with macro
expansion. Looks more like inside a function you can only def
something in the same namespace as the function:
user> (defn ff [] (in-ns 'foo.core2) (def anything5 10))
#'user/ff
user> anything5
Var user/anything5 is unbound.
[Thr
You are correct, I must have messed something up in my expansions.
>From the below, however, it looks like a var is being declared just by
having the macro called, but not bound to the value:
user> (defmacro foo [name & body] `(def ~name ~(identity `(fn [] ~@body
#'user/foo
user> (foo xx (in-n
I can confirm the problem. Same java (ubuntu) version here.
To reproduce the problem please try:
1. Create a new Noir project as described at https://github.com/ibdknox/noir :
lein plugin install lein-noir 1.1.0
lein noir new my-website
cd my-website
lein run
Check localho
I either disagree or don't understand. The deftest macro doesn't touch
your &body arg; it's expanded as-is. For example, (let [x 'foo] `(inc
~x)) doesn't result in foo getting qualified, and most macros behave
the same way.
On Aug 15, 4:36 pm, Mark Rathwell wrote:
> Just to be clear, it is namesp
Just to be clear, it is namespace resolved because of syntax quote:
(defmacro deftest
[name & body]
(when *load-tests*
`(def ~(vary-meta name assoc :test `(fn [] ~@body))
(fn [] (test-var (var ~name))
On Mon, Aug 15, 2011 at 7:23 PM, Alan Malloy wrote:
> Is it? That's neat
Is it? That's neat; I guess I've never thought about how the compiler
treats def. Thanks for the explanation.
On Aug 15, 3:03 pm, Mark Rathwell wrote:
> deftest is a macro. Macros are expanded at compile time. So, in this
> case, at compile time, a function called namespace2 is def'd with meta
deftest is a macro. Macros are expanded at compile time. So, in this
case, at compile time, a function called namespace2 is def'd with meta
data :test set to the body of your deftest.
All of that body is namespace resolved in macro expansion, before
in-ns is ever executed (which happens when you
I'm finding that namespaces don't seem to behave as I expect
intuitively, or according to the reference. It's quite possible I'm in
the wrong here though, as I'm just kicking clojure's tires at this
point.
Here is the relevant doc:
http://clojure.org/special_forms
(def symbol init?)
Creates and i
Okay, that makes sense - although it does seem potentially confusing.
Thanks!
On Aug 15, 1:42 pm, Alan Malloy wrote:
> On Aug 15, 6:16 am, Richard Rattigan wrote:
>
>
>
>
>
>
>
>
>
> > I don't understand why this test would fail - can anyone explain why?
>
> > (ns learn.clojure.test.core
> >
On Sun, Aug 14, 2011 at 6:08 AM, Mats Rauhala wrote:
> Another function in the same way is 'const :: a -> b -> a' (on haskell,
> but easy to make in clojure if it doesn't exist) which
> disregards the second argument and always returns the first.
The functions returned by "constantly" in Clojure
I've been exchanging emails and software packages back and forth with
ibdknox who has been trying to help, and the whole thing is really
weird. I've done my tests on two different computers (both running
Ubuntu Natty 11.04 x64), and I get the exact same error on both.
ibdknox is testing on his side
On Aug 15, 6:16 am, Richard Rattigan wrote:
> I don't understand why this test would fail - can anyone explain why?
>
> (ns learn.clojure.test.core
> (:use [clojure.test]))
> (deftest namespaces
> (in-ns 'my.new.namespace)
> (is (= "my.new.namespace" (str *ns*)))
> (is (= `anything 'my.ne
Thanks. Submitted an issue to Jira, and I guess I will just see how it goes.
http://dev.clojure.org/jira/browse/CLJ-828
Cheers
Alf
On Mon, Aug 15, 2011 at 16:26, Armando Blancas
wrote:
>> I think a function should generally return the same types for
>> different input. A seq and a Java array
I understand that the 1.3 beta plans to add an environment variable
named clojure.load.path to provide a "CLASSPATH" mechanism for Clojure
on the CLR.
Although I use Windows, I have installed cygwin because I prefer the
Unix tool set to that provided by Windows. Although a Windows console
allows o
> I think a function should generally return the same types for
> different input. A seq and a Java array are two very different things
> even though Clojure often lets us pass both to the same functions. It
> seemed like a small fix, but I guess not everyone agrees.
That's clearly a bug; they for
I don't understand why this test would fail - can anyone explain why?
(ns learn.clojure.test.core
(:use [clojure.test]))
(deftest namespaces
(in-ns 'my.new.namespace)
(is (= "my.new.namespace" (str *ns*)))
(is (= `anything 'my.new.namespace/anything)))
expected: (= (quote learn.clojure.te
On Aug 10, 2011 1:16 PM, "Alf Kristian Støyle"
wrote:
> I think I found a small bug in clojure.core/bases. Extending the
> existing unit test reveals it:
>
> (deftest test-bases
> (are [x y] (= x y)
> (bases java.lang.Math)
> (list java.lang.Object)
> (bases java.lang.Integer)
> (list java.lang.Nu
Another function in the same way is 'const :: a -> b -> a' (on haskell,
but easy to make in clojure if it doesn't exist) which
disregards the second argument and always returns the first.
This example is in haskell, but let's say that you're creating a
histogram, meaning that you go through a list
On Thu, Jul 28, 2011 at 12:36:08PM -0500, Devin Walters spake thus:
> I don't think there has been a significant enough influx of mail on the list
> to warrant the creation of a new, separate list. There are so many
> similarities between the two that I think we'd run into situations where
> peo
I should have done a comparison to original Clojure first.
In Clojure, rand-nth on an empty vector does throw an exception, as
Meikel says. As does any use of nth with a bad index and no not-found
parameter. So that seems to be a bug.
But, nth on a set never works in Clojure, throwing
"java.lan
Hi,
Am Montag, 15. August 2011 11:25:33 UTC+2 schrieb Alf:
>
> I think a function should generally return the same types for
> different input. A seq and a Java array are two very different things
> even though Clojure often lets us pass both to the same functions. It
> seemed like a small fix, bu
I think a function should generally return the same types for
different input. A seq and a Java array are two very different things
even though Clojure often lets us pass both to the same functions. It
seemed like a small fix, but I guess not everyone agrees.
Like a wrote, I think this is small bu
25 matches
Mail list logo