Next: Programs and Runs Up: Importing New Elements Previous: Discarding Elements from

Importing Several Elements at a Time

Let v1, v2 be distinct variables. Abbreviate

import v1 
     import v2 
          R0
     endimport
endimport
to
import v1, v2 
     R0
endimport

In a similar way, define abbreviations

import v1, ..., vk
     R0
endimport

Abbreviate

import v1, ..., vk
     U(v1) := true
     .
     .
     .
     U(vk) := true
     R0
endimport
to
extend U with v1, ..., vk
     R0
endextend

Later (in 5.4) we'll see how to import a number of elements that is not bounded a priori by any constant. Here is an example of the extend rule:

extend Nodes with v1, v2 
   FirstChild(CurrentNode) := v1
   SecondChild(CurrentNode) := v2
   NextSib(v1) := v2 
endextend


huggins@acm.org
Thu Mar 23 17:30:35 EST 1995