Nice NEWS,1.66,1.67
Daniel Bonniot <[email protected]>
| Newsgroups | gmane.comp.lang.nice.cvs |
|---|---|
| Message-ID | <[email protected]> |
Update of /cvsroot/nice/Nice
In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv18310
Modified Files:
NEWS
Log Message:
Allow value returns in void methods. We don't need to distinguish between
real and "fake" (sugared) returns.
Index: NEWS
===================================================================
RCS file: /cvsroot/nice/Nice/NEWS,v
retrieving revision 1.66
retrieving revision 1.67
diff -C2 -d -r1.66 -r1.67
*** NEWS 7 Mar 2005 10:32:10 -0000 1.66
--- NEWS 7 Mar 2005 17:10:54 -0000 1.67
***************
*** 16,19 ****
--- 16,41 ----
becouse Nice will detect that "instance" is of a "sure type"
after the "instance = new Foo();" assignment.
+ * Allow value returns in void methods. It's useful when exiting from
+ the method in a branch after doing a single operation. For instance,
+ instead of:
+
+ void add(int x)
+ {
+ if (x == 0)
+ {
+ buffer.append("ZERO\n");
+ return;
+ }
+ ...
+ }
+
+ one can now more simply write:
+
+ void add(int x)
+ {
+ if (x == 0)
+ return buffer.append("ZERO\n");
+ ...
+ }
--
-------------------------------------------------------
SF email is sponsored by - The IT Product Guide
Read honest & candid reviews on hundreds of IT Products from real users.
Discover which products truly live up to the hype. Start reading now.
http://ads.osdn.com/?ad_id=6595&alloc_id=14396&op=click