commons-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Benedikt Ritter <brit...@apache.org>
Subject Re: svn commit: r1584206 - /commons/proper/compress/trunk/src/main/java/org/apache/commons/compress/archivers/sevenz/Coders.java
Date Thu, 03 Apr 2014 10:14:37 GMT
2014-04-03 12:05 GMT+02:00 Stefan Bodewig <bodewig@apache.org>:

> On 2014-04-03, Benedikt Ritter wrote:
>
> > I didn't now that '_' is a valid identifier at all.
>
> That's a different point. :-)
>
> _ is used as an identifier in many funtional languages to mean "any
> argument, I don't care for it anyway" when you need to have an argument
> for a certain contract but won't use it.  This is exactly what I used it
> for in the code Emmanuel changed.
>

How about changing the name to "ignored" then?

Benedikt


>
> In other contexts _ means "anything" when used for pattern matching.
> You'll see that in Scala or F# or other ML inspired languages as well as
> in Haskell.
>
> When used with the correct settings the C# compiler will complain about
> method arguments that you don't use and if you prefix the argument name
> by a _ (or just use _ if there is only one such argument) it will no
> longer complain.  I think this is where I finally picked up the habit.
>
> So I'm suprised Java8's compiler complains, I don't think it has done so
> before or I would have noticed.
>
> Stefan
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: dev-unsubscribe@commons.apache.org
> For additional commands, e-mail: dev-help@commons.apache.org
>
>


-- 
http://people.apache.org/~britter/
http://www.systemoutprintln.de/
http://twitter.com/BenediktRitter
http://github.com/britter

Mime
  • Unnamed multipart/alternative (inline, None, 0 bytes)
View raw message