Atom

From Dyna
Jump to: navigation, search

Identifiers in Dyna are called atoms, as in Prolog. They are written more or less as in the Edinburgh dialect of Prolog.

foo3
frogFace
my_atom

The above examples can be written without quotes, since they consist entirely of alphanumeric characters (a-z, A-Z, 0-9, and _) and begin with a lowercase character (a-z).

In addition, any character sequence in 'single quotes' is an atom. You can use the C/C++ character escape syntax to include the single quote and other special characters in the sequence.

'3foo'
'FrogFace'
'my \'atom\'\n'
Possibly we should worry about including wide (Unicode) characters in atoms. We should consider a L'wide char string' syntax, by analogy with L'w' and L"wide char string" in C++.
I agree that allowing identifiers to contain Unicode characters would be good. But I don't think we need any special syntax for it - in C++, L'w' and 'w' are semantically different. If Dyna identifiers are permitted to contain any Unicode characters, then the only question is how they are parsed. -EN
Personal tools
Namespaces

Variants
Actions
Navigation
Tools