This seems like a good idea ...

> MetaCat and Rewriting Rules
>
> Cat has no lexical environment and only a single stack. This makes it very
> easy to rewrite Cat code. The Cat interpreter comes with a built-in term
> rewriting system called MetaCat that is activated using the "#metacat" or
> "#m" command.
>
> A MetaCat rule has the form:
>
>   rule{ source_pattern } => { target_pattern }
>
> Some examples of MetaCat macros are:
>
>   rule { swap swap } => { }
>   rule { dup pop } => { }
>   rule { quote eval } => { }
>   rule { [$B] curry } => { quote [$B] compose }
>   rule { map $a map } => { $a compose map }
>   rule { and } => { quote [false] if }
>   rule { or } => { quote [true] swap if }
>   rule { unit rev } => { unit }
>   rule { unit $a filter } => { $a apply [unit] [pop nil] if }
>
> MetaCat patterns may contain literal names, value variables which start
> with a lower-case letter (e.g $a or $bob), and expression variables which
> start with an upper-case letter (e.g. $A or $Bob).
>
  -- http://www.cat-language.com/intro.html

Wondering if Factor has something similar.

 - Leonard
------------------------------------------------------------------------------
RSA(R) Conference 2012
Save $700 by Nov 18
Register now
http://p.sf.net/sfu/rsa-sfdev2dev1
_______________________________________________
Factor-talk mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/factor-talk

Reply via email to