Lambda the Ultimate

inactiveTopic Tunneling Variables
started 4/19/2004; 9:58:18 PM - last post 4/22/2004; 5:46:40 AM
Patrick Logan - Tunneling Variables  blueArrow
4/19/2004; 9:58:18 PM (reads: 8744, responses: 10)
Tunneling Variables
The XSLT 2.0 specification defines tunnel parameters as having "the property that they are automatically passed on by the called template to any further templates that it calls, and so on recursively." When working on the big, complex stylesheets described above, if I could have identified the parameters passed to the original template as tunnel parameters, there would have been no need to explicitly pass them to templates that it called.
Reminds me of dynamically scoped (special) variables in Lisp.
Posted to general by Patrick Logan on 4/19/04; 9:58:33 PM

bryan rasmussen - Re: Tunneling Variables  blueArrow
4/20/2004; 8:26:50 AM (reads: 593, responses: 0)
This is one of the nice parts of what is otherwise not so nice.

Tayssir John Gabbour - Re: Tunneling Variables  blueArrow
4/20/2004; 9:41:07 AM (reads: 578, responses: 2)
Reminds me of dynamically scoped (special) variables in Lisp.

I'm collecting names for dynamically scoped variables. There's special, implicit and tunneling variables so far...

Frank Atanassow - Re: Tunneling Variables  blueArrow
4/20/2004; 11:07:06 AM (reads: 689, responses: 0)
The markup language community is notorious for reinventing and duplicating concepts and terminology, sometimes even their own. Thus they have "minimum literals" rather than "string literals", "parameter entities" rather than "macros", "templates" rather than "procedures" or "functions", "validate" rather "type-check", "data binding" rather than "translation", "unmarshal" rather than "parse" et cetera.

I long ago gave up trying to get them to use conventional terminology; for them to acknowledge prior art would require them to acknowledge some unpleasant facts, like that story about the emperor and his new clothes.

OTOH, there are typically a dozen, largely pointless, technical reasons why one should not use more conventional names for most of these things; their semantics differ in some corner case, or has been made more convoluted to handle some special situation which could actually have been handled more cleanly and less artificially by generalizing some other construct. (This is what I discovered when I wrote a paper based on a formal semantics of XML Schema.) Probably tunnel variables differ from implicit parameters/dynamic scoping in such a way.

It's really a big mess. I try to stay out of it. Let them build their sand castles where they like. Next year they will publish another twenty W3C recommendations and ISO standards to address the special cases in the corner cases at the fenceposts anyway.

Update: I initially omitted the rather important boldface word above.

Patrick Logan - Re: Tunneling Variables  blueArrow
4/20/2004; 3:52:36 PM (reads: 467, responses: 0)
Frank - I have a huge smile on my face right now.

LOL

Martin Bravenboer - Re: Tunneling Variables  blueArrow
4/21/2004; 12:07:40 AM (reads: 374, responses: 0)
This seems to be the original request for this feature: Request for dynamically scoped variables in XSLT. It refers to Lisp, Fluid Binding in Scheme and Implicit Parameters: Dynamic Scoping with Static Types.

Ehud Lamm - Re: Tunneling Variables  blueArrow
4/21/2004; 1:19:51 AM (reads: 354, responses: 0)
monads?

Peter Van Roy - Re: Tunneling Variables  blueArrow
4/21/2004; 4:53:02 AM (reads: 326, responses: 0)
DCGs in Prolog.

scruzia - Re: Tunneling Variables  blueArrow
4/21/2004; 8:30:00 AM (reads: 299, responses: 0)
Environment variables in Unix shells.

Mark Evans - Re: Tunneling Variables  blueArrow
4/21/2004; 8:56:54 PM (reads: 208, responses: 0)

As Oleg writes,

Thus an XML document and operations on it can be expressed in Scheme -- and regarded either as data structures or as code.

So, Frank, just use your favorite language, Scheme. Thanks for the cogent remarks.

Ziv Caspi - Re: Tunneling Variables  blueArrow
4/22/2004; 5:46:40 AM (reads: 168, responses: 0)

In NT batch scripts, variable tunneling is the name of the trick in which one lets values escape local scopes:

endlocal & set RET=%RET%