Pascal Jasmin wrote: Sent: Wednesday, September 13, 2006 10:54 AM > languages (Forth). I'm not particularly familiar with > these, but if a monad solution is adopted, > [. 1 -- previous evaluation > [. 2 -- line before that > [. 1 2 -- boxed pair of last 2 evaluations? > [. 0 -- some kind of self reference, i'm unsure is > needed... and if not, could refer to previous line, > and simplify the simplest multiresult uses.
This would seem to lead to a variety of subtle bugs. For example, different people should have different intuitions about what the following would produce: a=:2 f=: 'a=:a+y' f 3 [. 1 [. 1 One approach is "previous evaluation" means that J stores the result of each line it executes. This would rapidly lead to out of memory conditions for people working with large data sets. Another approach is that "previous evaluation" means that the previous expression is recorded and executed. The obvious implementation of this results in a stack full error for the second [. 1 Another approach would be to special case recursion on [., where the offset is adjusted in each recursion. This probably does what you "really want", and in this case the results of the above would be 5 8 11 However, this becomes hard to understand, and does not result in the creation of a re-usable expression. In my experience, when I've got several screens of evaluations going, I sometimes have introduced an error and I have to go back and do things over again to see where I've gone wrong. This does not happen for simple cases but does happen for complex cases. I don't see how I could accomplish this if my session was littered with [. n expressions. The only times you [. would produce something re-usable are the cases where it's not doing anything useful. As an aside, it seems like it should be possible to find the function which handles ctrl shift uparrow, and bind it to another key, but I have not been able to find it. -- Raul ---------------------------------------------------------------------- For information about J forums see http://www.jsoftware.com/forums.htm
