<html><head><meta http-equiv="Content-Type" content="text/html charset=utf-8"></head><body style="word-wrap: break-word; -webkit-nbsp-mode: space; -webkit-line-break: after-white-space;" class="">Hi,<div class=""><br class=""></div><div class="">I have a question regarding hexadecimal floating-point literals. According to the Lexical Structure (<a href="https://developer.apple.com/library/prerelease/content/documentation/Swift/Conceptual/Swift_Programming_Language/LexicalStructure.html" class="">https://developer.apple.com/library/prerelease/content/documentation/Swift/Conceptual/Swift_Programming_Language/LexicalStructure.html</a>)&nbsp;</div><div class="">it is not possible to have a hex floating-point literal without the exponent. At first I thought this makes sense.</div><div class="">How else would the lexer / parser know if 0x123.beef is a hex floating-point literal or a hex integer literal with a property 'beef'?</div><div class="">However, if I define such a property on Int, it doesn’t work:</div><div class=""><br class=""></div><div class=""><div class=""><font face="Menlo" class="">extension Int {</font></div><div class=""><font face="Menlo" class="">&nbsp; &nbsp; var beef: Int {</font></div><div class=""><font face="Menlo" class="">&nbsp; &nbsp; &nbsp; &nbsp; return 42</font></div><div class=""><font face="Menlo" class="">&nbsp; &nbsp; }</font></div><div class=""><font face="Menlo" class="">}</font></div><div class=""><font face="Menlo" class=""><br class=""></font></div><div class=""><font face="Menlo" class="">print(12.beef) <span class="Apple-tab-span" style="white-space:pre">                </span>// works</font></div><div class=""><font face="Menlo" class="">print(0b1001.beef) <span class="Apple-tab-span" style="white-space:pre">        </span>// works</font></div><div class=""><font face="Menlo" class="">print(0o77.beef) <span class="Apple-tab-span" style="white-space:pre">        </span>// works</font></div><div class=""><font face="Menlo" class="">print(0xabc.beef) <span class="Apple-tab-span" style="white-space:pre">        </span>// error: hexadecimal floating point literal must end with an exponent</font></div></div><div class=""><br class=""></div><div class="">Is this just to avoid confusion for the programmer? Or is there some other reason?</div><div class=""><br class=""></div><div class="">Thanks and best regards,</div><div class="">Toni</div></body></html>