[Swift-devel] Standard Library, take II

Tim Armstrong tim.g.armstrong at gmail.com
Mon Feb 2 15:46:48 CST 2015


I think that sounds good to me.

I think with overloading, I might attempt to implement overloading in the
generic way (such that it would support user-defined functions), but only
enable it for library functions by default.  This would let us experiment
with it to see how it works, but reduces the possibility of bugs for the
time being.

I think the keyword arguments needs some discussion.   I was thinking that
we'd have optional positional arguments only (like C++).  I think in any
case I'd like to put keyword arguments into the "future" category.  I'm
open to discussion but I think we can put that off too.

- Tim

On Mon, Feb 2, 2015 at 1:01 AM, Mihael Hategan <hategan at mcs.anl.gov> wrote:

> 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
>
> _______________________________________________
> Swift-devel mailing list
> Swift-devel at ci.uchicago.edu
> https://lists.ci.uchicago.edu/cgi-bin/mailman/listinfo/swift-devel
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.mcs.anl.gov/pipermail/swift-devel/attachments/20150202/67df389e/attachment.html>


More information about the Swift-devel mailing list