Idiomatically determine all the characters that can be used for symbols: Difference between revisions
Idiomatically determine all the characters that can be used for symbols (view source)
Revision as of 21:24, 11 March 2018
, 6 years agoadded Factor
(added Factor) |
|||
Line 54:
</pre>
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}}==
|