:refer-clojure + math.combinatorics

104 views
Skip to first unread message

Chas Emerick

unread,
Jan 15, 2013, 8:38:34 AM1/15/13
to cloju...@googlegroups.com
math.combinatorics has a (comment) form ahead of its (ns) declaration. This generally won't be a problem, as it will be evaluated within the namespace that is loading math.combinatorics; however, if that namespace's (ns) decl is uses :refer-clojure after its :require of math.combinatorics, `comment` will not have been referred into *ns* before the math.combinatorics lib is loaded:

user=> (ns foo
#_=> (:require clojure.math.combinatorics)
#_=> (:refer-clojure :exclude (read)))
CompilerException java.lang.RuntimeException: Unable to resolve symbol: comment in this context, compiling:(clojure/math/combinatorics.clj:7:1)

It looks like I have commit on math.combinatorics; I hope no one will mind if I move that comment form after the ns to eliminate this particular problem (it looks like Mark isn't really active on that lib anymore?).

Is it intentional that the use of :refer-clojure should change behaviour like this? I presume not; would it be reasonable to always lift the refer of clojure.core to be the first action in the with-loading-context emitted by ns?

Cheers,

- Chas

Meikel Brandmeyer

unread,
Jan 15, 2013, 8:48:48 AM1/15/13
to cloju...@googlegroups.com
Hi,


Am Dienstag, 15. Januar 2013 14:38:34 UTC+1 schrieb Chas Emerick:

Is it intentional that the use of :refer-clojure should change behaviour like this?  I presume not; would it be reasonable to always lift the refer of clojure.core to be the first action in the with-loading-context emitted by ns?


That doesn't solve the problem, does it? Someone could do (ns (:refer-clojure :exclude [comment]) ..). I prefer labeling doing things before the ns/in-ns clause to be a bug.

Meikel
 

Chas Emerick

unread,
Jan 15, 2013, 9:56:08 AM1/15/13
to cloju...@googlegroups.com
Quite right, good point.

- Chas

Mark Engelberg

unread,
Jan 15, 2013, 2:27:37 PM1/15/13
to cloju...@googlegroups.com
On Tue, Jan 15, 2013 at 5:38 AM, Chas Emerick <ch...@cemerick.com> wrote:
It looks like I have commit on math.combinatorics; I hope no one will mind if I move that comment form after the ns to eliminate this particular problem (it looks like Mark isn't really active on that lib anymore?).

I'm active, it's just the library is pretty stable and rarely needs updating, other than surface changes to the readme and comments to keep up with evolving community standards.  In any case, thanks for going ahead and moving the comment form.

--Mark

Chas Emerick

unread,
Jan 15, 2013, 6:04:52 PM1/15/13
to cloju...@googlegroups.com
I'm sorry to have jumped to conclusions; clearly a bad inference from the commit history.

- Chas

Sebastián Galkin

unread,
Mar 26, 2013, 6:53:24 PM3/26/13
to cloju...@googlegroups.com

It looks like I have commit on math.combinatorics; I hope no one will mind if I move that comment form after the ns to eliminate this particular problem (it looks like Mark isn't really active on that lib anymore?).

 
Could a new version with this fix be released?

Thanks

Mark Engelberg

unread,
Mar 26, 2013, 7:04:32 PM3/26/13
to cloju...@googlegroups.com
I just hit the button to make a new 0.0.4 stable release.  I assume it takes 24 hours or so to percolate out.

If you have an urgent need, the patch has been in the 0.0.3-snapshot for a couple months now.

--
You received this message because you are subscribed to the Google Groups "Clojure Dev" group.
To unsubscribe from this group and stop receiving emails from it, send an email to clojure-dev...@googlegroups.com.

To post to this group, send email to cloju...@googlegroups.com.
For more options, visit https://groups.google.com/groups/opt_out.
 
 

Sebastián Galkin

unread,
Mar 26, 2013, 8:47:11 PM3/26/13
to cloju...@googlegroups.com
On Tuesday, March 26, 2013 4:04:32 PM UTC-7, puzzler wrote:
I just hit the button to make a new 0.0.4 stable release.  I assume it takes 24 hours or so to percolate out.


Great, thanks
Reply all
Reply to author
Forward
0 new messages