Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > comp.lang.python > #60041

Re: Several Topics - Nov. 19, 2013

References (2 earlier) <UdKdnSzeg-k9BBXPnZ2dnUVZ_vadnZ2d@earthlink.com> <N6qdnQB9idNM1xbPnZ2dnUVZ_sadnZ2d@earthlink.com> <l6gj03$khv$1@speranza.aioe.org> <87fvqs6pns.fsf@sable.mobileactivedefense.com> <l6gpin$6sp$1@speranza.aioe.org>
Date 2013-11-20 10:01 +1100
Subject Re: Several Topics - Nov. 19, 2013
From Chris Angelico <rosuav@gmail.com>
Newsgroups comp.lang.python
Message-ID <mailman.2947.1384902110.18130.python-list@python.org> (permalink)

Show all headers | View raw


On Wed, Nov 20, 2013 at 9:43 AM, glen herrmannsfeldt
<gah@ugcs.caltech.edu> wrote:
> I also used to use a BASIC system that allowed you to stop a program
> (or the program stopped itself), change statements (fix bugs) and
> continue on from where it stopped. Not all can do that, but pretty
> much compilers never do.

Ditto, both in GW-BASIC and Q-BASIC, but in each case there were some
fairly strict rules about what could be edited. Changing anything to
do with control flow quickly got you a "Can't continue" error. And of
course, assembly language with DEBUG.EXE lets you do basically
anything... rewrite memory (code or data, there's no difference),
change the instruction pointer (so execution resumes somewhere else),
change other registers, etc, etc.

Most languages don't give you quite that much flexibility, because
it's really REALLY easy to mess things up and confuse yourself
completely. Python kinda will, though; all you have to do is fiddle
with sys.modules so it won't be cached, or rename the file to
something unique before reimporting it. You can then patch in
functions from the new module and start using them. Pike makes this
sort of thing much more convenient; it's not hard to write code that
smoothly slides to a new version of itself, without losing any sort of
state. But the granularity never gets down below the function, meaning
the Python and Pike compilers/interpreters are free to fiddle around
inside a function (note, for instance, how Python locals basically
just become indices into an array; it'd be a bit awkward to tweak a
running Python function and add a 'global' declaration).

ChrisA
(See? I'm posting on topic!)

Back to comp.lang.python | Previous | NextPrevious in thread | Next in thread | Find similar | Unroll thread


Thread

Program Translation - Nov. 14, 2013 "E.D.G." <edgrsprj@ix.netcom.com> - 2013-11-14 08:18 -0600
  Re: Program Translation - Nov. 14, 2013 mecej4 <mecej4_nospam@operamail.com> - 2013-11-14 11:07 -0600
    Re: Program Translation - Nov. 14, 2013 Gordon Sande <Gordon.Sande@gmail.com> - 2013-11-14 13:36 -0400
      Re: Program Translation - Nov. 14, 2013 Clive Page <usenet@page2.eu> - 2013-11-15 11:46 +0000
    Re: Program Translation - Nov. 14, 2013 Jürgen Exner <jurgenex@hotmail.com> - 2013-11-17 09:02 -0800
  Re: Program Translation - Nov. 14, 2013 "E.D.G." <edgrsprj@ix.netcom.com> - 2013-11-15 07:51 -0600
    Re: Program Translation - Nov. 14, 2013 "E.D.G." <edgrsprj@ix.netcom.com> - 2013-11-17 04:25 -0600
      Re: Program Translation - Nov. 14, 2013 Ben Bacarisse <ben.usenet@bsb.me.uk> - 2013-11-17 12:45 +0000
        Re: Program Translation - Nov. 14, 2013 "E.D.G." <edgrsprj@ix.netcom.com> - 2013-11-17 08:37 -0600
          Re: Program Translation - Nov. 14, 2013 Henry Law <news@lawshouse.org> - 2013-11-17 14:42 +0000
            Re: Program Translation - Nov. 14, 2013 Roy Smith <roy@panix.com> - 2013-11-17 10:20 -0500
              Re: Program Translation - Nov. 14, 2013 Chris Angelico <rosuav@gmail.com> - 2013-11-18 02:28 +1100
              Re: Program Translation - Nov. 14, 2013 "E.D.G." <edgrsprj@ix.netcom.com> - 2013-11-17 10:25 -0600
                Re: Program Translation - Nov. 14, 2013 Tim Prince <tprince@computer.org> - 2013-11-17 08:30 -0800
                Re: Program Translation - Nov. 14, 2013 Roy Smith <roy@panix.com> - 2013-11-17 11:43 -0500
                Re: Program Translation - Nov. 14, 2013 nospam@see.signature (Richard Maine) - 2013-11-17 09:05 -0800
                Re: Program Translation - Nov. 14, 2013 Joel Goldstick <joel.goldstick@gmail.com> - 2013-11-17 12:29 -0500
                Re: Program Translation - Nov. 14, 2013 "E.D.G." <edgrsprj@ix.netcom.com> - 2013-11-18 11:30 -0600
              Re: Program Translation - Nov. 14, 2013 Rainer Weikusat <rweikusat@mobileactivedefense.com> - 2013-11-17 18:59 +0000
          Re: Program Translation - Nov. 14, 2013 "James Van Buskirk" <not_valid@comcast.net> - 2013-11-17 09:05 -0700
        Re: Program Translation - Nov. 14, 2013 Charlton Wilbur <cwilbur@chromatico.net> - 2013-11-17 23:22 -0500
      Re: Program Translation - Nov. 14, 2013 "E.D.G." <edgrsprj@ix.netcom.com> - 2013-11-17 10:17 -0600
        Re: Program Translation - Nov. 14, 2013 "E.D.G." <edgrsprj@ix.netcom.com> - 2013-11-17 12:07 -0600
      Re: Program Translation - Nov. 14, 2013 Terry Reedy <tjreedy@udel.edu> - 2013-11-17 22:28 -0500
        Re: Program Translation - Nov. 14, 2013 "E.D.G." <edgrsprj@ix.netcom.com> - 2013-11-18 11:15 -0600
          Re: Program Translation - Nov. 14, 2013 Joel Goldstick <joel.goldstick@gmail.com> - 2013-11-18 12:35 -0500
      Several Topics - Nov. 19, 2013 "E.D.G." <edgrsprj@ix.netcom.com> - 2013-11-19 05:26 -0600
        Re: Several Topics - Nov. 19, 2013 glen herrmannsfeldt <gah@ugcs.caltech.edu> - 2013-11-19 20:51 +0000
          Re: Several Topics - Nov. 19, 2013 Yaşar Arabacı <yasar11732@gmail.com> - 2013-11-19 23:31 +0200
          Re: Several Topics - Nov. 19, 2013 Rainer Weikusat <rweikusat@mobileactivedefense.com> - 2013-11-19 21:35 +0000
            Re: Several Topics - Nov. 19, 2013 glen herrmannsfeldt <gah@ugcs.caltech.edu> - 2013-11-19 22:43 +0000
              Re: Several Topics - Nov. 19, 2013 Chris Angelico <rosuav@gmail.com> - 2013-11-20 10:01 +1100
              Re: Several Topics - Nov. 19, 2013 gamo <gamo@telecable.es> - 2013-11-20 21:48 +0100
  Re: Program Translation - Nov. 14, 2013 "Terence" <tbwright@bigpond.net.au> - 2013-11-16 20:31 +1100
    Re: Program Translation - Nov. 14, 2013 William Ray Wing <wrw@mac.com> - 2013-11-16 09:00 -0500

csiph-web