Re: SGML macros using DSSSL expressions

A macro language would be very powerful.

On Sat, 24 Feb 1996, Daniel W. Connolly wrote:
> 
> 	<!entity copyStatement "Copyright (c) 1996, all rights reserved">
> 	...
> 	&copyStatement;
[...]
> 
> 	<!element temp - O EMPTY>
> 	<!attlist temp
> 		x CDATA #REQUIRED
> 		y NUMBER #REQUIRED
> 		macro CDATA '(sequence "The temperature in" x "is" y ".")'
> 		>
[...]
> 
> 	<?dsssl (define (temp x y) (sequence "The temperature in " x " is " y ".")>

> 
> Hmmm... web browsers don't parse processing instructions well enough
> to hide them today.  Grumble.

Grumble.

> The other thing is that some folks want to be able to use expressions as
> attribute values. I thought about defining a new media type, say text/ehtml,
> where the lexical syntax of HTML is extended to include the lisp backquote syntax:
> 
> 	<h2>Section `,(set! counter (+ 1 counter))</h2>

I was discussing some ideas in a similar vein on the way back from
Philadelphia this past weekend.  I was thinking more of a preprocessor,
whose invocation would be signalled by a Content-Encoding.  This would
extend macro capabilities to theoretically any MIME type.

How about 

Content-Encoding: m4

with include() extended to accept URLs to macro definition files
(Content-Type: text/plain, Content-Encoding: m4) and no syscmd(), or, 
less powerful,

Content-Encoding: cc-E

with #include "..." extended to accept URLs?  It might be possible to
invent a new macro language that would work better for HTML, but maybe
it's more effective to stick with what people know well and what's
already implemented.  Adding a call to m4 could be very easy.  Maybe
we could add a few predefined macros, in the case of HTTP retrieval,
to provide a little extra power -- say, client(), server(), user(), 
time(), date(), referer(), to name a few.

Both these alternatives would make LOTS of really cool things possible.


Ping (Ka-Ping Yee):   3A Computer Engineering, University of Waterloo, Canada
kryee@csclub.uwaterloo.ca, St. Paul's College, Waterloo N2L 3G5, 519 725-8008
CWSF 89, 90, 92; LIYSF 90, 91; Shad Valley 92; DOE 93; IMO 91, 93; ACMICPC 94
* Ayukawa Madoka * Hiyama Hikaru * Tendou Akane * Hayakawa Moemi * Amano Ai *

Received on Sunday, 25 February 1996 01:22:55 UTC