Logiweb(TM) Name definitions: ""N

Prev Up Next Page 146 of 800 Search internet

Consider the following lgs source text:

   ""P my page
   ""D 0
   ""D 6
   " + "
   a + b

The lgs source defines four constructs:

Construct 0: my page
Construct 1: a
Construct 2: b
Construct 3: " + "

After lgc(1) has translated the source above to a Logiweb vector, the vector will contain the following information: The page defines four constructs where construct number 3 has arity 2 and the other ones have arity 0. Furthermore, the body consists of construct number 3 applied to construct number 1 and construct number 2 in that order.

Thus, the names of constructs are lost in translation. This is bad since if you reference the page above from one of your pages, you probably want to use the constructs on the page. And you can only do that if the names are kept.

For that reason, a Logiweb page is supposed to contain definitions like this:

  define "name" of my page as "my page" end define

After translation, the definition says that the 'name' aspect of construct number 0 is 'my page'. Such a definition records the name of construct number 0. By convention, every Logiweb page should contain a name definition for each of its constructs. The example definition above uses the

  define " of " as " end define

construct which is defined on the base page.

It is time consuming and error prone, however, to include such name definitions manually. For that reason, the ""N escape sequence has been included in the lgs language. The ""N escape sequence expands into a list of definitions, one for each construct on the page.

Prev Up Next Page 146 of 800 Search logiweb.eu

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