[swift-evolution] #pragma

Félix Cloutier felixcca at yahoo.ca
Sun Sep 4 19:15:51 CDT 2016


There is a *lot* more to `#pragma` than `#pragma mark`, but it's unclear to me what other pragma anyone would bring over from C. Given that, I'm not in favor of a new language construct for just one thing that's not horribly out of place as a comment.

Félix

> Le 4 sept. 2016 à 15:53:46, isidoro carlo ghezzi via swift-evolution <swift-evolution at swift.org> a écrit :
> 
> Hi all,
> 
> I think the "old style" `#pragma` is necessary in Swift.
> Exactly in the same way it is available in C/C++ or Objective-C/C++, or in something else portable way.
> 
> Because `#pragma` is not handled in Swift, in Xcode they overloaded the semantic of comments, giving to the comment `// MARK:` the semantic of `#pragma mark`
> 
> But my point of view is that, I would like that what it is written in a source comment (what it is written after a // or between /* */ ) should be fully ignore by compiler or IDE.
> 
> I understand that maybe a compiler shouldn't lose time handling `#pragma options`, but giving semantics to source comment, I think it can be dangerous and misunderstood.
> 
> The implementation in Swift compiler should be simple, ignoring any line beginning with `#pragma` (ok I know It is not simple)
> The IDE will handle the `#pragma`
> 
> That's why they invented `#pragma`in C/C++ Objective-C/C++ right?
> 
> Thanks for your attention, and sorry for my bad english: I am Italian native spoke language.
> 
> #pragma mark - sign
> Best Regards,
> Isidoro Ghezzi
> 
> 
> _______________________________________________
> swift-evolution mailing list
> swift-evolution at swift.org
> https://lists.swift.org/mailman/listinfo/swift-evolution

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


More information about the swift-evolution mailing list