J. Rowe says:
>the semantics of % .. % would be something like "collect together
>everything that is put on the stack as a result of doing this
>and put it into the appropriate structure".
The current semantics are "collect together everything that is LEFT on the
stack as a result of doing this and put it into the appropriate structure".
Its what happens when 'doing this' involves taking things off the stack
(or changing them) that were there outside of the scope of the % .. % that
is being questioned.
>I would like the answer to the question to be:
>
>: [a], [% hd() %] =>
>** [a]
>
>: [a], {% hd() %} =>
>** {a}
>
I can't see how you could implement this in any system, or why you would want
to. -hd- not only puts something onto the stack, but it takes something off
it, leaving the total number of things on the stack the same. You could view
the implementation of -hd- as:
define hd;
front(subscr_stack(1)) -> subscr_stack(1);
enddefine;
Are you really saying that you want the semantics of % .. % to be 'collect
together any items pushed onto the stack while doing this and put it into the
appropriate structure, but ignore any pop's' ? Or something more elaborate:
'collect together everything left on the stack, but in addition if
any procedures change things already on the stack outside the scope of the
% .. % then I want those things as well?
in my mind, doing:
[a], {% hd() %} =>
or
[a], [% hd() %] =>
is an error and should generate a mishap.
Jon.
|