[Swift-devel] Call function.

Ben Clifford benc at hawaga.org.uk
Thu Aug 11 08:03:35 CDT 2011


> > That's moving a big jump away from compile time type checking: you 
> > can't check the return types if you don't know anything about the 
> > function to call. Does that matter for Swift? Its nice to find errors 
> > before you embark on a long run. But the strongly-typed-ness of swift 
> > doesn't otherwise seem too useful.
> Well, What I plan on doing is the first string passed to a "call" function
> will need to be a function identifier and as we translate to karajan lookup
> the type of the function and ensure that the return and input args match.

If you have an arbitrary string, you can't know what is in that string 
until runtime - potentially after a lot of other stuff has run. So you can 
only do that check at runtime - potentially after a lot of other stuff has 
run.

You will eventually be able to check - but I was mostly highlighting the 
fact that this can't happen at compile time, in general; and then asking 
(swift people in general) if compile time (i.e. start of the run) type 
checking matters here.

-- 



More information about the Swift-devel mailing list