[Latte] words and variables

Bart Schaefer schaefer@zanshin.com
Tue, 20 Mar 2001 01:53:38 -0800 (PST)


On Mon, 19 Mar 2001, Daniel Mahler wrote:

> What I have in mind is something like
> 
>     {\template T}
>     
>     {\T 1}
> 
> or, alternatively,
> 
>     {\template \T}
>     
>     {\T 1}

That second one is the way to do it.  Here's a template to create functions
that take two arguments and reverse them:

{\def \template
  {\macro {\fn}
   {\`{\def {\,\fn \one \two} {\two \one}}}}}

Use it like this:

{\template \swap}
{\swap first second}

Obviously you have something more complicated in mind.