##- # Author: Brian Tiffin # Dedicated to the public domain # # Date: September 2016 # Modified: 2016-10-03/23:17-0400 ##+ # # return.icn, demonstrate how return terminates a generator # procedure main() every write(r := subproc()) # set an exit code from last given result; 42 exit(r) end # generate sequence 1 to n, until the result of that sequence hits 3 procedure subproc() suspend i := !seq() do { if i = 3 then return 42 } end