Re: goto statement

2005-04-21 Thread Grant Edwards
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 editors (such as vi) > > - at first line of block enter: ma (mark line as 'a') > - go to last line of block > - ente

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

Re: goto statement

2005-04-21 Thread Peter Maas
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 editors (such as vi) - at first line of block enter: ma (mark line as 'a') - go to last line of block - enter :'a,.s/^/###/ (insert 3 comment chars at begin of line, starting

Re: goto statement

2005-04-21 Thread Sergei Organov
Grant Edwards <[EMAIL PROTECTED]> writes: > On 2005-04-21, Sergei Organov <[EMAIL PROTECTED]> wrote: > > Grant Edwards <[EMAIL PROTECTED]> writes: > > > >> On 2005-04-21, Sergei Organov <[EMAIL PROTECTED]> wrote: > >> > >> > Well, I'm writing for embedded realtime systems in C/C++ and > >> > have

Re: goto statement

2005-04-21 Thread Grant Edwards
On 2005-04-21, Sergei Organov <[EMAIL PROTECTED]> wrote: > Grant Edwards <[EMAIL PROTECTED]> writes: > >> 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 ha

Re: goto statement

2005-04-21 Thread Sergei Organov
Grant Edwards <[EMAIL PROTECTED]> writes: > 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

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

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

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 wel

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 Michael Soulier
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 Mike -- Michael P. Soulier <[EMAIL PROTECTED]> h

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 handle

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 wh

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

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 a

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 -- http://mail.pytho

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

Re: Troll? was: Re: goto statement

2005-04-20 Thread Steve Holden
Maxim Kasimov wrote: André Roberge wrote: Maxim Kasimov wrote: by the way, "goto" statement will be useful for writing more powerful obfuscators Let me get that clear: you want a goto to help with debugging. And you want to obfuscate your code even more? !? Perhaps you need to write in Perl, or s

Re: goto statement

2005-04-20 Thread Cameron Laird
In article <[EMAIL PROTECTED]>, Maxim Kasimov <[EMAIL PROTECTED]> wrote: . . . >>> if you need to comment a couple of code (and then uncomment ), what >>> are you doing then? >> >> >> Use comments? >> > >WOW, just greate!

Re: goto statement

2005-04-20 Thread Cameron Laird
In article <[EMAIL PROTECTED]>, Maxim Kasimov <[EMAIL PROTECTED]> wrote: >Simon Brunning wrote: >> On 4/20/05, Maxim Kasimov <[EMAIL PROTECTED]> wrote: >> >>>it would be quite useful for debuging porposes >> >> >> How does goto help you to remove bugs? >> >> I can certainly see how it helps yo

Re: goto statement

2005-04-20 Thread Robert Kern
Matt Feinstein wrote: On Wed, 20 Apr 2005 10:23:58 +0100 (BST), praba kar <[EMAIL PROTECTED]> wrote: Dear All, In Python what is equivalent to goto statement I'd like to that implemented in an interpreted language. Requires some time travel. Yes, to 2004-04-01. -- Robert Kern [EMAIL PROTECTED] "

Re: goto statement

2005-04-20 Thread Matt Feinstein
On Wed, 20 Apr 2005 10:23:58 +0100 (BST), praba kar <[EMAIL PROTECTED]> wrote: >Dear All, > > In Python what is equivalent to goto statement I'd like to that implemented in an interpreted language. Requires some time travel. Matt Feinstein -- There is no virtue in believing something that can

Re: Troll? was: Re: goto statement

2005-04-20 Thread Fredrik Lundh
Bill Mill wrote: I believe he meant obfuscating bytecode for a commercial product, to try and avoid decompilation, which is often a desirable function for commercial entities. there is no shortage of "jump" instructions on the bytecode level, so if he wants to obfuscate bytecode, all he has to do

Re: goto statement

2005-04-20 Thread Philippe C. Martin
I guess the point could be "where do you draw the line": you can break and continue in Python, but you cannot goto. Some people, so it seems ;-) , would like to see gotos in Python whereas other think breaks and continues should be excluded ...; Regards, Philippe Steve Holden wrote: > Philipp

Re: goto statement

