Idiomatically determine all the characters that can be used for symbols: Difference between revisions
Content added Content deleted
(added Factor) |
|||
Line 54: | Line 54: | ||
</pre> |
</pre> |
||
Is this idiotmatically determined? |
Is this idiotmatically determined? |
||
=={{header|Factor}}== |
|||
<lang factor>USING: parser see ; |
|||
\ scan-word-name see</lang> |
|||
{{out}} |
|||
<pre> |
|||
: scan-word-name ( -- string ) |
|||
scan-token dup "\"" = [ t ] [ dup string>number ] if |
|||
[ invalid-word-name ] when ; |
|||
</pre> |
|||
From this code we can see that any symbols may be used in an identifier unless it parses as a string or a number. |
|||
=={{header|Go}}== |
=={{header|Go}}== |