Re: [q-lang-users] "and then" and stack usage
Brought to you by:
agraef
From: <Dr....@t-...> - 2004-02-15 21:15:03
|
/me wrote: > ww wrote: > >> I've been exploring Q recently and I've noticed that "and then" doesn't >> seem to run in constant space. From it's definition (in the docs), I was >> expecting that it could reuse the stack frame but that doesn't seem to >> be the case. Am I missing something? > > I thought about this problem a little more -- it's really been haunting > me. ;-) So here's the result of my contemplations... > > [snipped] I thought about it still some more, and finally decided that this is really a bug that needs to be solved. Said and done. ;-) So in cvs you can now find a new version of the interpreter that is fully tail-recursive. That is, tail calls are now optimized for builtins and special arguments just as for user-defined rules. Thus, e.g., (=) and `all' on lists now run in constant stack space, without the need to rewrite anything. Enjoy! :) Albert -- Dr. Albert Gr"af Email: Dr....@t-..., ag...@mu... WWW: http://www.musikwissenschaft.uni-mainz.de/~ag |