Idiomatically determine all the characters that can be used for symbols: Difference between revisions

added 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}}==
1,808

edits