[Swift-devel] Problem with iterate

Mihael Hategan hategan at mcs.anl.gov
Fri Feb 19 15:01:16 CST 2010


On Fri, 2010-02-19 at 17:54 +0000, Ben Clifford wrote:
> A point of information related to this discussion:
> 
> Underordered single assignment doesn't necessarily lead to deadlock in 
> general. Using Haskell, and making this mutually recursive definition of x 
> and y.
> 
> f l = 1 : l     -- if you like lisp,  1:l means (cons 1 l)
> 
> x = f y
> y = f x
> 
> main = print x
> 
> x and y are both infinite lists [1,1,1,1,1,1,1,1,1,1,1,1,1,...] (so 
> running the above code prints out a never-ending (until ctrl-c) list of 
> 1,1,1,1,...)

What difference does that make? To the outside observer both programs
hang.




More information about the Swift-devel mailing list