<!DOCTYPE html><html><head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
</head>
<body>
<blockquote type="cite" cite="mid:CAL5bRt_4Lu5C7eTYEbapc8MxrmKKr6Y_a_be4LmP3dCzsrhQWQ@mail.gmail.com">
<div dir="ltr">I would just like to express some of my concerns
regarding pipe operator ( |> syntax ).</div>
</blockquote>
<p>I agree that the pipe operator proposed for JavaScript feels a
bit alien. It also doesn't mix well with normal method calls. So,
I also wouldn't take it as is. I just thought it might be
interesting that there were related discussions in another
community already, as they might get relevant if such solution
would be considered for Java.<br>
</p>
<blockquote type="cite" cite="mid:CAL5bRt_4Lu5C7eTYEbapc8MxrmKKr6Y_a_be4LmP3dCzsrhQWQ@mail.gmail.com">
<div dir="ltr">
<div><font color="#000000"><span class="gmail-p" style="background-color:transparent;font-family:inherit;font-size:inherit;font-weight:inherit;box-sizing:border-box;border-width:0px;border-style:solid;border-color:rgb(229,231,235)">Regarding traits,
I am not an expert in functional programming, but what
catches my eye right away is that, as I understand, this
approach is incompatible with var keyword.</span></font></div>
</div>
</blockquote>
<p>While I was just assigning the objects to a variable, I think
that is not a common use case. It was just the most simple use
case I could think of, which demonstrates the behavior. The <font face="monospace">var</font>-keyword would continue to resolve to
the most specific type known, i.e. <font face="monospace">Path</font>
and <font face="monospace">List<Path></font>. (Just as the
`<font face="monospace">var</font>` in `<font face="monospace">var
x = new ArrayList()</font>` resolves into <font face="monospace">ArrayList</font>, not <font face="monospace">List</font>.)<br>
</p>
<p>I think the most common use cases for Traits, just as for unions,
would be in parameters. For example, consider the Gradle API of <font face="monospace">Project.files(Object...)</font>.</p>
<blockquote>
<p><a class="moz-txt-link-freetext" href="https://docs.gradle.org/current/javadoc/org/gradle/api/Project.html#files-java.lang.Object">https://docs.gradle.org/current/javadoc/org/gradle/api/Project.html#files-java.lang.Object</a>...-</p>
</blockquote>
<p>Anyway, also note that Traits would probably deserve there own
discussion, if actually considered. I just wanted to mention them
because when implemented as Rust, they provide a solution for
extension methods which can be considered superior to the
solutions of Kotlin and some other languages. However, I am not
actually a fan of extension methods in Java, as mentioned in my
previous email.<br>
</p>
</body>
</html>