Path: utzoo!utgpu!jarvis.csri.toronto.edu!rutgers!tut.cis.ohio-state.edu!ucbvax!SOPHIST.UCHICAGO.EDU!goer From: goer@SOPHIST.UCHICAGO.EDU (Richard Goerwitz) Newsgroups: comp.lang.icon Subject: return expressions Message-ID: <8907100740.AA01903@sophist.uchicago.edu> Date: 10 Jul 89 07:40:32 GMT Sender: daemon@ucbvax.BERKELEY.EDU Distribution: inet Organization: The Internet Lines: 35 Why doesn't the following program output "go"? procedure main() write(writeit()) end procedure writeit() (return \stopit) return "go" end I figured that the variable stopit, being null, would cause the return expression in which it is mentioned to fail. This would result only in expression failure, however, and not in failure of the entire procedure. I expected that control would then pass to the next return expression, which would return the string "go" - the string that would ultimately be written to the stdout by the write function in the main procedure. It looks, however, as though the expression return \stopit is the same as fail at least in this instance, where \stopit fails. Why is this so? Why doesn't the program simply print "go"? -Richard L. Goerwitz goer@sophist.uchicago.edu rutgers!oddjob!gide!sophist!goer