Deprecated argument names

spir denis.spir at gmail.com
Tue Mar 8 05:04:39 PST 2011


On 03/08/2011 09:29 AM, bearophile wrote:
> I don't know much about Scala language, so I've found this small funny thing in the Lambda the Ultimate blog. In Scala parameter names can be deprecated:
>
> def somefunction(@deprecatedName('x) y: Int) = ...
>
> This gives deprecation warning to callers using the parameter name x.
>
>
> More info. In Scala annotations are user-defined, I presume, have methods, etc.:
>
> http://www.scala-lang.org/archives/downloads/distrib/files/nightly/docs/library/scala/deprecatedName.html
>
> This helps against one of the problems Don has with named arguments.

I read 2-3 times Walter thinks warnings are bad. Things are either correct, or 
not. Right, I can understand; if the language is correctly designed, then there 
is no true "grey zone" (think C's numerous unsafe/border uses).
But language changes are not about correct/incorrect language use by 
programmers; instead, their use is initially correct. When the language itself 
evolves, precisely, warnings are a great tool to help evolving a code base 
synchronely (this is also attested by other languages).
Since D evolves fast, there could easily be hordes of warnings, which could 
turn very annoying. There should be a compilation setting (config file and/or 
command-line) turning off given warnings.

Denis
-- 
_________________
vita es estrany
spir.wikidot.com



More information about the Digitalmars-d mailing list