[Swift-devel] Re: mapper syntax

Ben Clifford benc at hawaga.org.uk
Sat Jul 7 02:38:14 CDT 2007



On Tue, 3 Jul 2007, Ben Clifford wrote:

> The syntax:
> 
>   imagefiles if[] 
> <my_mapper;foo=@strcat(filename,blah),otherparm=true,moreparams=false>;
> 
> is rather noisy all on one line.
> 
> A syntax change could be to express the above as:
> 
>   imagefiles if[] map my_mapper {
>     foo = @strcat(filename,blah);
>     otherparam = true;
>     moreparams = false;
>   };

I realised the present syntax admits enough whitespace for a multi-line 
representation, thusly:

foreach s in array {
  messagefile outfile <
      single_file_mapper;
      file=@strcat("051-foreach.",s,".out")
     >;
  outfile = greeting(s);
}

-- 



More information about the Swift-devel mailing list