[XML-DEV Mailing List Archive Home] [By Thread] [By Date] [Recent Entries] [Reply To This Message]

Re: s-expressions and XML was Re: terra incognita


s expressions java
Jonathan Borden wrote:

 
> XML might be more generally represented using something akin to an
> s-expression notation by introducing delimeters for an unordered set '[' and
> ']' and then we can represent:
> 
> <foo aaa="111" bbb="222" ccc="333">
>     <bar ddd="444"/>
>     <baz/>
>     <bop eee="555">
>         <bing/>
>     </bop>
> </foo>
> 
> as:
> 
> (foo [aaa="111" bbb="222" ccc="333"]
>     (bar [ddd="444"])
>     baz
>     (bop [eee="555"]
>         bing
>     )
> )
> 


This thread pops up once or twice a year, and it gives me
an excuse to point readers to a little thought exercise
I did a while back "lambda markup language"[1]

I defined an SGML concrete syntax, and wrote 70 lines
of Scheme code which produces a program that "executes"
a DTD to produce another program.  This resulting program,
in turn, compiles documents of that type into programs
which can print themselves.

So what was the point?  Well, beyond my curiosity of
whether it could actually be done, I think it points
to the notion that the distinction between data and
code isn't so much a hard line as it is in the uses to
which we put it.

All data might be considered as programs to the
machines which execute them and all programs could
also be considered as data for which there are a
limited number of machines which are able to do
useful stuff with them.

XML could be thought of as a program to a SAX parser,
causing it to fire a sequence of events, or to a DOM
builder, causing it to produce an object model.

The power and consequent benefit of using XML comes
from the ease with wich one can obtain or build new
"machines" to  "execute" the data in ways unanticipated
by the document's creater.

Enjoy,
Bill

[1] http://www.blnz.com/lml/index.html


PURCHASE STYLUS STUDIO ONLINE TODAY!

Purchasing Stylus Studio from our online shop is Easy, Secure and Value Priced!

Buy Stylus Studio Now

Download The World's Best XML IDE!

Accelerate XML development with our award-winning XML IDE - Download a free trial today!

Don't miss another message! Subscribe to this list today.
Email
First Name
Last Name
Company
Subscribe in XML format
RSS 2.0
Atom 0.3
 

Stylus Studio has published XML-DEV in RSS and ATOM formats, enabling users to easily subcribe to the list from their preferred news reader application.


Stylus Studio Sponsored Links are added links designed to provide related and additional information to the visitors of this website. they were not included by the author in the initial post. To view the content without the Sponsor Links please click here.

Site Map | Privacy Policy | Terms of Use | Trademarks
Free Stylus Studio XML Training:
W3C Member
Stylus Studio® and DataDirect XQuery ™are products from DataDirect Technologies, is a registered trademark of Progress Software Corporation, in the U.S. and other countries. © 2004-2013 All Rights Reserved.