Re: Bug notices?
Posted in 1993
->>johnl@informix.com (Jonathan Leffler) writes: ->> ->>** Actually, it probably won't get outlawed -- it'd break too much code. ->> But it might well be documented that using RETURN in a report can screw ->> up aggregates, line number counts, page headers, page trailers, and ->> general report logic, not to mention the next row, and is generally ->> about as unreliable a construct as you can get. The more I look at what ->> a RETURN can do, the less I like them. ->aburt@mnemosyne.cs.du.edu (Andrew Burt) replies: -> ->Wouldn't it be better just to _fix_ return in reports? "The code is too ->ugly to allow that" is not an acceptable defense. (In defense of this, ->consider that any report with return could be rewritten without it: -> if foo then -> return -> end if -> more code ->becomes -> if not foo then -> more code -> end if ->including surrounding the code in each following "after group of", etc.) -> ->It might also be useful to have another construct, "continue report" say, ->that skips the rest of the current section (on every row, after group of, ->etc.) but jumps to the next one. alan@den.mmc.com (Alan Popiel) rushes in where angels fear to tread: I would prefer to see the RETURN in REPORTs outlawed, perhaps after some suitable warning to encourage people to update their code. Since I have written compilers, I can see that Andrew's proposed fix, of having the compiler rewrite the code, would be bug-prone at best and a disaster at worst. I think the CONTINUE REPORT concept is *much* better: It would be fully consistent with other parts of the language, and it would be easier for the compiler writers to get the aggregate processing, etc., etc., to work correctly. Regarding "suitable warning": The ANSI Fortran committee (and maybe others) uses the concept of "disparaged features". These are features that the committee thinks are *not a good idea*, but will be retained for (I think) two revisions of the standard, so that existing programs will not break. However, having a feature become "disparaged" in a software release warns programmers to try to avoid using the feature in new or reworked code, because the feature will disappear from future standards eventually. I think that this would be a fine way for Informix to phase out RETURN from REPORTs, and so forth. Regards, Alan ___________________________ ______________________| R. Alan Popiel |__________________________ \\ Internet: | Martin Marietta, Tech Ops | / \\ alan@den.mmc.com | P.O. Box 179, M/S 5422 | Std disclaimers apply. / )Voice: | Denver, CO 80201-0179 USA | ( / 303-977-9998 |___________________________| (But you knew that!) \\ /________________________) (____________________________\\