[Swift-devel] Re: arrays of structures and building them in SWIFT

Ben Clifford benc at hawaga.org.uk
Sun May 4 17:31:03 CDT 2008


> E.g., if the directory contains
> 
> file1.Head file1.BRIK, file2.Head file2.BRIK
> 
> The mapper will map files to my complex type:
> mytype t;
> t[0].head = file1.HEAD
> t[0].brik = file1.BRIK
> t[1].head = file2.BRIK
> t[1].brik = file2.BRIK
> and I will be able to pass this to calls as MyCall(t[0])
> [to the best of my understanding, I can achieve this now with csv mapper,
> but not via any other way unless I write a custom mapper, java?]

You should be able to map this with simple_mapper too. Something like 
this:

type t { file HEAD; file BRIK; }
t inp[] <simple_mapper;prefix="file">;

> But this doesn't take care of the other use of types that  I planned on,
> which is using them as a placeholder for results of calls.

This bit I'll think about - similar, but not the same, stuff has been done 
before.

-- 




More information about the Swift-devel mailing list