<div dir="ltr">Not exactly; backticks are for making an identifier out of something that's not normally an identifier. Most other reserved words are used in control flow & other declarations. Rarely do they actually represent identifiers/values that you can work with.<div><div><br></div><div>The docs also say "The backticks are not considered part of the identifier; `x` and x have the same meaning." Thus `self` and self should have the same meaning. Assigning to `self` is the same as assigning to self, which intentionally isn't allowed. Backticks shouldn't allow you to circumvent that.</div><div class="gmail_extra"><br clear="all"><div><div><div dir="ltr"><div>Jacob<br></div></div></div></div>
<br><div class="gmail_quote">On Wed, Jan 6, 2016 at 12:50 PM, Paul Cantrell <span dir="ltr"><<a href="mailto:paul@innig.net" target="_blank">paul@innig.net</a>></span> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><div style="word-wrap:break-word"><div>Ummm … isn’t that _exactly_ what backticks are for? From the docs:</div><div><br></div><div><span style="color:rgb(65,65,65);font-family:Helvetica,Arial,sans-serif;font-size:14px;background-color:rgb(255,255,255)"> To use a reserved word as an identifier, put a backtick (</span><code style="border:0px;font-size:0.85em;margin:0px;outline:0px;padding:0px;vertical-align:baseline;color:rgb(128,128,128);font-family:Menlo,monospace;word-wrap:break-word">`</code><span style="color:rgb(65,65,65);font-family:Helvetica,Arial,sans-serif;font-size:14px;background-color:rgb(255,255,255)">) before and after it.</span></div><div><br></div><br><div><blockquote type="cite"><div><div><div>On Jan 5, 2016, at 10:42 PM, Greg Parker via swift-evolution <<a href="mailto:swift-evolution@swift.org" target="_blank">swift-evolution@swift.org</a>> wrote:</div><br></div></div><div><div style="word-wrap:break-word"><div><div><div>I think it is a bug :-) That's not what backquotes are for. It ought to be either supported without the backquotes or banned regardless of backquotes. </div><br><div><blockquote type="cite"><div>On Jan 5, 2016, at 8:34 PM, Jacob Bandes-Storch <<a href="mailto:jtbandes@gmail.com" target="_blank">jtbandes@gmail.com</a>> wrote:</div><br><div><div dir="ltr">Yes, it seems to use the strong shadowing variable. (The compiler doesn't complain about "self.foo", and "self?.foo" becomes invalid because self is no longer optional.)<div><br></div><div>If it weren't so useful, I'd call it a bug.<br><div class="gmail_extra">
<br><div class="gmail_quote">On Tue, Jan 5, 2016 at 8:34 PM, Greg Parker <span dir="ltr"><<a href="mailto:gparker@apple.com" target="_blank">gparker@apple.com</a>></span> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><div style="word-wrap:break-word"><div>Does further use of self after that actually use a strong shadowing variable? Or does it go back to the weak reference it already had as if the shadow were not there?</div><span><div><br></div><div><blockquote type="cite"><div>On Jan 5, 2016, at 8:26 PM, Jacob Bandes-Storch via swift-evolution <<a href="mailto:swift-evolution@swift.org" target="_blank">swift-evolution@swift.org</a>> wrote:</div><br><div><div dir="ltr">Wow! I didn't know that worked. It's a bit surprising, and perhaps not intended. I think the proposal is still valid.<div class="gmail_extra"><br><div class="gmail_quote">On Tue, Jan 5, 2016 at 8:21 PM, Christopher Rogers <span dir="ltr"><<a href="mailto:christorogers@gmail.com" target="_blank">christorogers@gmail.com</a>></span> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">You can shadow self with a guard like you wrote it if use the keyword escaping backquotes like so:<br><br>guard let `self` = self else { return }</blockquote></div></div></div></div></blockquote></div></span></div></blockquote></div></div></div></div></div></blockquote></div><br>
</div></div><img src="https://u2002410.ct.sendgrid.net/wf/open?upn=zCg-2FSGF9Wk188a6c55kLyEbrj7YhaXxFEHM-2F-2B0YAlzVd6mytc-2Bot4Nm0jCNAgoJQ9HD-2FdukApss0YvDHJVDga5JqX24xJKIBtSZZPdEpFRoxNQNHIojDDiWTjpRnu1FoNIrWUaH-2FfgGg4R-2BxhI1xHLGfmei8pcxFhZjUQ3tfKNrJDTLFWYVsIcJw8NTo-2B3Ktg4QOrmww9PmlDmkGobNutJFnEnBs3pBkJ0W9j9TJWms-3D" alt="" width="1" height="1" border="0" style="min-height:1px!important;width:1px!important;border-width:0!important;margin-top:0!important;margin-bottom:0!important;margin-right:0!important;margin-left:0!important;padding-top:0!important;padding-bottom:0!important;padding-right:0!important;padding-left:0!important">
</div><span>
_______________________________________________<br>swift-evolution mailing list<br><a href="mailto:swift-evolution@swift.org" target="_blank">swift-evolution@swift.org</a><br><a href="https://lists.swift.org/mailman/listinfo/swift-evolution" target="_blank">https://lists.swift.org/mailman/listinfo/swift-evolution</a><br></span></div></blockquote></div><br></div></blockquote></div><br></div></div></div>