the "upwards funarg" problem.

james anderson James.Anderson at
Wed Jan 27 20:19:44 GMT 1999

The notion would appear to abound on this list, that the matter of universal
names, the modeling of same and techniques for syntactic minimization in
serialization are somehow uncharted waters. The behaviour of qualified name
prefixes in the DOM is but one example.

Is it a problem to associate prefixes with names in the DOM? If so, then under
which circumstances, and how is the problem resolved?
The answer to each question is clear. Not only that, it would appear that the
answers have been known for close to forty years.

As I have noted in previous posts, this is an instance of the "upwards funarg" problem.

Since I was curious about the history of this concept, I launched a request
which yielded only two results. as chance would have it, they were two quite
pertinent results.

the first reference was
it describes succinctly the issues which one needs address when referring to
non-local, but lexically apparent, variable bindings in systems which permit
first class functions. this is the "upwards funarg" problem. if the term means
nothing to you, that note will explain enough for you to recognize the problem
in the prefix<->URI bindings which may appear in DOM elements. The key is to
note that the prefix acts as a lexically apparent binding for a URI over which
a child element closes whenever it comprises a name which is qualified by the
given prefix.

(Should the duality between closures and objects be a missing link here, then
take note of graham's exposition in chapter 17 of "ansi common lisp", in which
he demonstrates how to model objects with closures, and invert it.)

Given this analogy, when one transplants in the DOM an element which "closes
over" some prefix binding, one is performing an operation analogous to passing
a first class function upwards through an invocation stack. If one does not
model this operation correctly this can lead to unintended results. (see ms
Fisher's description at the location noted above for the synopsis.)

As noted before, there are some who believe that such closures never come into
existence, as the prefix stands in no direct relation to the respective names,
but if one insists on such a model for names, then one must handle this problem.

the second reference was to a chance note in comp.compilers
which indirectly cites what would appear to be the first publication of the
mechanisms for modelling problems of this sort: an article in Communications
of the ACM, from 1973. The comp.compilers note also makes the point that,
although this article constituted a publication milestone, the issue was
addressed in implmentations which dated much earlier. Among them is Lisp 1.5.

I somehow had dated Lisp 1.5 to the late sixties. When I looked further, I
noted that for which the prorgammers's manual was published in 1961 and, as
described in
the initial work on it - including the funarg problem is described in memos
from the MIT AI-Lab from as early as 1959.


xml-dev: A list for W3C XML Developers. To post, mailto:xml-dev at
Archived as:
To (un)subscribe, mailto:majordomo at the following message;
(un)subscribe xml-dev
To subscribe to the digests, mailto:majordomo at the following message;
subscribe xml-dev-digest
List coordinator, Henry Rzepa (mailto:rzepa at

More information about the Xml-dev mailing list