[ 
https://issues.apache.org/jira/browse/TINKERPOP3-861?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=14947812#comment-14947812
 ] 

Matt Frantz commented on TINKERPOP3-861:
----------------------------------------

I've been scratching my head over the polymorphism problem, and don't have any 
real breakthroughs.

Gremlin could define its own numeric model, e.g. "everything is the functional 
equivalent of Java's {{BigDecimal}}", which would be relatively straightforward 
to implement from a functional correctness standpoint, but may be difficult to 
optimize from a performance standpoint.

In one common use case, the specific types are not dynamic, so you would like 
for the traversal to converge on an efficient implementation of a particular 
operator, one that avoids excessive type-checking.  The {{RuntimeStrategy}} in 
TINKERPOP3-871 might help with that.

I wonder about extensibility (user-defined types), e.g. Apache Commons Math 
Fraction and Complex, or other things that act like numbers under certain 
operators such as vectors and matrices.

In situations where type coercion needs to happen, the solutions are less clear 
and start to resemble compiler logic.


> Solve "The Number Problem" for Operator (and follow on operators)
> -----------------------------------------------------------------
>
>                 Key: TINKERPOP3-861
>                 URL: https://issues.apache.org/jira/browse/TINKERPOP3-861
>             Project: TinkerPop 3
>          Issue Type: Improvement
>          Components: process
>    Affects Versions: 3.0.1-incubating
>            Reporter: Marko A. Rodriguez
>            Assignee: Daniel Kuppitz
>             Fix For: 3.1.0-incubating
>
>
> This Gist says it all.
> https://gist.github.com/dkuppitz/e589e43763a3546586b3



--
This message was sent by Atlassian JIRA
(v6.3.4#6332)

Reply via email to