[Swift-devel] array_mapper hangs
wilde at mcs.anl.gov
wilde at mcs.anl.gov
Sat Mar 20 10:13:17 CDT 2010
I think the script is hanging because its trying to return physD[] without ever setting the return array parameter physD (or any member of it):
app (file physD[]) maptest(){
> touch @filename(physD[0]) @filename(physD[1]);
> }
The following examples don't use @filename in maptest. am3.swift hangs, am4.swift works. The difference is that am4 puts a value in f[] and am3 does not.
::::::::::::::
am3.swift
::::::::::::::
type file;
app (file physD[]) maptest() {
echo "hi";
}
file f[];
f = maptest();
::::::::::::::
am4.swift
::::::::::::::
type file;
app (file o) echo (string s) { echo s stdout=@o; }
(file physD[]) maptest() {
physD[0] = echo("hi");
}
file f[];
f = maptest();
$
----- "Ben Clifford" <benc at hawaga.org.uk> wrote:
> > The script is hanging because its trying to access the values of the
>
> > array object f[], which is never set. Ie, at the point at which it
> wants
> > a value for physD[0] and physD[1], physD itself - even though it has
>
> > been *mapped* - has never been given a *value.
>
> Sarah's script doesn't ask for the values of physD[i]. It asks for the
>
> @filename of them. That 'should' work for anything that has been
> mapped
> even if it doesn't have a value.
>
> --
--
Michael Wilde
Computation Institute, University of Chicago
Mathematics and Computer Science Division
Argonne National Laboratory
More information about the Swift-devel
mailing list