Re: suggestions for newbee

Daniel Bonniot <[email protected]> Thu, 07 Jul 2005 11:58:44 +0200
Newsgroups gmane.comp.lang.nice.general
Message-ID <[email protected]>
> ??
> Why 'Type inference' couldn't be use without "var" or "let" ? Compiler 
> could detect first usage of a local variable ?

If you mean that variables would be declared implicitely, the problem is that 
any typo would result in the creation of a new variable, without any warning.

var and let are precisely the concise way to declare: "here is a new variable".

>> let l = new ArrayList();
>> // l has type ArrayList<T> for some T which will be discovered later
> 
> 
> details ?

let l = new ArrayList();
// l has type ArrayList<T> for some T which will be discovered later

l.add("ABC"); // OK, now the compiler knows T=String
l.add(0); // type error

> Sorry I misunderstood, it's not arrays it's parameterized type. Does it 
> mean "let I = new ArrayList<T>()" doesn't work.

Yes, because it's not needed. The compiler can infer the type of the elements 
of the list.

> Thanks for your answers, starting with toString is a good idea, I'll 
> investigate. I also interesting by NiceDoc. I've already download the 
> zip linked in the wiki. But I've not start to learn.

Actually, this zip is outdated. If you get the source of the compiler, the 
current implementation of nicedoc is in src/nice/tools/doc

Frank, Artem, what is the status on nicedoc?

> May be I could better understand some choice with more pratical of Nice.
> 
>> In any case, please keep in touch, so that we know how you are doing 
>> and so that we can help.
>>
>> Daniel



-------------------------------------------------------
SF.Net email is sponsored by: Discover Easy Linux Migration Strategies
from IBM. Find simple to follow Roadmaps, straightforward articles,
informative Webcasts and more! Get everything you need to get up to
speed, fast. http://ads.osdn.com/?ad_id=7477&alloc_id=16492&op=click