THROWMAE/2
M. Anton Ertl (anton@mips.complang.tuwien.ac.at)
The standard makesTHROWresponsible for restoring the input source specification. In combination withQUERY, this leads to the following anomaly:According to the standard, the: foo query 1 throw ;
: bar ['] foo catch ;1 THROWshould restore the input source specification in effect before the execution ofCATCH. IfFOOdid not execute aTHROW(or0 THROW), then the input source specification should not be restored.
Remove the requirement to restore the input source specification from the definition ofTHROW.Add the following requirement to the definition of
LOAD,INCLUDE-FILE,INCLUDED,EVALUATEetc.:catch exceptions, restore the input source specification, and throw the exceptions.
Alternatively,CATCHcould be required to restore the input source specification, irrespective of whether there was aTHROWor not. This would also eliminate the anomaly.
Most systems implementingTHROWalready implement the proposed behaviour. I have never heard of anyone complaining about that, neither from Gforth users nor otherwise. This indicates that no existing programs would be affected by the change.AFAIK, there exist no experiences with the alternative.
- Michael L. Gassanenko:
- I agree. AFAIK, people (including myself) do implement
CATCHandTHROWwithout input souurce restoration, because if your program controls live hardware, why should you spend time and memory on>INetc.?
- Peter Knaggs:
- The
QUERY?word is defined as obsolescent and will be removed in the next revision of the standard. Moving the responsibility for input stream management to the input stream handling words would tend to make sense.