Link to module Stack
Dave Angel
davea at ieee.org
Sat Jan 9 19:17:08 EST 2010
Steven D'Aprano wrote:
> On Sat, 09 Jan 2010 05:56:36 -0500, Dave Angel wrote:
>
>
>>> "InnerInterpreterError" is the most inappropriate exception name I've
>>> ever seen. It has nothing to do with the interpreter, it's a stack
>>> error.
>>>
>>>
>>>
>> It has everything to do with the (Forth) interpreter. Exceptions can
>> readily be named according to their application -- it's not always about
>> Python. Anyway, Forth has an inner-interpreter and an
>> outer-interpreter, and the name will make sense to a Forth programmer.
>>
>
> Pardon me, but I *am* a Forth programmer. Or was, it's been many years,
> and I'm rusty. I guess this is a difference of terminology: what you're
> calling an inner interpreter and an outer interpreter I know of as the
> Forth engine and the (text) interpreter. Gforth refers to them as such,
> so did Leo Brodie's Forth books, and the (ancient) Macintosh Forth
> compiler "Mach 2".
>
>
I'm pretty sure FIG-Forth called them an inner interpreter and outer
interpreter, but I don't remember other sources. FIG-Forth was my first
Forth system, gotten on an 8" diskette. The inner interpreter was
LOADSW, JMP AX, I believe, as it was an indirected threaded interpreter
implementation.
> <snip>
>
>> or even better, without the extra local var:
>>
>> def pop (self):
>> if len(self.__heap) == 0:
>> raise InnerInterpreterError, "stack underflow"
>> return self.__heap.pop(1)
>>
>
> pop(1)? I don't think so.
>
>
>
That was a typo; I meant pop(). And of course others have improved on
my remarks anyway.
DaveA
More information about the Python-list
mailing list