Path: utzoo!utgpu!jarvis.csri.toronto.edu!rutgers!tut.cis.ohio-state.edu!ucbvax!naucse.UUCP!sbw From: sbw@naucse.UUCP (Steve Wampler) Newsgroups: comp.lang.icon Subject: Re: return expressions Message-ID: <8907102139.AA04164@naucse> Date: 10 Jul 89 21:39:04 GMT Sender: daemon@ucbvax.BERKELEY.EDU Distribution: inet Organization: The Internet Lines: 43 On Jul 10 at 1:54, Richard Goerwitz writes: } } Why doesn't the following program output "go"? } } procedure main() } write(writeit()) } end } } procedure writeit() } (return \stopit) } return "go" } end } } 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"? } One thing to keep in mind is that 'return' is a control regime and not an operator. While I can see arguments for the behavior of 'return' going either way, I prefer it the way it is, as I more often write things like: return f(x) where I want the current function to fail if f(x) fails. You might see if the control regime suspend \stopit fits with what you're trying to do... -- Steve Wampler {....!arizona!naucse!sbw}