<< Back to previous view

[CLJ-873] Allow the function / to be referred to in namespaces other than clojure.core Created: 10/Nov/11  Updated: 28/Jul/13  Resolved: 28/Jul/13

Status: Resolved
Project: Clojure
Component/s: None
Affects Version/s: Release 1.1, Release 1.2, Release 1.3, Release 1.4
Fix Version/s: Release 1.6

Type: Enhancement Priority: Minor
Reporter: Chris Gray Assignee: Unassigned
Resolution: Completed Votes: 7
Labels: None

Attachments: Text File 0001-Fix-CLJ-873-for-EdnReader-too.patch     Text File clj-873-namespace-divides-patch.txt     File namespace-divides.diff    
Patch: Code
Approval: Ok

 Description   

The attached patch gives the programmer the option of referring to the division function in namespaces other than just clojure.core. For example,

(ns foo
(:require [cljs.core :as core]))
(apply core// '(1 2 3))

The above lines do not compile without this patch.



 Comments   
Comment by Chris Gray [ 10/Nov/11 9:50 AM ]

I have signed the CA and it is in the mail.

Comment by Chris Gray [ 20/Nov/11 6:21 PM ]

My CA has now been applied. This patch is quite simple – can someone have a look at it please?

Comment by Alex Miller [ 09/Dec/11 9:34 AM ]

FYI, I have run into this in actual code as well (implementing a query language function library).

Comment by Andy Fingerhut [ 24/Feb/12 8:00 PM ]

clj-873-namespace-divides-patch.txt is same as Chris's, just updated to apply cleanly to latest master as of Feb 24, 2012.

The test he added does fail without the code fix, and passes with it. He is now on the list of contributors.

Comment by Chris Gray [ 30/Mar/12 1:11 PM ]

A short further discussion of this patch appeared here: http://groups.google.com/group/clojure-dev/browse_thread/thread/f095980802a82747/b723726c77c1ec64

Also, I assume this bug is what is referred to in Clojurescript's core.cljs, where it says ";; FIXME: waiting on cljs.core//"

Comment by Stuart Halloway [ 22/Oct/12 7:12 PM ]

Thanks all. It is nice to have supporting real-world stories such as Alex's in the comments.

Comment by Andy Fingerhut [ 22/Oct/12 7:19 PM ]

I should have added a comment here a while back if it would have helped, but David Nolen's CLJ-930 was closed as a duplicate of this one.

Comment by Brandon Bloom [ 02/Jan/13 12:49 AM ]

This also affects a two of my libraries: 1) CSS generation library I'm working on, which wants to be able to do division with pixels and other units. 2) Factjor which defines binary math operators against a stack.

Comment by Nicola Mometto [ 24/May/13 8:39 AM ]

clojure.lang.EdnReader should get patched aswell.

Comment by Nicola Mometto [ 25/May/13 11:48 AM ]

I'm reopening it, attaching a patch for EdnReader

Comment by Andy Fingerhut [ 25/May/13 12:37 PM ]

Nicola, I noticed yesterday that LispReader.java still contains values SLASH and CLOJURE_SLASH that are no longer used after the patch was applied yesterday for this ticket. Would you mind including the removal of those in your patch, too?

Comment by Nicola Mometto [ 25/May/13 2:05 PM ]

Andy, I've updated 0001-Fix-CLJ-873-for-EdnReader-too.patch to remove SLASH and CLOJURE_SLASH as you suggested.

Comment by Alex Miller [ 28/Jul/13 10:22 PM ]

Since the last patch on this came in after the change had been applied, I moved the cleanup patch to CLJ-1238.

Comment by Alex Miller [ 28/Jul/13 10:23 PM ]

Re-resolving. Moved extra late patch to new ticket - CLJ-1238.

Generated at Sat Apr 19 05:03:12 CDT 2014 using JIRA 4.4#649-r158309.