Quoting Isaac Gouy <[email protected]>:
> > What's wrong with alike?
>
> It's an adjective, in Nice we use it as a pronoun.
Worse, it is a language keyword which only makes sense for the Java
methods-inside-classes syntax, but supports a concept that Java doesn't support.
> > And it's not like something terrible will happen if you mistake one
> > for the other, either while reading or while writing the code.
>
> If that was the case then why have "let" at all?
> Presumably we think it will help prevent errors.
You need "let" so that you can have type inference for local variables:
let x = 5; // okay, infer x's type
y = 5; // error, y is undeclared
You also need "let" any time you would normally use "final" in Java for a
field/variable. But, it doesn't work for parameters (e.g. int f(final int x) {
... }).
> > While, to make a comparison, something "terrible" can happen if you
> > intend to implicitely override a method, but for some reason fail to
>
> Yes, that would definitely be a mistake. The question is where to catch
> the mistake. It seems that in some circumstances the compiler will be
> able to detect this, and in others it won't. (I may have intended to
> override the method in a subtype, the method is already covered by
> supertype implementations.)
We discussed this in the covariant return type thread. Like I said there, I
would prefer to explicitly say "I am declaring a new method" and then have
specializations be implicit. Overloading is just a special case of "I am
declaring a new method." I think the syntax I suggested was:
method int foo(int y);
Also, I proposed an explicit syntax for specializing a generic function declared
in another package that was analogous to the syntax for declaring a subclass of
a class (in another package).
- Brian
-------------------------------------------------------
SF.Net is sponsored by: Speed Start Your Linux Apps Now.
Build and deploy apps & Web services for Linux with
a free DVD software kit from IBM. Click Now!
http://ads.osdn.com/?ad_id=1356&alloc_id=3438&op=click
lmpx.com only provides a reader for public news (NNTP) servers. It is not
affiliated with the servers or forums shown here and is not responsible for
the content of articles, which is written by their respective authors.