Re: "Goto" statement in Python

2017-04-13 Thread Mikhail V
On 13 April 2017 at 19:38, Ian Kelly wrote: > On Thu, Apr 13, 2017 at 11:25 AM, Mikhail V wrote: >> On 13 April 2017 at 18:48, Ian Kelly wrote: >>> On Thu, Apr 13, 2017 at 10:23 AM, Mikhail V wrote:

Re: "Goto" statement in Python

2017-04-13 Thread Rustom Mody
On Thursday, April 13, 2017 at 11:19:38 PM UTC+5:30, Ian wrote: > On Thu, Apr 13, 2017 at 11:39 AM, Rustom Mody wrote: > > My broader point (vive la Trump) was that if we learn to actively tolerate > > people with views wildly far from ours, the world would be a better place. > > I fail to see

Re: "Goto" statement in Python

2017-04-13 Thread Ian Kelly
On Thu, Apr 13, 2017 at 11:39 AM, Rustom Mody wrote: > My broader point (vive la Trump) was that if we learn to actively tolerate > people with views wildly far from ours, the world would be a better place. I fail to see how my comment "Functions and exceptions are

Re: "Goto" statement in Python

2017-04-13 Thread Rob Gaddi
On 04/13/2017 08:26 AM, Marko Rauhamaa wrote: Chris Angelico : Personally, I can't remember the last time I yearned for "goto" in Python, and the only times I've ever wished for it or used it in other languages have been multi-loop breaks or "for...else" blocks. And neither

Re: "Goto" statement in Python

2017-04-13 Thread Rustom Mody
On Thursday, April 13, 2017 at 10:56:53 PM UTC+5:30, Rob Gaddi wrote: > On 04/13/2017 10:13 AM, Rustom Mody wrote: > > On Thursday, April 13, 2017 at 10:19:33 PM UTC+5:30, Ian wrote: > >> On Thu, Apr 13, 2017 at 10:23 AM, Mikhail V wrote: > >>> Now I wonder, have we already collected *all* bells

Re: "Goto" statement in Python

2017-04-13 Thread Ian Kelly
On Thu, Apr 13, 2017 at 11:25 AM, Mikhail V wrote: > On 13 April 2017 at 18:48, Ian Kelly wrote: >> On Thu, Apr 13, 2017 at 10:23 AM, Mikhail V wrote: >>> Now I wonder, have we already collected *all* bells and whistles of

Re: "Goto" statement in Python

2017-04-13 Thread Ian Kelly
On Thu, Apr 13, 2017 at 11:13 AM, Rustom Mody wrote: > What to do?? > Ask Trump? > [I guess we now need a Godwin 2.0 with :s/Hitler/Trump ] Not even close. Whatever one's opinion may be of Trump, he hasn't murdered millions of people. --

Re: "Goto" statement in Python

2017-04-13 Thread Rob Gaddi
On 04/13/2017 10:13 AM, Rustom Mody wrote: On Thursday, April 13, 2017 at 10:19:33 PM UTC+5:30, Ian wrote: On Thu, Apr 13, 2017 at 10:23 AM, Mikhail V wrote: Now I wonder, have we already collected *all* bells and whistles of Python in these two examples, or is there something else for

Re: "Goto" statement in Python

2017-04-13 Thread Thomas Nyberg
On 04/12/2017 04:42 PM, Mikhail V wrote: > For me it looks clear and I'd say easy to comprehend, > Main critic would be obviously that it is not > a good, *scalable application*, but quite often I don't > even have this in mind, and just want to express a > step-by-step direct instructions. I

Re: "Goto" statement in Python

2017-04-13 Thread Mikhail V
On 13 April 2017 at 18:48, Ian Kelly wrote: > On Thu, Apr 13, 2017 at 10:23 AM, Mikhail V wrote: >> Now I wonder, have we already collected *all* bells and whistles of Python >> in these two examples, or is there something else for expressing trivial

Re: "Goto" statement in Python

2017-04-13 Thread bartc
On 13/04/2017 16:03, Ian Kelly wrote: On Thu, Apr 13, 2017 at 8:52 AM, bartc wrote: On 13/04/2017 15:35, Chris Angelico wrote: Personally, I can't remember the last time I yearned for "goto" in Python, and the only times I've ever wished for it or used it in other languages

