Hugh Sasse Staff Elec Eng <hgs / dmu.ac.uk> writes:

> Yes, it was me.  "wants" should be "wants discussion on" -- I've not
> really got to grips with Icon enough to say how useful this would be,
> or if/why it might be better, but I find the idea of a function returning
> a succession of values to be 'clean', 'aesthetically pleasing' etc --
> i.e reasons hard to rationalise.  I've nothing against yield, by the way.

What triggers the creation of a new set of state for this function:
does each call site get its own, or is it based on scope. For example, 
say we had a function 'fib' that returned successive Fibonacci
numbers.

   loop do
     n = fib()
     break if n > 1000
     puts n
   end

Then we decide to refactor this to get rid of the break:

   n = fib()
   while n <= 1000
     puts n
     n = fib()
   end

Would you expect this to work, or would get expect to get an
additional '1' at the start of the sequence?

Regards


Dave