<< Back to previous view

[ALGOG-4] No method in multimethod 'fmap' for dispatch value: class clojure.lang.PersistentVector$ChunkedSeq Created: 02/Apr/14  Updated: 02/Apr/14

Status: Open
Project: algo.generic
Component/s: None
Affects Version/s: None
Fix Version/s: None

Type: Defect Priority: Minor
Reporter: Neil Prosser Assignee: Konrad Hinsen
Resolution: Unresolved Votes: 0
Labels: None


 Description   

If you do the following with the latest algo.generic code:

=> (clojure.algo.generic.functor/fmap inc (lazy-seq [1 2]))
(2 3)

but...

=> (clojure.algo.generic.functor/fmap inc (seq [1 2]))
IllegalArgumentException No method in multimethod 'fmap' for dispatch value: class clojure.lang.PersistentVector$ChunkedSeq  clojure.lang.MultiFn.getFn (MultiFn.java:160)

Is that the intended functionality? This happens when using Clojure 1.5.1 and 1.6.0.



 Comments   
Comment by Neil Prosser [ 02/Apr/14 4:00 PM ]

Michael Cohen has kindly created a pull request for this:

https://github.com/clojure/algo.generic/pull/4





[ALGOG-12] Implement abs, round for additional number types (patch attached) Created: 27/Aug/15  Updated: 27/Aug/15

Status: Open
Project: algo.generic
Component/s: None
Affects Version/s: None
Fix Version/s: None

Type: Enhancement Priority: Minor
Reporter: Cort Spellman Assignee: Konrad Hinsen
Resolution: Unresolved Votes: 0
Labels: None
Environment:

clojure.algo.generic 0.1.2, java 1.8


Attachments: Text File abs-round-on-more-num-types.patch    
Patch: Code

 Description   

clojure.algo.generic.math-functions/abs did not work on:
clojure.lang.Ratio
clojure.lang.BigInt
java.math.BigDecimal
java.math.BigInteger
I defined defmethods for these classes, plus one for java.lang.Number to preserve the previous functionality for other number classes.

clojure.algo.generic.math-functions/round did not work on
clojure.lang.Ratio
clojure.lang.BigInt
java.math.BigDecimal
java.math.BigInteger
the various java integer classes (why shouldn't round work on integers?)
I defined defmethods to delegate java.Math.round for double and float, to act as the identity on the various integer classes, to delegate to java.math.BigDecimal#round for BigDecimal, and to cast Ratio to either a double or a BigDecimal and round it.



 Comments   
Comment by Sean Corfield [ 27/Aug/15 1:49 AM ]

I've reminded Cort that he needs to get a signed CA on file for the patch to be used.

Comment by Sean Corfield [ 27/Aug/15 6:56 PM ]

Looks like the patch is not compatible with Clojure 1.2: http://build.clojure.org/job/algo.generic-test-matrix/137/

Several Contrib projects are dropping support for 1.2 now so that's a reasonable choice if you don't want to modify the code.

Comment by Cort Spellman [ 27/Aug/15 11:40 PM ]

Looks like BigInt was introduced in Clojure 1.3: https://github.com/clojure/clojure/commits/master/src/jvm/clojure/lang/BigInt.java

What do y'all think the good approach is?





[ALGOG-5] Addition of generic modulus Created: 18/Apr/14  Updated: 18/Apr/14

Status: Open
Project: algo.generic
Component/s: None
Affects Version/s: None
Fix Version/s: None

Type: Enhancement Priority: Trivial
Reporter: Reid McKenzie Assignee: Konrad Hinsen
Resolution: Unresolved Votes: 0
Labels: None

Attachments: Text File 0001-Implement-the-modulus-operator.patch    
Patch: Code

 Description   

I suggest that the modulus operator should be available as part of math-functions. The clojure.core/mod implementation is perfectly suited for use with algo.generic.arithmetic's multimethods. A proposed patch is attached.






Generated at Fri Aug 28 04:46:14 CDT 2015 using JIRA 4.4#649-r158309.