Re: "Goto" statement in Python

2017-04-13 Thread Rustom Mody
On Thursday, April 13, 2017 at 10:19:33 PM UTC+5:30, Ian wrote: > On Thu, Apr 13, 2017 at 10:23 AM, Mikhail V wrote: > > Now I wonder, have we already collected *all* bells and whistles of Python > > in these two examples, or is there something else for expressing trivial > > thing. > >

Re: "Goto" statement in Python

2017-04-13 Thread Ian Kelly
On Thu, Apr 13, 2017 at 10:23 AM, Mikhail V wrote: > Now I wonder, have we already collected *all* bells and whistles of Python > in these two examples, or is there something else for expressing trivial > thing. Functions and exceptions are considered "bells and whistles"?

Re: "Goto" statement in Python

2017-04-13 Thread Mikhail V
On 13 April 2017 at 02:17, Rob Gaddi wrote: > > def finder: > for s in S: > if s == 'i': > return 'found on stage 1' > > S = S + ' hello world' > for s in S: > if s == 'd': > return 'found on stage 2' > > raise ValueError('not found;

Re: "Goto" statement in Python

2017-04-13 Thread Marko Rauhamaa
Chris Angelico : > Personally, I can't remember the last time I yearned for "goto" in > Python, and the only times I've ever wished for it or used it in other > languages have been multi-loop breaks or "for...else" blocks. And > neither is very frequent. I have occasionally

Re: "Goto" statement in Python

2017-04-13 Thread Ian Kelly
On Thu, Apr 13, 2017 at 8:52 AM, bartc wrote: > On 13/04/2017 15:35, Chris Angelico wrote: >> Personally, I can't remember the last time I yearned for "goto" in >> Python, and the only times I've ever wished for it or used it in other >> languages have been multi-loop breaks or

Re: "Goto" statement in Python

2017-04-13 Thread bartc
On 13/04/2017 15:35, Chris Angelico wrote: On Thu, Apr 13, 2017 at 9:31 PM, alister wrote: I expect you could simulate most of these with a custom exception for example break from nested loop: class GoTo(Exception): pass try: for i in range(100):

Re: "Goto" statement in Python

2017-04-13 Thread Chris Angelico
On Thu, Apr 13, 2017 at 9:31 PM, alister wrote: > I expect you could simulate most of these with a custom exception > for example break from nested loop: > > class GoTo(Exception): > pass > > try: > for i in range(100): > print i > for j in range

Re: "Goto" statement in Python

2017-04-13 Thread alister
On Thu, 13 Apr 2017 01:42:01 +0200, Mikhail V wrote: > On 12 April 2017 at 02:44, Nathan Ernst wrote: >> goto is a misunderstood and much misaligned creature. It is a very >> useful feature, but like nearly any programming construct can be >> abused. >> >> Constructs like

Re: "Goto" statement in Python

2017-04-12 Thread Rob Gaddi
On 04/12/2017 04:42 PM, Mikhail V wrote: On 12 April 2017 at 02:44, Nathan Ernst wrote: goto is a misunderstood and much misaligned creature. It is a very useful feature, but like nearly any programming construct can be abused. Constructs like 'break', 'continue' or

Re: Goto

2007-06-17 Thread Tina I
Daniel Nogradi wrote: How does one effect a goto in python? I only want to use it for debug. I dasn't slap an if clause around the portion to dummy out, the indentation police will nab me. http://entrian.com/goto/ LOL!! * major flashback to horrible BASIC programs from the eighties * Back

Re: Goto

2007-06-17 Thread John Machin
On Jun 14, 4:32 pm, Hendrik van Rooyen [EMAIL PROTECTED] wrote: [snip] Anything more fancy is Verboten - except, that, if you ask nicely, John Machin might explain his comefrom construct. And maybe I will understand it this time around... Hendrik, if you google for 'comefrom' in this

Re: Goto

2007-06-17 Thread Neil Cerutti
On 2007-06-17, Tina I [EMAIL PROTECTED] wrote: Back then I took a course in structured BASIC programming (now there is a contradiction in terms) and the instructor warned about goto time and time again. But his biggest mistake was to tell us that if we had to use goto at least we should

Re: Goto

2007-06-14 Thread Hendrik van Rooyen
HMS Surprise [EMAIL PROTECTED] wrote: How does one effect a goto in python? I only want to use it for debug. I dasn't slap an if clause around the portion to dummy out, the indentation police will nab me. I use a global boolean called trace: if trace: do debug stuff But to try to

Re: Goto

2007-06-13 Thread Daniel Nogradi
How does one effect a goto in python? I only want to use it for debug. I dasn't slap an if clause around the portion to dummy out, the indentation police will nab me. http://entrian.com/goto/ -- http://mail.python.org/mailman/listinfo/python-list

Re: Goto

2007-06-13 Thread Carsten Haese
On Wed, 2007-06-13 at 12:20 -0700, HMS Surprise wrote: How does one effect a goto in python? One doesn't. I only want to use it for debug. I dasn't slap an if clause around the portion to dummy out, the indentation police will nab me. If you want to disable a code block without indenting

Re: Goto

2007-06-13 Thread HMS Surprise
Thanks folks! jh -- http://mail.python.org/mailman/listinfo/python-list

Re: Goto XY

2005-11-09 Thread ale . of . ginger
OK - I added the import WConio line. But when I run import WConio print going to x10,y10... WConio.gotoxy(10,10) print Done the above, I get the following error: WConio.gotoxy(10,10) error: GetConOut Failed I installed the WConio to the ../site-packages/ folder in Python24, and when it didn't

Re: Goto XY

2005-11-09 Thread Richie Hindle
[ale.of.ginger] WConio.gotoxy(10,10) error: GetConOut Failed Are you running at a Windows Command Prompt, or in an IDE? As I understand it, WConio will only work in a Windows Command Prompt. -- Richie Hindle [EMAIL PROTECTED] -- http://mail.python.org/mailman/listinfo/python-list

Re: Goto XY

2005-11-08 Thread Jean-Paul Calderone
On 8 Nov 2005 17:27:24 -0800, [EMAIL PROTECTED] wrote: Is there some command in python so that I can read a key's input and then use a gotoxy() function to move the cursor on screen? e.g.: (psuedo-code) When the right arrow is pushed, cursor gotoxy(x+1,y) You can uses curses for this, on

Re: Goto XY

2005-11-08 Thread David Wahler
[EMAIL PROTECTED] wrote: Is there some command in python so that I can read a key's input and then use a gotoxy() function to move the cursor on screen? e.g.: (psuedo-code) When the right arrow is pushed, cursor gotoxy(x+1,y) Thanks. On Unix-like platforms, this functionality is provided

Re: Goto XY

2005-11-08 Thread Mike Meyer
[EMAIL PROTECTED] writes: Is there some command in python so that I can read a key's input and then use a gotoxy() function to move the cursor on screen? e.g.: (psuedo-code) When the right arrow is pushed, cursor gotoxy(x+1,y) You want curses. A version is included in the standard library

Re: Goto XY

2005-11-08 Thread jmdeschamps
WConio does this for Windows. See... getkey() and gotoxy() http://newcenturycomputers.net/projects/wconio.html -- http://mail.python.org/mailman/listinfo/python-list

Re: Goto XY

2005-11-08 Thread ale . of . ginger
Thanks -- I downloaded WConio. When I just tried it out in the IDLE, it said: NameError: name 'WConio' is not defined I assume I have to use a header somewhere (import WConio ?). Or is there something I'm missing (I downloaded the Python 2.4 (I have 2.4.2) auto installer and it ran fine...)

Re: Goto XY

2005-11-08 Thread David Wahler
[EMAIL PROTECTED] wrote: I assume I have to use a header somewhere (import WConio ?). If you had tried it, you would have discovered that import WConio is exactly what you need. Don't be afraid to experiment! -- David -- http://mail.python.org/mailman/listinfo/python-list

Re: Goto XY

2005-11-08 Thread jmdeschamps
Like David said below, you need to import WConio but then repemeber when you *import someLib* you have to use qualified names such as WConio.getkey() Example: import WConio s=WConio.getkey() if s == right: WConio.gotoxy(10,10) WConio.putch(W) s=WConio.getch() --

Re: Goto XY

2005-11-08 Thread jmdeschamps
Like David said above... ;-) -- http://mail.python.org/mailman/listinfo/python-list

