# [Latte] words and variables

Daniel Mahler mahler@cyc.com
Mon, 19 Mar 2001 17:10:57 -0600

What I have in mind is something like

{\defmacro {\template \name}
\{\def {{\make-var ,\name} \n}
{... \name ... \n ...}}}

{\template T}

{\T 1}

or, alternatively,

{\defmacro {\template \ref}
\{\def {\,\ref \n}
{... \,{\ref-name \ref} ... \n ...}}}

{\template \T}

{\T 1}

I realize that an almost equivalent soltion is to simply parametrize

{\def {\template \name \n}
{... \name ... \n ...}}

{\template T 1}

but one of the above solutions would be more convenient.
I have people typing in manually a large amount of marked up text.
I am therefore trying to design minimal markup for them to type.
They invent new tags on the fly, but the desired expansions are
systematic, and they keep a list of the tags introduced.

I wanted to write a function that enerates the definitions
from the list of tags,
and allow them to use the tags the invent as function names,
which minimizes typing.

I know there are other ways to achieve this,
but the above idea seemed cleanest
and most in the spirit of scheme/lisp.

regards
Daniel

Bart Schaefer writes:
> On Mon, 19 Mar 2001, Daniel Mahler wrote:
>
> > I would like to write macros that define functions on the
> > fly based on a simple naming convention.
>
> Why?  How exactly would you call such a function once you'd defined it?
>