Logiweb(TM)

7.1.3.4 Parentheses

Prev Up Next Page 126 of 800 Search internet


The lgs language has no parenthesis constructs, but users are free to define whatever parentheses they like. Example:

   ""P my page
   ""D 0
   2
   3
   4
   ( " )
   ""D 2
   " * "
   ""D 6
   " + "
   ""B
   2 * ( 3 + 4 )

Due to the parenthesis, 'times' ends up as the principal operator, disregarding the charges of the constructs.

The base page actually defines a parenthesis construct like the one above. In addition, the base page contains definitions like these:

   value define ( x ) as x end define
   macro define ( x ) as x end define

The latter construct makes parentheses disappear after parsing. The former construct ensures that ( x ) computes like x even in cases where parentheses do not disappear e.g. because they are protected against macro expansion.

Prev Up Next Page 126 of 800 Search logiweb.eu

Copyright © 2010 Klaus Grue, GRD-2010-01-05