[Swift-devel] Problem with iterate

Ben Clifford benc at hawaga.org.uk
Sat Feb 20 13:27:20 CST 2010


> 
> > So what would that do to SwiftScript? Well you could get rid of any 
> > partial assignment to arrays and say the equivalent of:
> 
> I think that convergence loops (i.e. "do this repeatedly until some
> non-trivial condition becomes true") would not be possible then unless
> recursion was used.

I was imagining having a high level construct to replace "iterate" that 
looks quite like iterate but is more restricted in its use eg takes a 
some (laststate -> newstate) operation (the iterate body now) and takes 
some (newstate -> boolean) operation (the until clause now).

Having provided that construct as part of SwiftScript, you wouldn't need 
recursion.

Thats a way to do things that keeps it fairly like it is now. A further 
departure from where it is now is to say "well it should be a proper 
language, and recursion shouldn't hurt".

-- 



More information about the Swift-devel mailing list