Previous: , Up: iklib syntaxes infix   [Index]


6.8.16.3 Random notes on the features

About the exponentiation and bitwise XOR operators

The infix macro uses ‘**’ as exponentiation operator and ‘^’ as bitwise XOR operator; this is controversial because a lot of people, especially LaTeX users, is used to think of ‘^’ as exponentiation operator. The C language has established a tradition to interpret ‘^’ as bitwise exclusive OR operator, and the Python language has adopted it; Vicare sticks to it, too.

About the vertical bar

The C language has established a tradition of interpreting the single vertical bar ‘|’ as bitwise inclusive OR operator and the double vertical bar as ‘||’ as logical inclusive OR operator.

In the R6RS Scheme language the vertical bar is used in the block comments delimiters ‘#| … |#’. Vicare’s source code reader uses the vertical bar to specify symbols whose name does not comply with R6RS, Miscellaneous additional syntaxes. Some text editors for software programmers handle the vertical bar specially in Scheme mode, in particular for syntax highlighting.

It would be possible to extend Vicare’s reader to allow ‘|’ and ‘||’ to be symbols, but, at present, this confuses some text editors in a way that is not easy to fix. So, for now, rather than the vertical bar, infix recognises the Unicode character vertical bar extension (‘\x23D0;’) as bitwise inclusive OR and the double vertical bar extension as logical inclusive OR.