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

Matt Frantz commented on TINKERPOP3-673:
----------------------------------------

[~okram] I will able to work on this issue this week.

[~mpollmeier] Since the number of elements is static, the type can be known 
when the traversal is built, but it must be specified explicitly.  It is one of 
the consequences of the "containers only when necessary" philosophy.  For 
{{select}}, it is more complicated; see TINKERPOP3-639 for a discussion.

[~dkuppitz] If the list is initially empty, we would stop traversing (by 
raising {{FastNoSuchElementException}}).  That is also consistent with {{tail}}.


> 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)

Reply via email to