Web Images Videos Maps News Shopping Gmail more »
Recently Visited Groups | Help | Sign in
Google Groups Home
Loop issues
There are currently too many topics in this group that display first. To make this topic appear first, remove this option from another topic.
There was an error processing your request. Please try again.
flag
  4 messages - Collapse all  -  Translate all to Translated (View all originals)
The group you are posting to is a Usenet group. Messages posted to this group will make your email address visible to anyone on the Internet.
Your reply message has not been sent.
Your post was successful
 
From:
To:
Cc:
Followup To:
Add Cc | Add Followup-to | Edit Subject
Subject:
Validation:
For verification purposes please type the characters you see in the picture below or the numbers you hear by clicking the accessibility icon. Listen and type the numbers you hear
 
Sriram Krishnan  
View profile  
 More options Mar 30 2005, 2:01 pm
From: "Sriram Krishnan" <srir...@gmail.com>
Date: Thu, 31 Mar 2005 00:31:01 +0530
Local: Wed, Mar 30 2005 2:01 pm
Subject: Loop issues

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


    Reply to author    Forward  
You must Sign in before you can post messages.
To post a message you must first join this group.
Please update your nickname on the subscription settings page before posting.
You do not have the permission required to post.
Anand kumar  
View profile  
 More options Apr 1 2005, 2:17 am
From: Anand kumar <a.anandku...@gmail.com>
Date: Fri, 1 Apr 2005 12:47:48 +0530
Local: Fri, Apr 1 2005 2:17 am
Subject: Re: Loop issues

   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:

--
_________________________________________
I blog @ http://myxp.blogspot.com
Also @ http://spaces.msn.com/members/tentod
------------------------------------------------------------------------

    Reply to author    Forward  
You must Sign in before you can post messages.
To post a message you must first join this group.
Please update your nickname on the subscription settings page before posting.
You do not have the permission required to post.
Anand kumar  
View profile  
 More options Apr 1 2005, 2:30 am
From: Anand kumar <a.anandku...@gmail.com>
Date: Fri, 1 Apr 2005 13:00:52 +0530
Local: Fri, Apr 1 2005 2:30 am
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:

--
_________________________________________
I blog @ http://myxp.blogspot.com
Also @ http://spaces.msn.com/members/tentod
------------------------------------------------------------------------

    Reply to author    Forward  
You must Sign in before you can post messages.
To post a message you must first join this group.
Please update your nickname on the subscription settings page before posting.
You do not have the permission required to post.
Sriram Krishnan  
View profile  
 More options Apr 6 2005, 8:16 am
From: "Sriram Krishnan" <srir...@gmail.com>
Date: Wed, 6 Apr 2005 17:46:40 +0530
Local: Wed, Apr 6 2005 8:16 am
Subject: RE: Loop issues

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
------------------------------------------------------------------------


    Reply to author    Forward  
You must Sign in before you can post messages.
To post a message you must first join this group.
Please update your nickname on the subscription settings page before posting.
You do not have the permission required to post.
End of messages
« Back to Discussions « Newer topic     Older topic »

Create a group - Google Groups - Google Home - Terms of Service - Privacy Policy
©2009 Google