THE META-HTML LANGUAGE REFERENCE MANUAL

The Implementation [TOC] Arithmetic Operators

Language Syntax

A Meta-HTML document consists of plain text, HTML directives, and Meta-HTML statements.

The syntax of the Meta-HTML language was designed to be as similar to HTML as possible, so as to not sacrifice readability of the total document. All of the Meta-HTML statements are delivered as a form of HTML tags. There are two types of Meta-HTML tags: simple and complex.

A simple tag begins with an open angle bracket (<) and ends with a corresponding close angle bracket (>). The text enclosed within the brackets is called the body; it can contain assigned variables and positional arguments.

A complex tag begins with what looks exactly like a simple tag, continues throughout the body of the text, and ends with the a matching closing tag. This is analogous to the use of tags within HTML. The body of a complex tag is all of the text which appears between the opening tag and the closing tag, exclusive of those tags themselves.

Here is an example of using the simple tag set-var:

    <set-var foo=bar>
  

Here is an example of using the complex tag when:

    <when <get-var foo>>
      The value of `foo' is <get-var foo>.
    </when>
  

Note that both the set-var and when forms have opening tags which contain additional material. This material is used to supply information to the form.

Additionally note that ``simple'' and ``complex'' do not refer to the complexity of the function performed; they simply refer to the syntax used to write the form in a document. For example, the simple tag var-case performs a complex operation based upon the arguments it is given.

Variables assigned in the opening (or simple) tag have the form:

    name=value
  

This gives the variable referred to as name a local value of value. Variable assignments such as these give the Meta-HTML writer a way to pass dynamic arguments to a function. For example, the with-open-database form can open the requested database in one of 3 modes; you control which one by locally assigning the variable mode within the form:

    <with-open-database db "/phones.db" mode=<get-var db-mode>>
     ...
    </with-open-database>
  

Quoting Syntax

At times, you will need to quote the expressions that you pass to various Meta-HTML functions. You do this with double quotes (") and blackslashes (\). Here is a somewhat hairy example of quoting:

    <if <get-var "Space Name">
        <get-var "Space Name[space index]">
      <set-var space-name-present=false>>
  

For most cases, quoting is unnecessary, because open braces are expected to match close braces, and doubles quotes are expected to come in pairs. This is the usual case. For example:

    <ifeq <get-var foo[index]> <get-var bar>
        <set-var array[index]=<get-var bar>-found>
      <set-var array[index]=<get-var bar>-missing>>
  

In the above example, no quoting was required because the only whitespace which appeared in the expression was within a set of matched braces.


The META-HTML Reference Manual V2.0 Copyright © 1995, 1998, Brian J. Fox
Found a bug? Send mail to bug-manual@metahtml.org