crazy tuple ideas.

Jarrett Billingsley kb3ctd2 at yahoo.com
Fri Mar 2 12:09:38 PST 2007


Knud Soerensen Wrote:

> With people starting to write compiler time parsers, 
> maybe it would be a good idea to have a standard way for
> representing syntax trees.
> 
> By allowing tuples to contain tuples we will have something 
> very similar to the lisp list expression. 
> Example:
> Tuple!(=,E,Tuple!(*,m,Tuple!(^,c,2))); // E=m*c^2;
> or maybe allowing the programmer to write just 
> (=,E,(*,m,(^,c,2)))
> 
> By using a standard way for representing syntax trees 
> we allow for more code sharing between project which 
> uses them.
> 
> Also if the D compiler made the programs syntax tree
> available doing compilation if would be possible to make 
> modules which could modify the programs syntax tree at compiler time.

Actually, Andrei and Walter have hinted several times at D getting some kind of Lisp-like AST manipulation, so this possibility may not be that far off..



More information about the Digitalmars-d mailing list