<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=""><br class=""><div><blockquote type="cite" class=""><div class="">On Apr 4, 2016, at 7:25 AM, Jim Malak via swift-users <<a href="mailto:swift-users@swift.org" class="">swift-users@swift.org</a>> wrote:</div><br class="Apple-interchange-newline"><div class=""><div class="WordSection1" style="page: WordSection1; font-family: Helvetica; font-size: 12px; font-style: normal; font-variant-caps: normal; font-weight: normal; letter-spacing: normal; orphans: auto; text-align: start; text-indent: 0px; text-transform: none; white-space: normal; widows: auto; word-spacing: 0px; -webkit-text-stroke-width: 0px; background-color: rgb(255, 255, 255);"><div style="margin: 0in 0in 0.0001pt; font-size: 12pt; font-family: Calibri;" class=""><span style="font-size: 11pt;" class="">My background going into Swift was everything but JavaScript. One thing I often wondered about (usually every time I forgot to type it) is what purpose does requiring the keyword “func” serve when defining or decaling a function in Swift. I am not a compiler expert but intuitively it would seem that the function signature could be readily recognized by the complier and people alike with the presences of the ()’s at the end.<o:p class=""></o:p></span></div><div style="margin: 0in 0in 0.0001pt; font-size: 12pt; font-family: Calibri;" class=""><span style="font-size: 11pt;" class=""><o:p class=""> </o:p></span></div></div></div></blockquote><br class=""></div><div>Swift’s grammar follows a very regular structure, where declarations are introduced with a keyword. This structure has a number of advantages when parsing. For example, it allows “modifiers” like “mutating” and “public” to be context sensitive identifiers instead of themselves being keywords. It also helps with more subtle things like error recovery in the face of invalid code that produces parsing errors.</div><div><br class=""></div><div>-Chris</div><br class=""></body></html>