Relay-Version: version B 2.10 5/3/83; site utzoo.UUCP Posting-Version: version B 2.10.1 6/24/83; site fortune.UUCP Path: utzoo!linus!decvax!harpo!ulysses!mhuxl!ihnp4!fortune!rpw3 From: rpw3@fortune.UUCP Newsgroups: net.lang Subject: Re: Self-modifying code - (nf) Message-ID: <2207@fortune.UUCP> Date: Mon, 9-Jan-84 11:03:11 EST Article-I.D.: fortune.2207 Posted: Mon Jan 9 11:03:11 1984 Date-Received: Tue, 10-Jan-84 05:45:16 EST Sender: notes@fortune.UUCP Organization: Fortune Systems, Redwood City, CA Lines: 38 #R:fortune:-215700:fortune:15100006:000:1826 fortune!rpw3 Jan 9 02:49:00 1984 Another use of self-modifying code in TECO (the editor) was to solve the conflict between speed and documentation. TECO did not have comments, but it did have pretty nearly arbitrary tags as targets for goto's (anything between exclamation points, like !This is a tag, including the spaces!). So people who liked to use TECO's text-processing ability but were a bit concerned about leaving cryptic hieroglyphs lying around (TECO has been called the APL of editors) started using the practice of documenting big TECO macros (programs) with otherwise unused tags (which can include carriage returns, even): !begin! j !make sure all is well by jumping to the top ! 3d !delete the leftovers from last pass ! and so on. Now the only problem with that is that TECO is a character-at- a-time interpreter, and all those tags (comments) had to be parsed and so the macro (program) ran SLOOOOOOWW! So before long every macro started out with a little piece of code (editing commands) which saved what was in the current buffer, got the macro, edited out all the tags with a in them (leaving "real" tags), put the sped up macro in a q-register, restored the buffer and jumped to the stripped version (whew!). In some cases it meant a factor of 10 (!) in performance. Thus it was that whole subsystems (mailing lists, label printers, order entry) came to be written and maintained in TECO. Not only that, but since the clerical people used TECO a little for their general WP jobs, they even started maintaining the macros themselves. There even came to be a full-screen editor written in TECO! (Was called either TED or KED, I forget.) Ah, the old days... Rob Warnock UUCP: {sri-unix,amd70,hpda,harpo,ihnp4,allegra}!fortune!rpw3 DDD: (415)595-8444 USPS: Fortune Systems Corp, 101 Twin Dolphins Drive, Redwood City, CA 94065