2005-04-20 Thread Steve Holden
Philippe C. Martin wrote: I do not want to pollute the debate but: -) I remember a software QA managanager responsible for "C" coding rules also not allowing us to use 'break', 'continue', or 'return' (in the middle of a function). And I once worked (back in the 1970's) in a software shop where "

Re: Troll? was: Re: goto statement

2005-04-20 Thread Bill Mill
On 4/20/05, Robert Kern <[EMAIL PROTECTED]> wrote: > Maxim Kasimov wrote: > > André Roberge wrote: > > > >> Maxim Kasimov wrote: > >> > >>> > >>> by the way, "goto" statement will be useful for writing more powerful > >>> obfuscators > >>> > >> Let me get that clear: you want a goto to help with de

Re: Troll? was: Re: goto statement

2005-04-20 Thread Robert Kern
Maxim Kasimov wrote: André Roberge wrote: Maxim Kasimov wrote: by the way, "goto" statement will be useful for writing more powerful obfuscators Let me get that clear: you want a goto to help with debugging. And you want to obfuscate your code even more? !? Perhaps you need to write in Perl, or s

Re: Troll? was: Re: goto statement

2005-04-20 Thread Maxim Kasimov
André Roberge wrote: Maxim Kasimov wrote: by the way, "goto" statement will be useful for writing more powerful obfuscators Let me get that clear: you want a goto to help with debugging. And you want to obfuscate your code even more? !? Perhaps you need to write in Perl, or some other similar lan

Re: goto statement

2005-04-20 Thread Philippe C. Martin
Loop bodies (for break) Grant Edwards wrote: > On 2005-04-20, Philippe C. Martin <[EMAIL PROTECTED]> wrote: > >> Although I find them 'cleaner' than goto, would not use goto, >> and certainly do use 'return' in the middle of functions, I >> also agree that some people might think the former do

Re: goto statement

2005-04-20 Thread Grant Edwards
On 2005-04-20, Philippe C. Martin <[EMAIL PROTECTED]> wrote: > Although I find them 'cleaner' than goto, would not use goto, > and certainly do use 'return' in the middle of functions, I > also agree that some people might think the former do reduce > code readibility - ex: I , somehow, do not fee

Re: goto statement

2005-04-20 Thread Philippe C. Martin
I do not want to pollute the debate but: -) I remember a software QA managanager responsible for "C" coding rules also not allowing us to use 'break', 'continue', or 'return' (in the middle of a function). Although I find them 'cleaner' than goto, would not use goto, and certainly do use 'return

Re: goto statement

2005-04-20 Thread TZOTZIOY
On Wed, 20 Apr 2005 16:24:19 +0100, rumours say that Simon Brunning <[EMAIL PROTECTED]> might have written: >On 4/20/05, Christos TZOTZIOY Georgiou <[EMAIL PROTECTED]> wrote: >> If you need more help, I would gladly send you the output of `man vi' >> from a non-GNU Unix. I can also send you the o

Troll? was: Re: goto statement

2005-04-20 Thread André Roberge
Maxim Kasimov wrote: by the way, "goto" statement will be useful for writing more powerful obfuscators Let me get that clear: you want a goto to help with debugging. And you want to obfuscate your code even more? !? Perhaps you need to write in Perl, or some other similar language. Writing in Pyt

Re: goto statement

2005-04-20 Thread TZOTZIOY
On Wed, 20 Apr 2005 18:47:37 +0300, rumours say that Maxim Kasimov <[EMAIL PROTECTED]> might have written: >by the way, "goto" statement will be useful for writing more powerful >obfuscators At this point in time you might want to reconsider what are the true reasons you like python (if you real

Re: goto statement

2005-04-20 Thread TZOTZIOY
On Wed, 20 Apr 2005 18:38:40 +0300, rumours say that Maxim Kasimov <[EMAIL PROTECTED]> might have written: >> If you need more help, I would gladly send you the output of `man vi' >> from a non-GNU Unix. I can also send you the output of `man vim' from a >> GNU system. >is it wrong to debug pyth

Re: goto statement

