[swift-evolution] Promote "primitive" types to enums in extensions
Carlos Rodríguez Domínguez
carlos at everywaretech.es
Fri Mar 25 11:09:06 CDT 2016
(Recalling from the other thread…)
Well, it might be both an external annotation on C code and something specific within swift. The first is interesting when you have access to the C source code, but the later is good if you either don’t have access to the C source code, or the code (swift, objective-c, C, etc.) is autogenerated by an external tool (for instance, CoreData tools).
> El 25 mar 2016, a las 14:20, Andrey Tarantsov <andrey at tarantsov.com> escribió:
>> I think I may be similarly misunderstanding your proposal; your intention then is to import the type as an enum with raw value (to facilitate the conversion to/from the C code) but without exposing that raw value on the Swift side?
>> In that case I think I’m in favour.
> Me too.
> But perhaps not through the originally proposed syntax. I don't think this is an extension — it's more of an external annotation on C code, something that we don't currently support for user code. (My understanding is that they have it implemented for Apple frameworks.)
> Perhaps, with Swift 3 going Linux, with should expose the ability to annotate external code to the users? And enum importing could be a part of that.
More information about the swift-evolution