[Swift-devel] Standard Library, take II

Mihael Hategan hategan at mcs.anl.gov
Mon Feb 2 01:01:10 CST 2015


Hi,

This is to summarize what maybe we might agree on so that we can wrap
things up a bit.

For the immediate purpose of having a standard library:
- allow overloading for library functions; we already allow it to some
extent, so I don't see much reason why we should cherry-pick
- any user function with the same name as an already defined function
(user or library) is a compile-time error; this is no different from
what is currently happening

For the future maybe, with the will of the gods of software engineering:
- allow overloading of user-defined functions
- any overloads that can potentially be ambiguous should generate a
compile-time error (aka. when {positionals1} = {positionals2} and
{keywords1} ∩ {keywords2} != 0).
- support function pointers/references
- unqualified references to overloaded functions are compile-time errors
- support lambda expressions
- possible support for overloaded function reference disambiguation
(e.g. casting, inference; exact method TBD).

Do we have agreement on the first part? The second isn't relevant for
the task at hand, but I thought I'd mention it.

Mihael




More information about the Swift-devel mailing list