2005-04-20 Thread Peter Hansen
praba kar wrote: In Python what is equivalent to goto statement The group has been remiss, starting mainly with Mage's unfortunately dogmatic response. What we meant to ask was this: why do you want it? There are better, simpler, cleaner, more readable ways to accomplish what you are trying to d

Re: goto statement

2005-04-20 Thread Peter Hansen
Maxim Kasimov wrote: f..., i don't requesting that "goto" was available in next versions of python, but i'm saying if it will be so, it will be easy and quickly > _debug_ some skripts, _not only_ for commenting Then we go right back to Simon Brunning's question for you: "How does goto help y

Re: goto statement

2005-04-20 Thread Maxim Kasimov
by the way, "goto" statement will be useful for writing more powerful obfuscators -- Best regards, Maxim Kasimov mailto: [EMAIL PROTECTED] -- http://mail.python.org/mailman/listinfo/python-list

Re: goto statement

2005-04-20 Thread Maxim Kasimov
Christos TZOTZIOY Georgiou wrote: On Wed, 20 Apr 2005 16:13:32 +0300, rumours say that Maxim Kasimov <[EMAIL PROTECTED]> might have written: 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) If you use plain vi (not vim) and you

Re: goto statement

2005-04-20 Thread Simon Brunning
On 4/20/05, Christos TZOTZIOY Georgiou <[EMAIL PROTECTED]> wrote: > If you need more help, I would gladly send you the output of `man vi' > from a non-GNU Unix. I can also send you the output of `man vim' from a > GNU system. It'll probably be easier to convince Guido to introduce a 'goto' statem

Re: goto statement

2005-04-20 Thread TZOTZIOY
On Wed, 20 Apr 2005 16:13:32 +0300, rumours say that Maxim Kasimov <[EMAIL PROTECTED]> might have written: >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) If you use plain vi (not vim) and you want to comment e.g. 5 lines o

Re: goto statement

2005-04-20 Thread TZOTZIOY
On Wed, 20 Apr 2005 14:58:35 +0300, rumours say that Maxim Kasimov <[EMAIL PROTECTED]> might have written: >>> if you need to comment a couple of code (and then uncomment ), what >>> are you doing then? >> Use comments? >WOW, just greate! ... but i'd like to relax at some more interesting way

Re: goto statement

2005-04-20 Thread Reinhold Birkenfeld
Maxim Kasimov wrote: > f..., i don't requesting that "goto" was available in next versions of > python, > but i'm saying if it will be so, it will be easy and quickly _debug_ some > skripts, > _not only_ for commenting If you want, you can always use the goto module. Reinhold, no, I

Re: goto statement

