Path: utzoo!utgpu!news-server.csri.toronto.edu!cs.utexas.edu!usc!sdd.hp.com!ucsd!ucbvax!SKYLER.MAVD.HONEYWELL.COM!djbailey From: djbailey@SKYLER.MAVD.HONEYWELL.COM ("BAILEY, DON") Newsgroups: comp.lang.icon Subject: Re: final clause Message-ID: <9011281651.AA25093@megaron.cs.arizona.edu> Date: 28 Nov 90 15:49:00 GMT Sender: daemon@ucbvax.BERKELEY.EDU Distribution: inet Organization: The Internet Lines: 18 Has anyone else suggested the simple brute force solution to implementing a "final" clause? Just push your program down a level in the calling sequence. For example, procedure main(args) # my_real_program(args,final_parameter_list) do_final_work(final_parameter_list) end The real program can have an initial clause if it really needs it. Whenever it finishes, "do_final_work" will be called. At worst, you have to make some extra data global and deal with the success or failure of your program. This approach lets you invoke different final processing, by adding an "if", depending on success or failure or a state variable you pass back up. -- Don J. Bailey (djbailey@skyler.mavd.honeywell.com)