[Swift-devel] Re: Swift Error! Round 2

Ben Clifford benc at hawaga.org.uk
Wed Oct 10 18:50:56 CDT 2007



On Wed, 10 Oct 2007, Michael Wilde wrote:

> If this causes the function to hang, I'd like to try to isolate this into a
> simple test case.
> 
> Is the reason obvious to you?

You've got stuff put in one place - a file, mapped by the mapper assigned 
to the feature variable.

Then you use = to 'assign' that to another place - a different file, 
mapped by the mapper assigned to the array.

What does that mean? make a copy of the file? Its not defined in the 
present implementation.

Two options: one is properly prohibit this usage of = and give a proper 
error message; another is to copy the RHS file to the LHS. But that's 
probably messy in the case of more elaborate structures than single files.

> Is it possible to apply a mapper to the entire array fs[] to specify a 
> specific pattern for the names of the output files that are placed in 
> it?

There is a mapper assigned to the entire array - its implicit because it 
isn't specified in the SwiftScript source, and will give filenames that 
have a particular base name and also the array index of the relevant array 
element. You can attach whatever mapper you want, though for the behaviour 
of spreading files between multiple directories, none of the default 
mappers will do.

-- 



More information about the Swift-devel mailing list