My bad - 'while true' is wrong. It should be 'while True'
_____
From: Anand kumar [mailto:a.anandku...@gmail.com]
Sent: 01 April 2005 13:01
To: Smoke-VM@googlegroups.com
Subject: Re: Loop issues
Regarding the boolean, should I introduce another data type named "Boolean"?
I think not introducing it will work perfectly too. All you have to do is,
check if the loaded name string is "True" or "False" it's a boolean. It's no
problem for me to introduce another datatype, but that should be
unnecessary.
On Apr 1, 2005 12:47 PM, Anand kumar <a.anandku...@gmail.com> wrote:
1. SETUP_LOOP <arg> in python indicates that the instructions after
this opcode and till the <arg> bytes are to be considered a Block. I am not
really sure why a loop has to a block. Maybe for use as another scope.
Unless we wnat to support it, I can temporarily make this a stop_code.
For 2. and 3., I guess I will have to see if the loaded name is "True" or
"False" to identify a boolean. This will work since these two are reserved
names. I will make this change in the next update.
On Mar 31, 2005 12:31 AM, Sriram Krishnan <srir...@gmail.com> wrote:
Anand - what's the status on loops?
The following code
while true:
print 10
gives me this output
def __main__()
{
const_table
{
0 integer 10
1 None None
2 string "true"
}
SETUP_LOOP 8
LOAD_NAME 2
JUMP_IF_FALSE 5
POP_TOP
LOAD_CONSTANT 0
PRINT_ITEM
PRINT_NEWLINE
JUMP 2
POP_TOP
LOAD_CONSTANT 1
RETURN_VALUE
}
a) Should I do SETUP_LOOP?
b) Why are we loading "true" using "LOAD_NAME"?
c) How should I handle strings as booleans?
Sriram
--
_________________________________________
I blog @ http://myxp.blogspot.com <http://myxp.blogspot.com/>
Also @ http://spaces.msn.com/members/tentod
------------------------------------------------------------------------
--
_________________________________________
I blog @ http://myxp.blogspot.com
Also @ http://spaces.msn.com/members/tentod
------------------------------------------------------------------------