Path: utzoo!utgpu!jarvis.csri.toronto.edu!cs.utexas.edu!tut.cis.ohio-state.edu!ucbvax!CS.ARIZONA.EDU!ralph From: ralph@CS.ARIZONA.EDU ("Ralph Griswold") Newsgroups: comp.lang.icon Subject: Re: generation of procedures Message-ID: <9002071611.AA13262@megaron.cs.arizona.edu> Date: 7 Feb 90 16:11:17 GMT References: <9002071557.AA01397@zk.cray.com> Sender: daemon@ucbvax.BERKELEY.EDU Distribution: inet Organization: The Internet Lines: 20 The procedures are generated by !plist as you surmised. The first one is then applied to the argument list, resulting in a procedure call. If that call fails, !plist is resumed to produce another procedure. Think of a procedure call as e0(e1, e2, ..., en) The order of evaluation is e0, e1, e2, ..., en. If all succeed, the value of e0 is applied to the values of e1, e2, ..., en. If the resulting procedure call fails, en, ..., e2, e1, e0 are resumed in that order (assuming they suspended). If any produces a new result, evaluation starts to the right again. In the case you cite, only e0 is a generator, so failure of the procedure call causes e0 to produce another procedure, which is then applied to the arguments. If any of the procedure calls fails, the process stops, since there is nothing to drive further generation. The effect is to apply the procedures in plist until one succeeds. Ralph Griswold / Dept of Computer Science / Univ of Arizona / Tucson, AZ 85721 +1 602 621 6609 ralph@cs.arizona.edu uunet!arizona!ralph