You are viewing a plain text version of this content. The canonical link for it is here.
Posted to notifications@groovy.apache.org by "Daniel Sun (JIRA)" <ji...@apache.org> on 2019/02/18 11:24:00 UTC
[jira] [Updated] (GROOVY-8998) [GEP]Concatenative Method Calls
[ https://issues.apache.org/jira/browse/GROOVY-8998?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]
Daniel Sun updated GROOVY-8998:
-------------------------------
Description:
*DRAFT*
{code:java}
// nested method calls
c(
b(
3,
a()
),
2
)
{code}
{code:java}
// method call chain
a().with {
b(3, it)
}. with {
c(it, 2)
}
{code}
{code:java}
// the following code is equal to the above code
// `_` represents the former method call result
// `|>` is like a big arrow representing the direction of data flow
a() |> b(3, _) |> c(_, 2)
{code}
discussion in the dev mailing list:
[http://groovy.329449.n5.nabble.com/GEP-Concatenative-Method-Calls-tt5747708.html]
was:
*DRAFT*
{code:java}
// nested method calls
c(
b(
3,
a()
),
2
)
{code}
{code:java}
// method call chain
a().with {
b(3, it)
}. with {
c(it, 2)
}
{code}
{code:java}
// the following code is equal to the above code
// _ represents the former method call result,
// and |> is like a big arrow representing the direction of data flow
a() |> b(3, _) |> c(_, 2)
{code}
discussion in the dev mailing list:
[http://groovy.329449.n5.nabble.com/GEP-Concatenative-Method-Calls-tt5747708.html]
> [GEP]Concatenative Method Calls
> -------------------------------
>
> Key: GROOVY-8998
> URL: https://issues.apache.org/jira/browse/GROOVY-8998
> Project: Groovy
> Issue Type: New Feature
> Reporter: Daniel Sun
> Assignee: Daniel Sun
> Priority: Major
>
> *DRAFT*
> {code:java}
> // nested method calls
> c(
> b(
> 3,
> a()
> ),
> 2
> )
> {code}
> {code:java}
> // method call chain
> a().with {
> b(3, it)
> }. with {
> c(it, 2)
> }
> {code}
> {code:java}
> // the following code is equal to the above code
> // `_` represents the former method call result
> // `|>` is like a big arrow representing the direction of data flow
> a() |> b(3, _) |> c(_, 2)
> {code}
> discussion in the dev mailing list:
> [http://groovy.329449.n5.nabble.com/GEP-Concatenative-Method-Calls-tt5747708.html]
--
This message was sent by Atlassian JIRA
(v7.6.3#76005)