You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@tinkerpop.apache.org by "xiazcy (via GitHub)" <gi...@apache.org> on 2023/07/14 18:56:32 UTC

[GitHub] [tinkerpop] xiazcy commented on pull request #2099: String manipulation function concat()

xiazcy commented on PR #2099:
URL: https://github.com/apache/tinkerpop/pull/2099#issuecomment-1636280210

   I believe I've addressed all existing comments so far. 
   
   Concat with inject is now updated to the expected behaviour:
   ```
   gremlin> g.inject('a', 'b', 'c').concat(__.inject('1', '2'))
   ==>a1
   ==>b2
   ==>c
   gremlin> g.inject('a', 'b').concat(__.inject('1', '2', '3'))
   ==>a1
   ==>b2
   ```
   Similarly for child traversals, reverted to iterating only the first result:
   ```
   gremlin> g.inject('hello', 'hi').concat(__.V().values('name'))
   ==>hellomarko
   ==>himarko
   ```
   
   > also, should concat(Traversal) be concat(Traversal...) to match the String form? this way you could concat(select('a'), select('b'), select('c')) which would match its String overload?
   
   After some thought around this, I think maybe we should not implement `concat(Traversal…)` at this point, to lessen the complexity of `concat()`.
   It’s also currently achievable by chaining concat():
   ```
   gremlin> g.V().as('a').out().as('b').out().as('c').constant("").concat(select("a").label()).concat(select("b").label()).concat(select("c").label())
   ==>personpersonsoftware
   ==>personpersonsoftware
   ```
   However, I do want to explore this avenue a bit, so if it leads somewhere I will update here or on the dev list.  
   


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: commits-unsubscribe@tinkerpop.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org