[q-lang-users] "and then" and stack usage
Brought to you by:
agraef
From: ww <wwa...@ea...> - 2004-02-02 23:54:10
|
Hi, 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'm running QPad version 5.0. Thanks, Walt My Example; randoml N:Int = randoml [] N; randoml L:List N:Int = randoml (push L random) (N-1) if N>0; = L otherwise; % C:\Documents and Settings\ww\My Documents\randoml.q ==> def A=randoml 10 ==> def B=randoml 100 ==> (A=A) true ==> stats 0 secs, 31 reductions, 41 cells ==> (B=B) true ==> stats 0 secs, 301 reductions, 401 cells ==> version "5.0" |