2005-04-20 Thread Reinhold Birkenfeld
Maxim Kasimov wrote: >> >> Use multi-line string literals. >> >> ''' > > it will not help if there is another ''' or/and """ inside of code block Yes, but how often do you use them? And aren't you consistent in the choice of your quotes? >> This whole 'code' is "commented out", and you can >>

Re: goto statement

2005-04-20 Thread Maxim Kasimov
Peter Hansen wrote: Maxim Kasimov wrote: Torsten Bronger wrote: HallÃchen! 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

Re: goto statement

2005-04-20 Thread Peter Hansen
Maxim Kasimov wrote: Torsten Bronger wrote: HallÃchen! 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 e

Re: goto statement

2005-04-20 Thread Simon Brunning
On 4/20/05, Maxim Kasimov <[EMAIL PROTECTED]> wrote: > > Or, if you really like the spirit of goto, > > use "if 0:". > > ... and add tabs to each string Get a decent text editor. What are you using? Notepad? -- Cheers, Simon B, [EMAIL PROTECTED], http://www.brunningonline.net/simon/blog/ -- ht

Re: goto statement

2005-04-20 Thread Maxim Kasimov
Torsten Bronger wrote: HallÃchen! 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

Re: goto statement

2005-04-20 Thread Maxim Kasimov
Use multi-line string literals. ''' it will not help if there is another ''' or/and """ inside of code block This whole 'code' is "commented out", and you can use every type of """quote""" except three singles. ''' Or, if you really like the spirit of goto, use "if 0:". ... and add tabs to each str

Re: goto statement

2005-04-20 Thread Michael Hoffman
praba kar wrote: In Python what is equivalent to goto statement http://groups-beta.google.com/group/comp.lang.python/msg/98264a0daa007c46 -- Michael Hoffman -- http://mail.python.org/mailman/listinfo/python-list

Re: goto statement

2005-04-20 Thread Torsten Bronger
HallÃchen! 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 Then just use a good editor. TschÃ, Torsten. -- Torsten Bronger, aquisgrana, europa vetus -- http://mail.python.org/mailman

Re: goto statement

2005-04-20 Thread Do Re Mi chel La Si Do
+1 Michel Claveau -- http://mail.python.org/mailman/listinfo/python-list

Re: goto statement

2005-04-20 Thread Simon Brunning
On 4/20/05, Maxim Kasimov <[EMAIL PROTECTED]> wrote: > WOW, just greate! ... but i'd like to relax at some more interesting way than > to comment each of rows Get a decent text editor. -- Cheers, Simon B, [EMAIL PROTECTED], http://www.brunningonline.net/simon/blog/ -- http://mail.python.org/mai

RE: goto statement

2005-04-20 Thread Sander Steffann
On 4/20/05, praba kar <[EMAIL PROTECTED]> wrote: >In Python what is equivalent to goto statement An old user-friendly cartoon that might be relevant: http://ars.userfriendly.org/cartoons/?id=2506 Have fun :-) Sander -- http://mail.python.org/mailman/listinfo/python-list

Re: goto statement

2005-04-20 Thread Mage
Maxim Kasimov wrote: > WOW, just greate! ... but i'd like to relax at some more interesting > way than to comment each of rows > There are editors that can comment and uncomment blocks. In worst case you can use """ to comment blocks (not elegant but works). Mage -- http://mail.python.or

Re: goto statement

2005-04-20 Thread Reinhold Birkenfeld
Maxim Kasimov wrote: > Robert Kern wrote: >> Maxim Kasimov wrote: >> >>> Simon Brunning wrote: >>> On 4/20/05, Maxim Kasimov <[EMAIL PROTECTED]> wrote: > it would be quite useful for debuging porposes How does goto help you to remove bugs? I can cer

Re: goto statement

2005-04-20 Thread Maxim Kasimov
Robert Kern wrote: Maxim Kasimov wrote: Simon Brunning wrote: On 4/20/05, Maxim Kasimov <[EMAIL PROTECTED]> wrote: it would be quite useful for debuging porposes How does goto help you to remove bugs? I can certainly see how it helps you put them in in the first place... if you need to comment a

Re: goto statement

2005-04-20 Thread Robert Kern
Maxim Kasimov wrote: Simon Brunning wrote: On 4/20/05, Maxim Kasimov <[EMAIL PROTECTED]> wrote: it would be quite useful for debuging porposes How does goto help you to remove bugs? I can certainly see how it helps you put them in in the first place... if you need to comment a couple of code (and

Re: goto statement

2005-04-20 Thread Maxim Kasimov
Simon Brunning wrote: On 4/20/05, Maxim Kasimov <[EMAIL PROTECTED]> wrote: it would be quite useful for debuging porposes How does goto help you to remove bugs? I can certainly see how it helps you put them in in the first place... if you need to comment a couple of code (and then uncomment ), wha

Re: goto statement

2005-04-20 Thread Reinhold Birkenfeld
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. These brilliant arguments you have put

Re: goto statement

2005-04-20 Thread John Bokma
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 -- John MexIT: http://johnbokma.com/mexit/ personal page: htt

Re: goto statement

2005-04-20 Thread Simon Brunning
On 4/20/05, Maxim Kasimov <[EMAIL PROTECTED]> wrote: > it would be quite useful for debuging porposes How does goto help you to remove bugs? I can certainly see how it helps you put them in in the first place... -- Cheers, Simon B, [EMAIL PROTECTED], http://www.brunningonline.net/simon/blog/ --

Re: goto statement

2005-04-20 Thread Maxim Kasimov
Mage wrote: praba kar wrote: Dear All, In Python what is equivalent to goto statement You shouldn't use goto in high-level languages. it would be quite useful for debuging porposes -- Best regards, Maxim Kasimov mailto: [EMAIL PROTECTED] -- http://mail.python.org/mailman/listinfo/python-list

Re: goto statement

2005-04-20 Thread Simon Brunning
On 4/20/05, Maurice Caret <[EMAIL PROTECTED]> wrote: > > other equivalents are in > > http://docs.python.org/tut/node10.html I also missed , for the while statement. Those URLs just keeg getting better... -- Cheers, Simon B,

Re: goto statement

2005-04-20 Thread Maurice Caret
Simon Brunning a écrit : On 4/20/05, praba kar <[EMAIL PROTECTED]> wrote: In Python what is equivalent to goto statement http://docs.python.org/tut/node6.html See, it's those dratted node numbers again. ;-) other equivalents are in http://docs.python.org/tut/node10.html -- http://mail.python.org

Re: goto statement

2005-04-20 Thread Simon Brunning
On 4/20/05, praba kar <[EMAIL PROTECTED]> wrote: >In Python what is equivalent to goto statement http://docs.python.org/tut/node6.html See, it's those dratted node numbers again. ;-) -- Cheers, Simon B, [EMAIL PROTECTED], http://www.brunningonline.net/simon/blog/ -- http://mail.python.org/m

Re: goto statement

2005-04-20 Thread Mage
praba kar wrote: >Dear All, > > In Python what is equivalent to goto statement > > > You shouldn't use goto in high-level languages. Mage -- http://mail.python.org/mailman/listinfo/python-list

Re: GOTO (was Re: Appeal for python developers)

2005-03-07 Thread Anthra Norell
> Heiko wrote:   > SETUP = object()> ELSE = object()> BREAK = object() > > machine = {"WAITING FOR ACTION":>   {customer_drops_coin:"COIN HAS BEEN DROPPED",>    customer_selects_beverage:"ORDER RECEIVED",>    customer_cancels_order:"ACCOUNT CLOSURE IS

Re: GOTO (was Re: Appeal for python developers)

2005-03-07 Thread Heiko Wundram
On Sunday 06 March 2005 14:26, Anthra Norell wrote: > Wow, I never thought I'd say this, but this certainly is an ingenious use of goto... But, nevertheless, I don't think this is applicable to Python as a way of justifying goto in the language, as your program doesn't have a split between abs

Re: GOTO (was Re: Appeal for python developers)

2005-03-06 Thread Andrew Dalke
Paul McGuire wrote: > At the risk of beating this into the Pythonic ground, here is a > generator version which collapses the original nested loop into a > single loop, so that break works just fine: Indeed. For some things I'm still in the pre-generator days of Python. If I worked at it I think

Re: GOTO (was Re: Appeal for python developers)

2005-03-06 Thread Anthra Norell
> Please include "goto" command in future python realeses> know that proffesional programers doesn't like to use it, > but for me as newbie it's too hard to get used replacing it > with "while", "def" or other commands> -- I believe the bad reputation of 'goto' goes back to the originators

Re: GOTO (was Re: Appeal for python developers)

2005-03-05 Thread Steven Bethard
Dennis Lee Bieber wrote: On 5 Mar 2005 08:00:23 -0800, [EMAIL PROTECTED] declaimed the following in comp.lang.python: "explicit GOTO"'. Goto's are less dangerous when they are in the forward direction, to code appearing later. UGH... That is the one direction I always avoid (in FORTRAN 77). Typica

Re: GOTO (was Re: Appeal for python developers)

2005-03-05 Thread Leif K-Brooks
[EMAIL PROTECTED] wrote: Goto is useful [...] when there is a clean-up section of a function that should be executed for various error conditions. Like this? def foo(): f = open('foo.txt') try: # do stuff with f finally: f.close() -- http://mail.python.org/mailman/listin

Re: GOTO (was Re: Appeal for python developers)

2005-03-05 Thread Paul McGuire
At the risk of beating this into the Pythonic ground, here is a generator version which collapses the original nested loop into a single loop, so that break works just fine: .def getCombinations(*args): .if len(args) > 1: .for a0 in args[0]: .for remainder in ge

Re: GOTO (was Re: Appeal for python developers)

2005-03-05 Thread Andrew Dalke
beliavsky wrote: > Goto is useful in breaking out of a nested loop and when there is a > clean-up section of a function that should be executed for various > error conditions. But much less useful in languages like Python which have exception handling. At rare times I've needed something like fo

Re: goto, cls, wait commands

2005-02-14 Thread Michael Hoffman
Erik Bethke wrote: At least I thought this was funny and cool! -Erik Thanks. ;) -- Michael Hoffman -- http://mail.python.org/mailman/listinfo/python-list

Re: goto, cls, wait commands

2005-02-13 Thread Erik Bethke
At least I thought this was funny and cool! -Erik -- http://mail.python.org/mailman/listinfo/python-list

Re: goto, cls, wait commands

2005-02-13 Thread Lars
You sir are a troll for sure. QBasic?! When was the last time you did any programming, 1989? Gave me a laugh though. Lars -- http://mail.python.org/mailman/listinfo/python-list

Re: goto, cls, wait commands

2005-02-13 Thread Fredrik Lundh
Mike Meyer wrote: >>> Secondly, how do I clear screen (cls) from text and other content ? >> >> That depends on >> >> A: What type of display device you're using >> B: What type of interface is being rendered on that display (command >> line, GUI, IDE, etc) >> C: Perhaps what operating system you

Re: goto, cls, wait commands

2005-02-12 Thread Mike Meyer
Alan Kennedy <[EMAIL PROTECTED]> writes: >> Secondly, how do I clear screen (cls) from text and other content ? > > That depends on > > A: What type of display device you're using > B: What type of interface is being rendered on that display (command > line, GUI, IDE, etc) > C: Perhaps what operati

Re: goto, cls, wait commands

2005-02-12 Thread Fredrik Lundh
"jean-michel" <[EMAIL PROTECTED]> wrote: > And it was not possible to remove GOTO, because that would really need > to rewrite manually the programs really? converting GOTO messes to structured programs has been a solved problem for many years (you can buy commercial products that does this, and

Re: goto, cls, wait commands

2005-02-11 Thread jean-michel
"Jeff Shannon" <[EMAIL PROTECTED]> a écrit dans le message de news:[EMAIL PROTECTED] > jean-michel wrote: > > > Hi all, > > I saw a lot of comments saying GOTO is not usefull, very bad, and we > > should'nt use it because we don't need it. > > I think that's true, but only if you *create* programs

Re: goto, cls, wait commands

2005-02-11 Thread Jeff Shannon
jean-michel wrote: Hi all, I saw a lot of comments saying GOTO is not usefull, very bad, and we should'nt use it because we don't need it. I think that's true, but only if you *create* programs. But if the goal is to provide some kind of converter to automatically take an old application written wi

Re: goto, cls, wait commands

2005-02-11 Thread Nick Craig-Wood
Grant Edwards <[EMAIL PROTECTED]> wrote: > I forgot to mention try/except. When I do use goto in C > programming it's almost always to impliment what would have > been a try/except block in Python. Yes I'd agree with that. No more 'goto out'. There is this also for (i = 0; ...) {

Re: goto, cls, wait commands

2005-02-11 Thread jean-michel
"BOOGIEMAN" <[EMAIL PROTECTED]> a écrit dans le message de news:[EMAIL PROTECTED] > I've just finished reading Python turtorial for non-programmers > and I haven't found there anything about some usefull commands I used in > QBasic. First of all, what's Python command equivalent to QBasic's "goto"

Re: goto, cls, wait commands

2005-02-11 Thread Dan Bishop
Harlin wrote: > No goto needed. If this makes no sense (which it may not if all you've > been exposed to is BASIC) it wouldn't be a bad idea to Google why you > should never use a goto statement. "GOTO" isn't even needed in QBasic (except for "ON ERROR GOTO"). -- http://mail.python.org/mailman/l

Re: goto, cls, wait commands

2005-02-10 Thread James
On Windows, I use WConio http://newcenturycomputers.net/projects/wconio.html It provides other screen functions you might have gotten used to in QBasic as well. On unix/cygwin, use curses. I am not aware of any portable library though. I used to use cls a lot in my QBasic days. Now I just don't.

Re: goto, cls, wait commands

2005-02-10 Thread Michael Hoffman
BOOGIEMAN wrote: First of all, what's Python command equivalent to QBasic's "goto" ? You can only use the goto function if you use Python with line numbers, thusly: """ 10 import sys 20 real_stdout = sys.stdout 30 class fake_stdout(object): pass 40 fake_stdout.write = lambda x, y: None 50 sys.stdou

Re: goto, cls, wait commands

2005-02-10 Thread Harlin
No goto needed. If this makes no sense (which it may not if all you've been exposed to is BASIC) it wouldn't be a bad idea to Google why you should never use a goto statement. To do a clear screen you'll need to use the method that your command shell uses. The shortcut to this is for Windows, 'cls

Re: goto, cls, wait commands

2005-02-10 Thread Brian van den Broek
BOOGIEMAN said unto the world upon 2005-02-10 16:06: OK, thanks all Here's presentation of my advanced programming skills :) import os import time os.system("cls") number = 78 guess = 0 while guess != number: guess = input("Guess number: ") if

Re: goto, cls, wait commands

2005-02-10 Thread BOOGIEMAN
OK, thanks all Here's presentation of my advanced programming skills :) import os import time os.system("cls") number = 78 guess = 0 while guess != number: guess = input("Guess number: ") if guess > number: print "Lower" tim

Re: goto, cls, wait commands

2005-02-10 Thread Pekka Niiranen
import os if os.name == "nt": os.system("cls") # Works in w2k else: os.system("clear")# Works in cygwin's Bash Ulf Göransson wrote: Bruno Desthuilliers wrote: Duncan Booth a écrit : BOOGIEMAN wrote: Secondly, how do I clear screen (cls) from text and other conten

Re: goto, cls, wait commands

2005-02-10 Thread Ulf Göransson
Bruno Desthuilliers wrote: Duncan Booth a écrit : BOOGIEMAN wrote: Secondly, how do I clear screen (cls) from text and other content ? That depends on your computer, and how you are running your program. One way which *might* work is: import os os.system("cls") *might* work... !-) [EMAIL PRO

Re: goto, cls, wait commands

2005-02-10 Thread Grant Edwards
On 2005-02-10, Bruno Desthuilliers <[EMAIL PROTECTED]> wrote: > Grant Edwards a écrit : >> On 2005-02-10, BOOGIEMAN <[EMAIL PROTECTED]> wrote: >> >> >>>First of all, what's Python command equivalent to QBasic's "goto" ? >> >> >> There isn't one. >> >> One defines functions and calls them. On

Re: goto, cls, wait commands

2005-02-10 Thread Bruno Desthuilliers
Grant Edwards a écrit : On 2005-02-10, BOOGIEMAN <[EMAIL PROTECTED]> wrote: First of all, what's Python command equivalent to QBasic's "goto" ? There isn't one. One defines functions and calls them. One uses for and while loops. One uses list comprehensions. One uses if/elif/else. and even s

Re: goto, cls, wait commands

2005-02-10 Thread Bruno Desthuilliers
Duncan Booth a écrit : BOOGIEMAN wrote: (snip) Secondly, how do I clear screen (cls) from text and other content ? That depends on your computer, and how you are running your program. One way which *might* work is: import os os.system("cls") *might* work... !-) [EMAIL PROTECTED] modulix $ cl

Re: goto, cls, wait commands

2005-02-10 Thread Alan Kennedy
[BOOGIEMAN] I've just finished reading Python turtorial for non-programmers and I haven't found there anything about some usefull commands I used in QBasic. First of all, what's Python command equivalent to QBasic's "goto" ? Oh no! You said the "G" word! That's a dirty word in computer science cir

Re: goto, cls, wait commands

2005-02-10 Thread Grant Edwards
On 2005-02-10, BOOGIEMAN <[EMAIL PROTECTED]> wrote: > First of all, what's Python command equivalent to QBasic's "goto" ? There isn't one. One defines functions and calls them. One uses for and while loops. One uses list comprehensions. One uses if/elif/else. > Secondly, how do I clear scre

<    1   2   3   4   >