<p>Sorry guys I made a mistake here. I was wrong about the idea that only the <code>function</code> keyword allows other characters besides <code>[[:alnum:]_]</code>. The classic syntax allows it as well. The only significant difference is that the classic syntax conflicts with <code>extglob</code>, whereas the <code>function</code> keyword does not. When using a syntax like <code>is_a_number?(){ [[ $1 == +([[:digit:]]) ]]; }</code>, bash reports <code>syntax error near unexpected token '}'</code>. But it doesn't happen when <code>extglob</code> is disabled. I probably misinterpreted it as an exception within the classic syntax itself. I never created specially-named functions other than those having the <code>[X.]f?</code> or <code>[X.]f!</code> format.</p>
<p>Anyway, I still would suggest to have this solution applied. The <code>function</code> keyword allows the difference between the special syntax of bash and the classic or POSIX syntax distinguishable. I also don't think people who write POSIX scripts would want to have their function names also validated with special characters which are only recognized in Bash. So generalizing would be bad idea.</p>
<p>P.S. The classic syntax also conflicts with the assignment syntax, but I don't think anyone would want to use the <code>=</code> character for its high ambiguity risk, so it's not really a significant argument to use here.</p>

<p style="font-size:small;-webkit-text-size-adjust:none;color:#666;">—<br />You are receiving this because you are subscribed to this thread.<br />Reply to this email directly, <a href="https://github.com/geany/geany/pull/662#issuecomment-375234385">view it on GitHub</a>, or <a href="https://github.com/notifications/unsubscribe-auth/ABDrJz_MDIy6J3HPrqRUjGUUeBqrLeoSks5tg3DCgaJpZM4GC8s7">mute the thread</a>.<img src="https://github.com/notifications/beacon/ABDrJ_8YNeKWpH9tzFYEwB9ofI9kw-7Tks5tg3DCgaJpZM4GC8s7.gif" height="1" width="1" alt="" /></p>
<div itemscope itemtype="http://schema.org/EmailMessage">
<div itemprop="action" itemscope itemtype="http://schema.org/ViewAction">
  <link itemprop="url" href="https://github.com/geany/geany/pull/662#issuecomment-375234385"></link>
  <meta itemprop="name" content="View Pull Request"></meta>
</div>
<meta itemprop="description" content="View this Pull Request on GitHub"></meta>
</div>

<script type="application/json" data-scope="inboxmarkup">{"api_version":"1.0","publisher":{"api_key":"05dde50f1d1a384dd78767c55493e4bb","name":"GitHub"},"entity":{"external_key":"github/geany/geany","title":"geany/geany","subtitle":"GitHub repository","main_image_url":"https://cloud.githubusercontent.com/assets/143418/17495839/a5054eac-5d88-11e6-95fc-7290892c7bb5.png","avatar_image_url":"https://cloud.githubusercontent.com/assets/143418/15842166/7c72db34-2c0b-11e6-9aed-b52498112777.png","action":{"name":"Open in GitHub","url":"https://github.com/geany/geany"}},"updates":{"snippets":[{"icon":"PERSON","message":"@konsolebox in #662: Sorry guys I made a mistake here. I was wrong about the idea that only the `function` keyword allows other characters besides `[[:alnum:]_]`. The classic syntax allows it as well. The only significant difference is that the classic syntax conflicts with `extglob`, whereas the `function` keyword does not. When using a syntax like `is_a_number?(){ [[ $1 == +([[:digit:]]) ]]; }`, bash reports `syntax error near unexpected token '}'`. But it doesn't happen when `extglob` is disabled. I probably misinterpreted it as an exception within the classic syntax itself. I never created specially-named functions other than those having the `[X.]f?` or `[X.]f!` format.\r\n\r\nAnyway, I still would suggest to have this solution applied. The `function` keyword allows the difference between the special syntax of bash and the classic or POSIX syntax distinguishable. I also don't think people who write POSIX scripts would want to have their function names also validated with special characters which are only recognized in Bash. So generalizing would be bad idea.\r\n\r\nP.S. The classic syntax also conflicts with the assignment syntax, but I don't think anyone would want to use the `=` character for its high ambiguity risk, so it's not really a significant argument to use here."}],"action":{"name":"View Pull Request","url":"https://github.com/geany/geany/pull/662#issuecomment-375234385"}}}</script>