Re: Precise types & retyping

Daniel Bonniot <[email protected]>
Newsgroups gmane.comp.lang.nice.general
Message-ID <[email protected]>
Isaac Gouy wrote:

>>So yes, if you want to assert that the parameter of such method
>>cannot be null, or that the return type might be null (which will
>>enable the Nice compiler to make sure that you use them properly),
>>then you need a retyping. Or the "massive retypings" that I was
>>speaking about.
>>    
>>
>
>So, given that I wish to take advantage of the distinction between
>option types and non-null types, is it correct that the only methods I
>wouldn't retype are ones whose parameters are all primitive (or option
>type) and whose return type is void or a primitive type?
>
>I would retype any method that had a non-null parameter or a non-null
>return type, yes?
>  
>
The default is possibly-null for arguments and non-null for return 
types, so you don't need a retyping in that case either, in addition to 
the ones you mentioned.

>Until the retyping policy statements are available, generating
>templates seems the practical approach.
>  
>
Both approaches need some work, but I espect much less for the retyping 
policy one. It also leads to less work on your part, and better 
compilation-time performance (the compiler needs to parse all those 
retypings, and they force it to load the references classes, while 
otherwise it does that jobs lazilly).

So I could implement the retyping policies in priority, since it seems 
there is a current need.

>>What library are you working on? 
>>    
>>
>
>Yes I started looking at SWT (doing the obvious thing of adding Adapter
>classes to make the listeners usable in a straightforward way). 
>
You are working in coordination with Jason, then?

I registered a new project on SF to hold non-core libraries. Tell me if 
you want to start using the CVS repository to hold NiceSWT.

Daniel



-------------------------------------------------------
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.