type lookuperror

Larry Martell larry.martell at gmail.com
Thu Aug 18 12:21:30 EDT 2016


On Thu, Aug 18, 2016 at 10:02 AM, Gene Heskett <gheskett at shentel.net> wrote:
> On Thursday 18 August 2016 07:28:06 Chris Angelico wrote:
>
>> On Thu, Aug 18, 2016 at 7:55 PM, meInvent bbird <jobmattcon at gmail.com>
> wrote:
>> > actually i would like to remove try except code in all function
>> >
>> > and i feel that try except code for a large block code can not
>> > show which function name , which line number error,
>> > if use try except for specified code block to show where it has
>> > error it will have many ugly try except code and need many human
>> > force to craft the code, i hope that code write once for program to
>> > program itself in future.
>> >
>> > actually this method i ask is not good enough since it will need
>> > to add many function wrapper.
>>
>> You can't get a program to program itself. That's called the
>> Singularity [1], and depending on your point of view, it's either
>> still in the future, or fundamentally impossible. In any case,
>> computers today cannot program themselves.
>
> That is a pretty broad statement to make, considering I have actually
> done it. On an RCA 1802 based (Cosmac Super Elf) computer. Every byte of
> static ram memory in those days (1978) was precious, (4k board kit was
> $250) so rather than having 30 nearly identical copies of a subroutine
> each doing a similar job but with different data, I actually overwrote 3
> or 4 bytes of a single subroutine to change what it did according to
> where it was in the main loop.  So when it was done with that pass, it
> put the original bytes back. Controlling a videotape machine at a tv
> station in northern kalipornia, it was dead stable, running from power
> failure to power failure.  And, I checked about 15 years later, and it
> was still in 10+ times a day use.  If memory was that precious today, it
> would still be a valid method to shrink a complex program.

Freshman year of college, 1977, final exam for a Fortran class. One of
the questions was to write some program but only use some specified
small amount of memory. I do not think anyone in the class was able to
do it. The only way to do it was to write self modifying code,
something that we had never covered in class.



More information about the Python-list mailing list