[Swift-devel] sanity check on expected behaviour

Ben Clifford benc at hawaga.org.uk
Tue Apr 10 00:18:40 CDT 2007


I have the following.

$ cat b.swift

type file {};

p(file i) {
print(@filename(i));
}

file q <"volume.blah">;

p(q);

$ swift b.swift
Swift V 0.0405
RunID: 7kplmgxingky0
q

I was expecting the printed outptu to be "volume.blah" rather than "q".

It looks like @functions that are used as parameters to a procedure 
(rather than as parameters to a mapper inside a <mapper> block) don't get 
passed through properly in the .xml to .kml translation - instead it looks 
like the function is ignored and the parameter passed on, so that this 
definition of p() compiles to exactly the same .kml code as the one above:

p(file i) {
print(i);
}

I guess either the compiler should warn of this rather than continuing 
silenty, or (more preferably, I think) @functions should actually work in 
this context.

-- 



More information about the Swift-devel mailing list