[swift-evolution] [Pitch] Support for pure functions. Part n + 1.

Anton Zhilin antonyzhilin at gmail.com
Fri Feb 17 10:18:34 CST 2017


I didn’t mean to emphasize any specific syntax. I’m fine with either @const,
@constexpr, @pure or =>.
Anyway, I see no reason why generic functions shouldn’t be supported in any
of the suggested models.

2017-02-17 19:08 GMT+03:00 Abe Schneider <abe.schneider at gmail.com>:

+1. I think this is a great idea. As I was following this thread, I
> was wondering if someone might suggest the C++ constexpr syntax.
>
> Would this support generics? E.g. could you do:
>
>     @constepxr
>     func foo<S>(a:S, b:S) {
>        return a+b
>     }
>
> and have that be done at compile time? While this could potentially
> add a huge amount of complication on the backend, I could this as
> being useful (also related to my previous postings as to having a way
> of determining generic types at compile time).
>
​
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <https://lists.swift.org/pipermail/swift-evolution/attachments/20170217/87d75790/attachment.html>


More information about the swift-evolution mailing list