Tutorial Developer Reference 1 Introduction 2 Interface 3 Scanner 4 Parser 5 Analyser 6 Tangle 7 Weave 8 Shell 9 Commands 10 Glossary 11 References SEARCH

3.7 Quick Names

FunnelWeb provides a quick name syntax as an alternative, for macros whose name consists of a single character, to the angle bracket syntax usually used (e.g. `@<Sloth@>`). A quick name sequence consists of `@#`x where x, the name of the macro, can be any printable character except space.

    quick_name = "@#" non_space_printable

The result is identical to the equivalent ordinary name syntax, but is shorter. For example, `@#X` is equivalent to `@<X@>`. This shorter way of writing one-character macro names is more convenient where a macro must be used very often. For example, the macro calls in the following fragment of an Ada program are a little clumsy.

    @! Define @<D@> as "" to turn on debug code
    @! and "--" to turn it off.
    @$@<D@>@{--@@)
    @<D@>assert(b>3);
    @<D@>if x>7 then write("error") end if

The calls can be shortened using the alternative syntax.

    @! Define @#| as "" to turn on debug code
    @! and "--" to turn it off.
    @$@#|@{--@@)
    @#|assert(b>3);
    @#|if x>7 then write("error") end if

Webmaster Copyright © Ross N. Williams 1992,1999. All rights reserved.