Re: Precise types & retyping
Isaac Gouy <[email protected]>
| Newsgroups | gmane.comp.lang.nice.general |
|---|---|
| Message-ID | <[email protected]> |
> 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? > Ha, I see. Yes, I guess you could write a utility that prints > retyping templates for all methods in your library, and then you > manually adjust them as needed. > > Alternatively, it might be more efficient to use the retyping policy > statements, and then go through the API docs, and only list those > methods that need it. Until the retyping policy statements are available, generating templates seems the practical approach. > 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). The idea of retyping the SWT packages by hand isn't appealing. __________________________________ Do you Yahoo!? Yahoo! Mail SpamGuard - Read only the mail you want. http://antispam.yahoo.com/tools ------------------------------------------------------- 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