home *** CD-ROM | disk | FTP | other *** search
/ Source Code 1992 March / Source_Code_CD-ROM_Walnut_Creek_March_1992.iso / usenet / altsrcs / 3 / 3073 < prev    next >
Encoding:
Internet Message Format  |  1991-03-15  |  2.0 KB

  1. From: magnus%thep.lu.se@Urd.lth.se (Magnus Olsson)
  2. Newsgroups: comp.lang.c,alt.sources
  3. Subject: Re: Small introspective program
  4. Message-ID: <1991Mar14.092452.899@lth.se>
  5. Date: 14 Mar 91 09:24:52 GMT
  6.  
  7. In article <1991Mar13.151756.2885@en.ecn.purdue.edu> steele@en.ecn.purdue.edu@en.ecn.purdue.edu (Richard A. Steele) writes:
  8. >In article <1991Mar13.032422.9438@cavebbs.gen.nz> clear@cavebbs.gen.nz (Charlie Lear) writes:
  9. >>Sorry, your entry is disqualified through being too large. REAL BASICs used
  10. >>to be able to tokenise, and the winner is:
  11. >>    1 L.
  12. >>which when run would produce
  13. >>     1 L.
  14.  
  15. >You sure?  If the BASIC is tokenized, then L. will be expanded to LIST
  16. >in the source code listing, so that you'd get
  17. >    1 LIST
  18. >when run.  I have to admit, my only experience with tokenized basics is
  19. >the old 8-bit Ataris; do other basics leave the abbreviation?
  20.  
  21. I'm afraid Charlie used the word `tokenize' in a non-canonical way...
  22. Tokenization means that tokens (identifiers, keywords etc) are saved
  23. just as numbers, not as text. The interpreter would recognize `L.' as
  24. a valid abbreviation of LIST, and store the corresponding number.
  25. The LIST command would then look up this number and write out the 
  26. corresponding word, i.e. `LIST'. Applesoft Basic did this, I believe -
  27. `?' was accepted as an abbreviation for `PRINT', but the LIST command
  28. printed it as `PRINT'.
  29.  
  30. Anyway, there *are* Basics that don't tokenize, but accept abbreviated
  31. statements - like the one on the Acorn Atom (a 6502-based British machine).
  32. A typical line from an Atom program would look something like
  33. 100F.I=1TOA.X;P.ZZX';GOS.200;N.
  34. which would correspond to
  35. 100 FOR I=1 TO ABS(X) : PRINT ZZ(X) : GOSUB 200 : NEXT I
  36. in Micrososft Basic.
  37.  
  38. Unfortunately, Atom Basic didn't allow LIST inside a program, so 
  39. Charlie's program wouldn't run on an Atom...
  40.  
  41. Magnus Olsson                   | \e+      /_
  42. Dept. of Theoretical Physics    |  \  Z   / q
  43. University of Lund, Sweden      |   >----<           
  44. Internet: magnus@thep.lu.se     |  /      \===== g
  45. Bitnet: THEPMO@SELDC52          | /e-      \q
  46.