Re: Goto XY

2005-11-08 Thread Chris F.A. Johnson
On 2005-11-09, [EMAIL PROTECTED] wrote: Is there some command in python so that I can read a key's input and then use a gotoxy() function to move the cursor on screen? e.g.: (psuedo-code) You can use curses, but that may be more trouble than it's worth. If you don't mind limiting

Re: Goto XY

2005-11-08 Thread Jean-Paul Calderone
On Tue, 8 Nov 2005 22:33:47 -0500, Chris F.A. Johnson [EMAIL PROTECTED] wrote: [snip] To read a single keystroke, see Claudio Grondi's post in the thread python without OO from last January. Function and cursor keys return more than a single character, so more work is

Re: Goto XY

2005-11-08 Thread Grant Edwards
On 2005-11-09, Chris F.A. Johnson [EMAIL PROTECTED] wrote: Is there some command in python so that I can read a key's input and then use a gotoxy() function to move the cursor on screen? e.g.: (psuedo-code) You can use curses, but that may be more trouble than it's worth. In which case you

Re: Goto XY

2005-11-08 Thread Chris F.A. Johnson
On 2005-11-09, Jean-Paul Calderone wrote: On Tue, 8 Nov 2005 22:33:47 -0500, Chris F.A. Johnson [EMAIL PROTECTED] wrote: [snip] To read a single keystroke, see Claudio Grondi's post in the thread python without OO from last January. Function and cursor keys return more than a

