[CM] TeXmacs & S7

Elijah Stone elronnd at elronnd.net
Mon Jan 17 12:23:20 PST 2022


On Mon, 17 Jan 2022, bil at ccrma.Stanford.EDU wrote:

> Currently, s7's optimizer sometimes depends on the position of the 
> variables in environments, so your change is only safe if the optimizer 
> gives up. Since the order matters, a hash-table lookup is unlikely to 
> work without some serious overhead.  Most environments have only a 
> handful of locals, and a small linear search is faster than a hash-table 
> lookup (and the search is unnecessary if the variables have unique 
> names).

Why not maintain a hash table whose values are offsets into the flat 
environment?  Then it's a cheap branch or two on lookup to see: 1) is 
there a hash table; 2) should I build one (is the env big enough, and have 
there been enough lookups).

  -E


More information about the Cmdist mailing list