Path: utzoo!utgpu!news-server.csri.toronto.edu!cs.utexas.edu!usc!elroy.jpl.nasa.gov!sdd.hp.com!ucsd!ucbvax!mis.mcw.edu!TENAGLIA From: TENAGLIA@mis.mcw.edu (Chris Tenaglia - 257-8765) Newsgroups: comp.lang.icon Subject: final language construct Message-ID: <87FEAFB0806007E3@mis.mcw.edu> Date: 26 Nov 90 14:17:00 GMT Sender: daemon@ucbvax.BERKELEY.EDU Distribution: inet Organization: The Internet Lines: 31 Icon is a pretty nifty programming language. I like and use the 'initial' construct. But sometimes I wished I had a 'final' construct. This may be a crummy example, but it illustrates the concept of the final pass through a procedure. Perhaps this isn't even implementable? Any comments on it's usefullness or implementation problems? procedure print(fo,line) static ff, pageno, line_count initial { ff := "" pageno := 0 line_count := 0 } if (line_count -:= 1) < 0 then { write(fo,ff,"title line ",(pageno +:= 1)) line_count := 55 ff := "\f" } write(fo,format(line)) final { output_summary() } end Chris Tenaglia (System Manager) | Medical College of Wisconsin 8701 W. Watertown Plank Rd. | Milwaukee, WI 53226 (414)257-8765 | tenaglia@mis.mcw.edu, mcwmis!tenaglia