Re: Goto XY

2005-11-08 Thread Chris F.A. Johnson
On 2005-11-09, Grant Edwards wrote: On 2005-11-09, Chris F.A. Johnson [EMAIL PROTECTED] wrote: Is there some command in python so that I can read a key's input and then use a gotoxy() function to move the cursor on screen? e.g.: (psuedo-code) You can use curses, but that may be more

Re: goto

2005-07-22 Thread Mike Meyer
Rocco Moretti [EMAIL PROTECTED] writes: My favorite infinte loop with while is: i = 0 while i 20: do_process(i) Note the prominent *lack* of any change to i here? Oh, for: from i = 0 invariant 0 = i = 20 variant 21 - i until i 19 loop

Re: goto

2005-07-21 Thread Rocco Moretti
My favorite infinte loop with while is: i = 0 while i 20: do_process(i) Note the prominent *lack* of any change to i here? Oh, for: from i = 0 invariant 0 = i = 20 variant 21 - i until i 19 loop do_process(i) which throws an

Re: goto

2005-07-21 Thread Michael Hudson
[EMAIL PROTECTED] writes: what is the equivalent of C languages' goto statement in python? You really shouldn't use goto. Fortunately you can't. Steven Of course you can :-) Steven You can write your own Python interpreter, in Python, and add a Steven goto

Re: goto

2005-07-20 Thread Sybren Stuvel
Mike Meyer enlightened us with: I dislike gotos because it is too easy to inadvertently create infinite loops. 10 WINK; 20 GOTO 10 And it's impossible without them? while True: pass I thought the same thing, but then I read it again and thought about the inadvertently. As soon as you see a

Re: goto

2005-07-20 Thread Peter Hansen
Sybren Stuvel wrote: Mike Meyer enlightened us with: I dislike gotos because it is too easy to inadvertently create infinite loops. 10 WINK; 20 GOTO 10 And it's impossible without them? while True: pass I thought the same thing, but then I read it again and thought about the

Re: goto

2005-07-20 Thread Mike Meyer
Peter Hansen [EMAIL PROTECTED] writes: Sybren Stuvel wrote: Mike Meyer enlightened us with: I dislike gotos because it is too easy to inadvertently create infinite loops. 10 WINK; 20 GOTO 10 And it's impossible without them? while True: pass I thought the same thing, but then I read it again

Re: goto

2005-07-19 Thread Sybren Stuvel
rbt enlightened us with: Many of the world's most profitable software companies (MS for example) have thousands of goto statements in their code... oh the horror of it all. Why aren't these enlightened-by-the-gods know-it-alls as profitable as these obviously ignorant companies? They write

Re: goto

