Roger wrote: > In the implementation, it was (is) a useful fiction to assume > that memory is unlimited, because then the (implementation) > code can be a lot simpler. Similarly, it was (is) a useful > fiction that there is no stack limit.
Yes, but the sad thing is we often have enough room to make the former fiction believable (useful). Not so with the latter, in my experience. > Did you know that you can change the stack (recursion) limit? Yes, but unfortunately, it involves modifying the J binaries. Also, I do not know how much is "enough" in advance. > I implemented Memo > http://www.jsoftware.com/jwiki/Essays/Memo instead > because it offered a more immediate and dramatic benefit. Yes, and I appreciate M., it is quite a coup for the J programmer. Thank you. However, even with M., recursion is limited, primarily for two reasons. The first is extrinsic: M. currently only provides value to scalar, numeric verbs. This may change with future improvements to the adverb In contrast, the second issue is intrinsic and cannot be solved: M. only provides values to verbs whose inputs are repeated. For example, it will never speed up a recursive string parser (e.g. for arbitrarily-parenthesized mathematical expressions). -Dan ---------------------------------------------------------------------- For information about J forums see http://www.jsoftware.com/forums.htm
