6.4.2 The baz-baz-baz page

Prev Up Next Page 69 of 800 Search internet

Now consider the normal case where the three names of a page are the same. Make a file named baz.lgs with the following contents:

   ""P baz
   ""R base
   define "name" of baz as "baz" end define

Then compile it:

   > lgc baz

Then view your new page:

   > firefox baz/index.html

Writing things like

   define "name" of baz as "baz" end define

may be annoying. But every page needs one name definition for each construct it defines. The baz page only defines the baz construct. But e.g. the base page defines 659 constructs and making one name definition for each is both annoying and error prone.

Fortunately, the N escape sequence expands into a list of name definitions, one for each construct defined by a page. Thus, if you write

   ""P baz
   ""R base

then the lgc compiler will expand the N escape sequence into a name definition of baz.

Prev Up Next Page 69 of 800 Search logiweb.eu

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