2005-07-19 Thread Robert Kern
rbt wrote: IMO, most of the people who deride goto do so because they heard or read where someone else did. Or perhaps, like me, they have had to maintain FORTRAN code written by a scientist who apparently hadn't heard of subroutines. Spaghetti doesn't quite describe it. I've settled on

Re: goto

2005-07-19 Thread Steven D'Aprano
On Tue, 19 Jul 2005 02:33:02 +, Leif K-Brooks wrote: rbt wrote: IMO, most of the people who deride goto do so because they heard or read where someone else did. 1 GOTO 17 2 mean,GOTO 5 3 couldGOTO 6 [snip] That's great, but not a patch on the power of COMEFROM!

Re: goto

2005-07-19 Thread Rocco Moretti
Leif K-Brooks wrote: rbt wrote: IMO, most of the people who deride goto do so because they heard or read where someone else did. 1 GOTO 17 2 mean,GOTO 5 3 couldGOTO 6 4 with GOTO 7 5 what GOTO 3 6 possibly GOTO 24 7 you! GOTO 21 8

Re: goto

2005-07-19 Thread George Sakkis
rbt [EMAIL PROTECTED] wrote: On Mon, 2005-07-18 at 12:27 -0600, Steven Bethard wrote: Hayri ERDENER wrote: what is the equivalent of C languages' goto statement in python? Download the goto module: http://www.entrian.com/goto/ And you can use goto to your heart's content. And

Re: goto

2005-07-19 Thread rbt
On Tue, 2005-07-19 at 10:02 -0400, George Sakkis wrote: rbt [EMAIL PROTECTED] wrote: On Mon, 2005-07-18 at 12:27 -0600, Steven Bethard wrote: Hayri ERDENER wrote: what is the equivalent of C languages' goto statement in python? Download the goto module:

Re: goto

