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

Matt Frantz commented on TINKERPOP3-761:
----------------------------------------

I didn't know about the {{fold}} overloads.  Makes sense.

I prefer organizing the various functions as enums instead of adding more 
steps, but this is more of an API aesthetics and testability issue.  Consider 
that we made the choice with the {{is}} step to compose with {{P}} instead of 
flattening into {{isEq}}, {{isNeq}}, {{isInside}}, etc.  We can document and 
test the {{P}} API independently, and then document and test the {{is}} API 
without permuting the various combinations with {{P}}.

There are some functions that feel "obvious" for inclusion (min, max), but 
others that are less obvious (stddev, median, histogram).  How do we decide 
which to promote to steps?  When you're learning the language, and you find 
{{min}} but not {{variance}}, where do you look?  Having two categories can be 
confusing.

When we solve DSL's, then perhaps the math/reduce steps could be provided as a 
mix-in, but the canonical form would be {{fold(seed,op)}}.


> Some basic mathematical functions / steps
> -----------------------------------------
>
>                 Key: TINKERPOP3-761
>                 URL: https://issues.apache.org/jira/browse/TINKERPOP3-761
>             Project: TinkerPop 3
>          Issue Type: Improvement
>          Components: process
>    Affects Versions: 3.0.0-incubating
>            Reporter: Daniel Kuppitz
>            Assignee: Marko A. Rodriguez
>
> Every once in a while I wish to have steps for some basic mathematical 
> operations ({{add()}}, {{sub()}}, {{mul()}}, {{div()}}). Since {{sub(num)}} 
> is the same as {{add(-num)}} and {{div(num)}} is the same as {{mul(1/num)}}, 
> we would only need two new step implementations.
> Oh, and then there's also {{mod()}}, thus 3 new step implementations.



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

Reply via email to