[swift-evolution] Proposal Idea : Library (third party) Importable Checking

Jo Albright me at jo2.co
Sat Jan 16 11:25:35 CST 2016


Sad news. Thanks for looking into it.

Designer . Developer .  Nerd 
Jo Albright


> On Jan 15, 2016, at 2:46 PM, Joe Groff <jgroff at apple.com> wrote:
> 
> 
>> On Jan 14, 2016, at 11:17 PM, Félix Cloutier <felixcca at yahoo.ca <mailto:felixcca at yahoo.ca>> wrote:
>> 
>> If it's meant to be included in a library, don't we need a linkage mechanism that will expose these symbols only if another library is linked in?
> 
> I see, that's the part I missed. If you wanted these symbols to be conditionally available, that would indeed require a new language, and probably dynamic linker, feature. You could however manage this without any new features, by adding the extensions in a third library dependent on the two base libraries.
> 
> -Joe
> 
>> Félix
>> 
>>> Le 15 janv. 2016 à 01:43:16, Jo Albright via swift-evolution <swift-evolution at swift.org <mailto:swift-evolution at swift.org>> a écrit :
>>> 
>>>> Interesting idea. Unless I'm misunderstanding something, it seems to me you could kill both birds with one stone. If we add an 'importable' predicate to the '#if' language, then you can already use that to conditionalize the import:
>>>> 
>>>> #if importable(ThirdPartyLibrary)
>>>> import ThirdPartyLibrary
>>>> /* decls that depend on library */
>>>> #endif
>>>> 
>>>> -Joe
>>> 
>>> 
>>> I am totally on board with that idea… since you could declare a type outside of the “#if importable” scope and add an extension inside the scope.
>>> 
>>> Designer . Developer .  Nerd 
>>> Jo Albright
>>> 
>>> 
>>> 
>>> _______________________________________________
>>> swift-evolution mailing list
>>> swift-evolution at swift.org <mailto:swift-evolution at swift.org>
>>> https://lists.swift.org/mailman/listinfo/swift-evolution <https://lists.swift.org/mailman/listinfo/swift-evolution>
>> 
> 

-------------- next part --------------
An HTML attachment was scrubbed...
URL: <https://lists.swift.org/pipermail/swift-evolution/attachments/20160116/dd6043df/attachment.html>


More information about the swift-evolution mailing list