2005-07-19 Thread Steven D'Aprano
On Tue, 19 Jul 2005 11:29:58 -0400, rbt wrote: It should not really come as a shock that the same fellow who came up with a brilliant efficient way to generate all permutations (http://tinyurl.com/dnazs) is also in favor of goto. Coming next from rbt: Pointer arithmetic in python ?.

Re: goto

2005-07-19 Thread rbt
On Wed, 2005-07-20 at 03:43 +1000, Steven D'Aprano wrote: On Tue, 19 Jul 2005 11:29:58 -0400, rbt wrote: It should not really come as a shock that the same fellow who came up with a brilliant efficient way to generate all permutations (http://tinyurl.com/dnazs) is also in favor of

Re: goto

2005-07-19 Thread Fernando Perez
Steven Bethard wrote: Fernando Perez wrote: Steven Bethard wrote: Download the goto module: http://www.entrian.com/goto/ And you can use goto to your heart's content. And to the horror of all your friends/coworkers. ;) That is actually a _really_ cool piece of code, in terms of

Re: goto

2005-07-19 Thread Terry Hancock
On Monday 18 July 2005 06:48 am, Hayri ERDENER wrote: hi, what is the equivalent of C languages' goto statement in python? best regards For the only valid uses of C's goto, you should use the try-except or the for/while-break-else idioms. See the language reference for details on these

Re: goto

2005-07-19 Thread Mike Meyer
Rocco Moretti [EMAIL PROTECTED] writes: Leif K-Brooks wrote: rbt wrote: IMO, most of the people who deride goto do so because they heard or read where someone else did. 1 GOTO 17 2 mean,GOTO 5 3 couldGOTO 6 4 with GOTO 7 5 what GOTO 3 6 possibly

Re: goto

2005-07-18 Thread Mage
Hayri ERDENER wrote: hi, what is the equivalent of C languages' goto statement in python? best regards You really shouldn't use goto. Fortunately you can't. Mage -- http://mail.python.org/mailman/listinfo/python-list

Re: goto

2005-07-18 Thread Simon Brunning
On 7/18/05, Hayri ERDENER [EMAIL PROTECTED] wrote: hi, what is the equivalent of C languages' goto statement in python? best regards http://groups-beta.google.com/group/comp.lang.python/browse_thread/thread/832906c6122dc137 Let's not go through *that* again... -- Cheers, Simon B, [EMAIL

Re: goto

2005-07-18 Thread Steven D'Aprano
On Mon, 18 Jul 2005 14:06:14 +0200, Mage wrote: Hayri ERDENER wrote: hi, what is the equivalent of C languages' goto statement in python? best regards You really shouldn't use goto. Fortunately you can't. Of course you can :-) You can write your own Python interpreter, in Python,

Re: goto

2005-07-18 Thread John Roth
Mage [EMAIL PROTECTED] wrote in message news:[EMAIL PROTECTED] Hayri ERDENER wrote: hi, what is the equivalent of C languages' goto statement in python? best regards You really shouldn't use goto. True. Fortunately you can't. Of course you can. Recent versions of Python have the ability

Re: goto

2005-07-18 Thread skip
what is the equivalent of C languages' goto statement in python? You really shouldn't use goto. Fortunately you can't. Steven Of course you can :-) Steven You can write your own Python interpreter, in Python, and add a Steven goto to it. Maybe easier would be to

Re: goto

2005-07-18 Thread Comcast
In python there is no goto statement. In C I use goto only in one case: to exit more then one level of blocks (as a matter of fact, I always use goto EXIT in C, where EXIT is the label of the end of the function). In python you can mimic this by throwing an exception and catching it. Exception

Re: goto

2005-07-18 Thread Peter Hansen
Hayri ERDENER wrote: what is the equivalent of C languages' goto statement in python? Steven offered the best reply here, in that he wondered what you actually need this for. What usage of goto in C are you hoping to emulate? It's a certainty that some other non-goto technique will be more

Re: goto

2005-07-18 Thread Mage
[EMAIL PROTECTED] wrote: what is the equivalent of C languages' goto statement in python? You really shouldn't use goto. Fortunately you can't. Steven Of course you can :-) Steven You can write your own Python interpreter, in Python, and add a Steven goto to it.

Re: goto

2005-07-18 Thread Kay Schluehr
Hayri ERDENER schrieb: hi, what is the equivalent of C languages' goto statement in python? best regards No, but some of goto's use cases can be covered by unconditional jumps provided by exceptions. Here is a C function using goto: void main() { int i, j; for ( i = 0; i 10; i++

Re: goto

2005-07-18 Thread Gerhard Haering
On Mon, Jul 18, 2005 at 08:40:16AM -0700, Kay Schluehr wrote: Hayri ERDENER schrieb: hi, what is the equivalent of C languages' goto statement in python? best regards No, but some of goto's use cases can be covered by unconditional jumps provided by exceptions. [...] I like the named

Re: goto

2005-07-18 Thread rbt
On Mon, 2005-07-18 at 12:27 -0600, Steven Bethard wrote: Hayri ERDENER wrote: what is the equivalent of C languages' goto statement in python? Download the goto module: http://www.entrian.com/goto/ And you can use goto to your heart's content. And to the horror of all your

Re: goto

2005-07-18 Thread Steven Bethard
Hayri ERDENER wrote: what is the equivalent of C languages' goto statement in python? Download the goto module: http://www.entrian.com/goto/ And you can use goto to your heart's content. And to the horror of all your friends/coworkers. ;) STeVe --

Re: goto

2005-07-18 Thread Dan Bishop
rbt wrote: On Mon, 2005-07-18 at 12:27 -0600, Steven Bethard wrote: Hayri ERDENER wrote: what is the equivalent of C languages' goto statement in python? Download the goto module: http://www.entrian.com/goto/ And you can use goto to your heart's content. And to the horror of

Re: goto

2005-07-18 Thread Steven Bethard
rbt wrote: Steven Bethard wrote: Download the goto module: http://www.entrian.com/goto/ And you can use goto to your heart's content. And to the horror of all your friends/coworkers. ;) Shouldn't that be to the horror of all your goto-snob friends. IMO, most of the people who deride

Re: goto

2005-07-18 Thread Steven D'Aprano
On Mon, 18 Jul 2005 16:37:57 -0400, rbt wrote: Shouldn't that be to the horror of all your goto-snob friends. IMO, most of the people who deride goto do so because they heard or read where someone else did. Or because they actually programmed in languages that used goto for flow control.

Re: goto

2005-07-18 Thread Mike Meyer
rbt [EMAIL PROTECTED] writes: Many of the world's most profitable software companies (MS for example) have thousands of goto statements in their code... oh the horror of it all. Why aren't these enlightened-by-the-gods know-it-alls as profitable as these obviously ignorant companies? Because

Re: goto

2005-07-18 Thread Fernando Perez
Steven Bethard wrote: Hayri ERDENER wrote: what is the equivalent of C languages' goto statement in python? Download the goto module: http://www.entrian.com/goto/ And you can use goto to your heart's content. And to the horror of all your friends/coworkers. ;) STeVe That is

Re: goto

2005-07-18 Thread D H
Mike Meyer wrote: rbt [EMAIL PROTECTED] writes: Many of the world's most profitable software companies (MS for example) have thousands of goto statements in their code... oh the horror of it all. Why aren't these enlightened-by-the-gods know-it-alls as profitable as these obviously ignorant

Re: goto

2005-07-18 Thread Leif K-Brooks
rbt wrote: IMO, most of the people who deride goto do so because they heard or read where someone else did. 1 GOTO 17 2 mean,GOTO 5 3 couldGOTO 6 4 with GOTO 7 5 what GOTO 3 6 possibly GOTO 24 7 you! GOTO 21 8 that GOTO 18 9 really,

Re: goto

2005-07-18 Thread rbt
10 PRINT YOU'RE NOT RIGHT IN THE HEAD. 20 GOTO 10 On Tue, 2005-07-19 at 02:33 +, Leif K-Brooks wrote: rbt wrote: IMO, most of the people who deride goto do so because they heard or read where someone else did. 1 GOTO 17 2 mean,GOTO 5 3 couldGOTO 6 4 with

Re: goto

2005-07-18 Thread Steven Bethard
Fernando Perez wrote: Steven Bethard wrote: Download the goto module: http://www.entrian.com/goto/ And you can use goto to your heart's content. And to the horror of all your friends/coworkers. ;) That is actually a _really_ cool piece of code, in terms of showing off the kind of

Re: goto statement

2005-04-28 Thread Mikhail 'Xen' Kashkin
If you use ssh, then you must to learn 'scp'. Or buy books about programming ;) -- http://mail.python.org/mailman/listinfo/python-list

Re: goto statement

2005-04-26 Thread jfouhy
Maxim Kasimov wrote: Maxim Kasimov [EMAIL PROTECTED] writes: WOW, just greate! ... but i'd like to relax at some more interesting way than to comment each of rows but what if i just can't to do this becouse i'm working thrue ssh, and have to use only installed editors (such as vi) A

Re: goto statement

2005-04-26 Thread jfouhy
Tim Daneliuk wrote: OK - Here's some reasoning that may illuminate it. We could, in theory, reduce any language to the minimal Boehm Jacopini control structures (iirc there were only four). In effect, anything beyond these is syntactic sugar. IOW, feel free to use a minimalist Turing

Re: goto statement

2005-04-22 Thread Mike Meyer
Grant Edwards [EMAIL PROTECTED] writes: On 2005-04-21, Roy Smith [EMAIL PROTECTED] wrote: Grant Edwards [EMAIL PROTECTED] wrote: Sure, but what about the case where his program is on paper tape and all he has for an editor is an ice pick? Can't you emulate that in emacs with M-X

Re: goto statement

2005-04-22 Thread Reinhold Birkenfeld
Grant Edwards wrote: On 2005-04-21, Sergei Organov [EMAIL PROTECTED] wrote: Well, I'm writing for embedded realtime systems in C/C++ and have never encountered a single need to use goto. I have encountered situations in C programs where the best thing to use was a goto. Those situations

Re: goto statement

2005-04-22 Thread Reinhold Birkenfeld
Grant Edwards wrote: On 2005-04-21, Sergei Organov [EMAIL PROTECTED] wrote: Grant Edwards [EMAIL PROTECTED] writes: On 2005-04-21, Peter Maas [EMAIL PROTECTED] wrote: Maxim Kasimov schrieb: but what if i just can't to do this becouse i'm working thrue ssh, and have to use only installed

Re: goto statement

2005-04-22 Thread Grant Edwards
On 2005-04-22, Reinhold Birkenfeld [EMAIL PROTECTED] wrote: Sure, but what about the case where his program is on paper tape and all he has for an editor is an ice pick? Then inserting goto doesn't seem to be an acceptable option either ;) Scissors, tape, and a box full of prepunched goto

Re: goto statement

2005-04-22 Thread Peter Hansen
Grant Edwards wrote: Sure, but what about the case where his program is on paper tape and all he has for an editor is an ice pick? Paper tape? Luxury -- http://mail.python.org/mailman/listinfo/python-list

Re: goto statement

2005-04-21 Thread Maxim Kasimov
1. comment for debug It can be used in the same way, as the comments for debugging are used, but it will be easier than to use or ''', or using features of text-editors, when it is necessary to comment piece of code which already contains ''' or/and strings already, or there is another

Re: goto statement

2005-04-21 Thread Tim Daneliuk
Reinhold Birkenfeld wrote: John Bokma wrote: Mage wrote: praba kar wrote: Dear All, In Python what is equivalent to goto statement You shouldn't use goto in high-level languages. Nonsense +1 Thank you! Above all your claim is well justified. These brilliant arguments you have put forth really

Re: goto statement

2005-04-21 Thread Reinhold Birkenfeld
Maxim Kasimov wrote: 1) goto exempts from necessity to install new software (it is critical for remote working, for example, installing X11 may be impossible at all) Attributing the need for a language feature to restrictions of your ambience is hilarious. Reinhold --

