[Swift-devel] Call function.

Mihael Hategan hategan at mcs.anl.gov
Mon Aug 15 01:20:03 CDT 2011


On Mon, 2011-08-15 at 11:26 +0530, Yadu Nand wrote:
> > What if I have two functions:
> > (type1) f(type2)
> > (type4) f(type5)
> > ?
> 
> Wouldn't the second definition overwrite the first ? In effect only the
> second one would be valid unless ofcourse the checks for redefinition
> of procedures has gone into trunk and made this illegal.
> Or , did you mean something else ?

(type1) f(type2)
(type4) g(type5)

The point is that the signature of map() will need to accommodate both
if it was to be general enough. So you'd need something like generics:

T[] map(T proc(S), S[]);

where T and S are not concrete types.





More information about the Swift-devel mailing list