[Swift-devel] simple parameter test hangs

Ben Clifford benc at hawaga.org.uk
Fri Oct 5 03:01:17 CDT 2007


what you have there is what as been described in the past as the 'array 
closing problem'. its a messy interaction of the below syntax and 
single-assignment semantics.

pecho will get called only when z has had its 'single value assigned'. 

However the implementation has a slightly strange mechanism for deciding 
when an array has had its entire single value assigned - it does this when 
an array is returned from a procedure.

Try moving the z[n] assignments into a procedure.

This is something that needs fixing.

On Thu, 4 Oct 2007, Michael Wilde wrote:

> -- the following program hangs (using 0.3):
> 
> type messagefile;
> 
> type params {
>   int x;
>   int y;
> }
> 
> (messagefile t) pecho (params p[] ) {
>     app {
>         echo p[0].x p[0].y stdout=@filename(t);
>     }
> }
> 
> messagefile outfile <"hello2.txt">;
> 
> params z[];
> z[0].x = 111;
> z[0].y = 222;
> 
> outfile = pecho(z);
> 
> -- while this one works:
> 
> type messagefile;
> 
> type params {
>   int x;
>   int y;
> }
> 
> (messagefile t) pecho (params p) {
>     app {
>         echo p.x p.y stdout=@filename(t);
>     }
> }
> 
> messagefile outfile <"hello2.txt">;
> 
> params z;
> z.x = 111;
> z.y = 222;
> 
> outfile = pecho(z);
> 
> -- swift says:
> 
> $ swift t2.swift
> Swift v0.3 r1319 (modified locally)
> 
> RunID: 20071004-2312-mlnzad63
> 
> (and then it hangs)
> 
> -- heres the log:
> $ more t2-20071004-2312-mlnzad63.log
> 2007-10-04 23:12:43,147-0500 INFO  Loader t2.swift: source file is new.
> Recompiling.
> 2007-10-04 23:12:45,431-0500 INFO  Karajan Validation of XML intermediate file
> was succ
> essful
> 2007-10-04 23:12:48,744-0500 INFO  unknown Using sites file:
> /home/wilde/swift/vdsk-0.3
> /bin/../etc/sites.xml
> 2007-10-04 23:12:48,745-0500 INFO  unknown Using tc.data:
> /home/wilde/swift/vdsk-0.3/bi
> n/../etc/tc.data
> 2007-10-04 23:12:50,769-0500 INFO  unknown Swift v0.3 r1319 (modified locally)
> 
> 2007-10-04 23:12:50,772-0500 INFO  unknown RunID: 20071004-2312-mlnzad63
> $
> 
> --
> java doesnt seem to be burning cpu - looks more like a hang than a loop;
> doesnt seem to be waiting on stdin either, as far as i can tell.
> 
> 
> _______________________________________________
> Swift-devel mailing list
> Swift-devel at ci.uchicago.edu
> http://mail.ci.uchicago.edu/mailman/listinfo/swift-devel
> 
> 



More information about the Swift-devel mailing list