Re: goto statement

2005-04-21 Thread Sergei Organov
Maxim Kasimov [EMAIL PROTECTED] writes: 1. comment for debug It can be used in the same way, as the comments for debugging are used, but it will be easier than to use or ''', or using features of text-editors, when it is necessary to comment piece of code which already

Re: goto statement

2005-04-21 Thread Sergei Organov
Tim Daneliuk [EMAIL PROTECTED] writes: [...] Some HLLs almost have to have it by definition. I cut my teeth as programmer writing for embedded realtime systems in a HLL (PL/M). While you could, in theory, completely avoid 'goto' in a realtime environment, it would make all manner of

Re: goto statement

2005-04-21 Thread Diez B. Roggisch
implement. BTW, all modern systems come complete with 'goto' implemented in *hardware* - they're called interrupts. That's not goto - that is a asynchronous function call - much closer related to multithreading. In an interrupt, you can always jump back to the main program using rte (return

Re: goto statement

2005-04-21 Thread Maxim Kasimov
Sergei Organov wrote: Maxim Kasimov [EMAIL PROTECTED] writes: 1. comment for debug It can be used in the same way, as the comments for debugging are used, but it will be easier than to use or ''', or using features of text-editors, when it is necessary to comment piece of code which

Re: goto statement

2005-04-21 Thread Grant Edwards
On 2005-04-21, Sergei Organov [EMAIL PROTECTED] wrote: Well, I'm writing for embedded realtime systems in C/C++ and have never encountered a single need to use goto. I have encountered situations in C programs where the best thing to use was a goto. Those situations have always been handled

