Subject: Re: Announcing 'Lisp Abstracted Markup Language' (LAML) vers. 14
From: (Rob Warnock)
Date: 2000/05/20
Newsgroups: comp.lang.scheme,comp.lang.lisp
Message-ID: <8g55nl$cvsg0$>
Tom Breton  <> wrote:
| "Kurt N�rmark" <> writes:
| > I appreciate any feedback about LAML from you.
| That is fascinating.  But have you looked at the Latte approach?

And don't forget "Mistie":


I've used it a bit. Fairly nice. Also in Scheme. Uses a TeX-like
bottom-up "trigger character" style -- any character can be enabled
(with ""mistie-def-char") to call a Scheme procedure when seen, and
the entire state of triggers can be readily pushed/mutated/popped to
compose complex actions. For example:

	Suppose we want a contiguous sequence of blank lines to be come
	out as the paragraph separator, <p>. We could "mistie-def-char"
	the newline character as follows: 

	(mistie-def-char #\newline
	  (lambda ()
	    (let* ((s (h-read-whitespace))
		   (n (h-number-of-newlines s)))
	      (if (> n 0)
		  (begin (display "<p>")
		    (newline) (newline))
		  (display s)))))

	This will cause newline to read up all the following whitespace,
	and then check to see how many further newlines it picked up.
	If there was at least one, it outputs the paragraph separator,
	viz., <p> followed by two newlines (added for human readability).
	Otherwise, it merely prints the picked up whitespace as is.

It also provides a more traditional keyword-style, the "control sequence",
which is simply a special trigger character which picks up a token and
dispatches on it, e.g., you can say "\newtitle" or "@footnote" and call
a Scheme procedure for each.

As I mentioned, the action routine for a trigger character can "push the
world" and redefine itself or some other character, and a later action
can "pop the world" to restore the original definition. The example Scheme-
based "style sheets" in the distribution use this to do argument gathering,
for example. Control sequence "\foo" might redefine "{" to redefine *all*
characters to push themselves into a side buffer, and redfine "}" to undo
that and then do something with the accumulated characters. So you could do:

	\foo {some text here,

which would result in some Scheme procedure being called with the string
"some text here,

And of course, you can have multiple arguments, too, if you like:



Rob Warnock, 41L-955
Applied Networking
Silicon Graphics, Inc.		Phone: 650-933-1673
1600 Amphitheatre Pkwy.		PP-ASEL-IA
Mountain View, CA  94043