[metapost] recursion in MP/ MF [was: all intersections between two paths]

Taco Hoekwater taco at elvenkind.com
Wed Jan 19 21:36:10 CET 2005


Hans Hagen wrote:
> Taco Hoekwater wrote:
> 
>> I also like recursion. It is unfortunate that precisely this part of 
>> MP/MF cannot easily be changed. Knuth uses the (compile-time) size of 
>> the param stack to differentiate between the three parameter types, 
>> making it hard to manage the stack dynamically. This is much more of a 
>> problem in MP than in TeX because graphics often relate themselves 
>> well to recursive algorithms.
> 
> 
> that stack is now 300; is there some limit in the source (e.g. due to 
> packing things in bytes or so)?

The 'bad' test is pretty huge:

   257 + hash_size + 14 + 1 + (3 * param_size) < max_halfword

Since max_halfword is 268435455 in web2c, there is some room for 
extension ;-)
(but it would still be pre-allocated memory)





More information about the metapost mailing list