Modular C

Unicode is nowadays the international standard for character codes and we shouldn't constrain programmers to the traditional ASCII set (or similar) that just happened to be there first.

Modular C is meant to cope with most of Unicode naturally, such as using α as a variable name or for a function, or using almost any Unicode character as separator or composer characters, but please see below.

Some Unicode characters, though, are reserved by Modular C. These are mostly characters that have a direct mapping to C operators and which are therefore taken as synonyms for these:

character hex operator remark
¬ 00ac ! logical negation
× 00d7 * multiplication, should only be used as binary operator to distinguish from unary *
÷ 00f7 / division, may add blank to separate from following unary *
2026 ... ellipsis
203c !! logical conversion
2192 -> pointer to member
2227 && logical and
2228 || logical or
2229 & intersection, bitwise and, may add blank to separate from following unary &
222a | union, bitwise or
2254 = assignment
2260 != inequality test
2261 == equality test
2264 <= less or equal
2265 >= greater or equal
2a74 = initialization
2aa1 << left shift (this is not the same as «, the left angle quote)
2aa2 >> right shift (this is not the same as », the right angle quote)

In addition the special parenthesis ⸢ ⸣ are reserved for internal use by Modular C.

good sense

Overuse of Unicode can quickly become unreadable for people that are not used to the individual characters. So be careful.

  • Don't use mathematical symbols or any other characters that have a strong semantic connotation out of their context. E.g the character ∫ is fine to use with Modular C code, but only if it represents something like a mathematical integral.
  • Don't use symbols in a way that differs from their syntactical classification. In particular symbols that are parenthesis (opening or closing) should always be used as such, e.g as contexts, see context.