Xref: utzoo comp.lang.c:37069 alt.sources:3490 Path: utzoo!utgpu!cs.utexas.edu!swrinde!zaphod.mps.ohio-state.edu!rpi!uupsi!sunic!lth.se!newsuser From: magnus%thep.lu.se@Urd.lth.se (Magnus Olsson) Newsgroups: comp.lang.c,alt.sources Subject: Re: Small introspective program Message-ID: <1991Mar14.092452.899@lth.se> Date: 14 Mar 91 09:24:52 GMT References: <1991Mar10.231230.1301@casbah.acns.nwu.edu> <1991Mar12.050929.2870@research.canon.oz.au> <1991Mar13.032422.9438@cavebbs.gen.nz> <1991Mar13.151756.2885@en.ecn.purdue.edu> Sender: newsuser@lth.se (LTH network news server) Reply-To: magnus@thep.lu.se (Magnus Olsson) Organization: Theoretical Physics, Lund university, Sweden Lines: 39 In article <1991Mar13.151756.2885@en.ecn.purdue.edu> steele@en.ecn.purdue.edu@en.ecn.purdue.edu (Richard A. Steele) writes: >In article <1991Mar13.032422.9438@cavebbs.gen.nz> clear@cavebbs.gen.nz (Charlie Lear) writes: >>Sorry, your entry is disqualified through being too large. REAL BASICs used >>to be able to tokenise, and the winner is: >> 1 L. >>which when run would produce >> 1 L. >You sure? If the BASIC is tokenized, then L. will be expanded to LIST >in the source code listing, so that you'd get > 1 LIST >when run. I have to admit, my only experience with tokenized basics is >the old 8-bit Ataris; do other basics leave the abbreviation? I'm afraid Charlie used the word `tokenize' in a non-canonical way... Tokenization means that tokens (identifiers, keywords etc) are saved just as numbers, not as text. The interpreter would recognize `L.' as a valid abbreviation of LIST, and store the corresponding number. The LIST command would then look up this number and write out the corresponding word, i.e. `LIST'. Applesoft Basic did this, I believe - `?' was accepted as an abbreviation for `PRINT', but the LIST command printed it as `PRINT'. Anyway, there *are* Basics that don't tokenize, but accept abbreviated statements - like the one on the Acorn Atom (a 6502-based British machine). A typical line from an Atom program would look something like 100F.I=1TOA.X;P.ZZX';GOS.200;N. which would correspond to 100 FOR I=1 TO ABS(X) : PRINT ZZ(X) : GOSUB 200 : NEXT I in Micrososft Basic. Unfortunately, Atom Basic didn't allow LIST inside a program, so Charlie's program wouldn't run on an Atom... Magnus Olsson | \e+ /_ Dept. of Theoretical Physics | \ Z / q University of Lund, Sweden | >----< Internet: magnus@thep.lu.se | / \===== g Bitnet: THEPMO@SELDC52 | /e- \q