Quote:
>I wrote
>One of the first optimizations that goes into Lisp compilers (and often
>put into interpreters) is an evaluator flag saying whether an
>expression's
>value is needed. Such a flag would have obviated the whole problem
>(not to mention great wastes of time and space in some other cases).
Roger's never talked to me about how it works, but I think there's more
to it than you have mentioned. The verb result has to be put somewhere; a
reasonable design would be to evaluate the verb on one cell, see what
shape & type you get out, assume all cells are going to produce that
shape & type, allocate space for the entire result, and then evaluate
the rest of the cells. This will be fastest in most cases. If a cell's
result comes back with a surprise shape, you have to reallocate the
output area: a reasonable decision might be to restart the verb using
a routine that allocates each cell's result separately, rather than trying
to save the results already computed.
Quote:
>It's another example of the schizophrenic nature of J -- I often get
>the feeling that whoever designed scripts never talks to whoever
>designed expressions. Try typing
>if. 0 do. 'no' else. 'yes' end.
>into the interaction (*.jx) window...
It's not a script/non-script thing: you can't type if. in a script either,
unless it's part of an explicit definition.
Henry Rich