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

Added Quackery
(Added Quackery)
Line 501:
=={{header|Python}}==
See [[Idiomatically_determine_all_the_lowercase_and_uppercase_letters#Python|String class isidentifier]].
 
=={{header|Quackery}}==
 
<lang Quackery>[ $ "0123456789AaBbCcDdEeFfGgHhIiJjKkLlMmNnOoPpQqRrS"
$ QsTtUuVvWwXxYyZz()[]{}<>~=+-*/^\|_.,:;?!'"`%@&#$Q
join ] constant is tokenchars ( --> $ )
( The first non-whitespace character after the word $
(pronounced "string") is deemed to be the delimiter
for the string that follows it. In the first string
the conventional character " is used, so cannot
appear as a character in that string. In the second
string all the reasonable delimiters are used, so Q
is used as the delimiter.
As it is not possible to make a string that uses all
the characters, two strings are concatenated (join)
to make the string during compilation. (Which is why
$ "0...S" $ Qs...$Q join is nested (inside [ ... ])
and followed by the word constant, which causes the
nest to be evaluated during compilation.)
Regardless of operating system, Quackery only knows
the characters in the string tokenchars, plus space
and carriage return.
The characters in tokenchars are in QACSFOT order
(the Quackery Arbitrary Character Sequence For
Ordered Text) which it uses for string comparison,
but the valid tokens (which is all of them) will
be printed by alltokens in the order native to the
operating system. (In this instance, Unicode.) )
 
[ tokenchars find
tokenchars found ] is validtoken ( c --> b )
 
[ 256 times
[ i^ validtoken if [ i^ emit ] ] ] is alltokens ( --> )
alltokens</lang>
 
'''Output:'''
 
<pre>!"#$%&'()*+,-./0123456789:;<=>?@ABCDEFGHIJKLMNOPQRSTUVWXYZ[\]^_`abcdefghijklmnopqrstuvwxyz{|}~</pre>
 
=={{header|Racket}}==
1,462

edits