You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@tinkerpop.apache.org by "Marko A. Rodriguez (JIRA)" <ji...@apache.org> on 2015/06/03 04:10:49 UTC

[jira] [Commented] (TINKERPOP3-673) limit(local, 1) should emit element, not List

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

Marko A. Rodriguez commented on TINKERPOP3-673:
-----------------------------------------------

Can you provide a pull request for this [~mhfrantz]?

> limit(local, 1) should emit element, not List
> ---------------------------------------------
>
>                 Key: TINKERPOP3-673
>                 URL: https://issues.apache.org/jira/browse/TINKERPOP3-673
>             Project: TinkerPop 3
>          Issue Type: Improvement
>          Components: process
>            Reporter: Matt Frantz
>
> The philosophy of the TP3 API is "containers only when necessary".  There is a tendency to eschew the container when its size would be one.
> For example, {{select("foo")}} will not emit a {{Map}} with a single key/value, but instead will emit a single value.  Similarly, if any {{select}} of a step label finds only a single instance of that step in the path, it will emit the value at that step; only if multiple steps in the path have the same label will a {{List}} be created.
> In that spirit, {{limit(local, 1)}} should emit an element, rather than a one-element {{List}}.
> This would also mean that {{range(local)}} operating on a {{List}} would emit a single element if the number of elements is selected by the range is 1.
> This would also reconcile the behavior with the {{tail}} step.



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