Logiweb(TM) Definitions

Prev Up Next Page 419 of 800 Search internet

Continuing the example of the previous two sections, suppose

define=(r,5)has arity 3
f=(r,6)has arity 2
u=(r,7)has arity 0
v=(r,8)has arity 0

Furthermore suppose that the 'define' symbol is proclaimed to denote the predefined 'define' concept of Logiweb. With these assumptions,

   (define ('value') (f (u) (v)) (if (u) (v) (u)))

is a definition that defines the value aspect of (f u v) to be (if u v u). Above, 'value' is a string.

Instead, one may state two definitions:

   (define ('message') (val) ('value'))
   (define (val) (f (u) (v)) (if (u) (v) (u)))

In this example, the message aspect of the val symbol is set to the string 'value' which makes the val symbol represent the value aspect. Then the val aspect (i.e. the value aspect) of (f u v) is defined to be (if u v u).

For completeness, we mention that Logiweb has two definition concepts, one named 'define' and one named 'introduce'. They have identical semantics, but 'introduce' invites the Logiweb browser to do something special behind the scenes. Stupid use of 'introduce' typically has no effect but occasionally may ruin efficiency. Clever use of 'introduce' a few places may increase efficiency by many orders of magnitude. The lgc compiler can tell stupid from clever use and issues warnings.

Prev Up Next Page 419 of 800 Search logiweb.eu

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