(Prev Next) Part of UserLand's MIDAS Website. Wednesday, August 27, 1997.

Macro Confusion

An attempt to resolve a long-term confusing issue -- how to delimit macros in text that's going to flow out to the web.

By Dave Winer, dwiner@well.com

Starting with AutoWeb, released in early 1995, we've been using Frontier to process macros embedded in web text. It's become more popular since the shipment of Frontier 4.0 and the connection to [Macro error: Can't find a sub-table named "#ftpsite".] .

We delimit macros using curly braces. Here's an example:

{clock.now ()}

When the page is rendered, the macro is evaluated. Everything was cool until a new spec was released by some random standards body that said that curly braces would be used in specifying "cascading style sheets". They look cool, the kind of HTML feature that I want to use. So we have to resolve this conflict. That's OK, because I think we have a pretty clean way to resolve it, a way that I feel that other MIDAS members can support.

It's always easiest to leave things as-is. This is the default choice. But it's not as much of a problem as it would appear, as has been pointed out on the Frontier-talk list, we can use macros to generate the curly braces in cascading style sheets and any other HTML tag that uses curly braces. So, when it becomes a problem, there will be a workaround that works in our world.

Also, a very important fact, if you preceed a { with a \ it passes thru unfiltered.

So -- I suggest the following syntax. Use curly braces for macros and also support backslash.

Further, a curly brace followed by a # and the name of a processor would guarantee that the macro is left alone if you aren't the named processor. So if we see a macro that looks like this:

{#webAlien gibberish}

We should pass this thru unmodified, and others should respect this. This would require a change to the Frontier 4.1 kernel. Plus, we should also allow the script writer to specify the protocol we're grabbing, this would allow a clean delineation for render-time macros and server-side macros. How does this sound? I'd be interested in hearing Mason Hale's comments on this.

This page was last built with Frontier on a Macintosh on Wednesday, August 27, 1997 at 7:37:12 PM. Thanks for checking it out! Dave