Re: goto statement

2005-04-21 Thread John Bokma
Do Re Mi chel La Si Do wrote: +1 I am modded up :-D -- John MexIT: http://johnbokma.com/mexit/ personal page: http://johnbokma.com/ Experienced programmer available: http://castleamber.com/ Happy Customers:

Re: goto statement

2005-04-21 Thread John Bokma
Reinhold Birkenfeld wrote: John Bokma wrote: Mage wrote: praba kar wrote: Dear All, In Python what is equivalent to goto statement You shouldn't use goto in high-level languages. Nonsense Thank you! Above all your claim is well justified. You are probably smart enough

Re: goto statement

2005-04-21 Thread Mage
Michael Soulier wrote: On 4/20/05, Maxim Kasimov [EMAIL PROTECTED] wrote: but what if i just can't to do this becouse i'm working thrue ssh, and have to use only installed editors (such as vi) Then learn to use vi. :.,+10s/^/# comment the next 10 lines Or if you don't like

Re: goto statement

2005-04-21 Thread Sergei Organov
Maxim Kasimov [EMAIL PROTECTED] writes: Sergei Organov wrote: Maxim Kasimov [EMAIL PROTECTED] writes: 1. comment for debug It can be used in the same way, as the comments for debugging are used, but it will be easier than to use or ''', or using features of text-editors, when it

<    1   2   3   >