home *** CD-ROM | disk | FTP | other *** search
/ NetNews Usenet Archive 1992 #30 / NN_1992_30.iso / spool / comp / lang / forth / 3616 < prev    next >
Encoding:
Text File  |  1992-12-14  |  1.2 KB  |  32 lines

  1. Newsgroups: comp.lang.forth
  2. Path: sparky!uunet!well!well.sf.ca.us!jax
  3. From: jax@well.sf.ca.us (Jack J. Woehr)
  4. Subject: Re: Defining variables automatically
  5. Message-ID: <jax.724319426@well.sf.ca.us>
  6. Sender: news@well.sf.ca.us
  7. Organization: Whole Earth 'Lectronic Link
  8. References: <92348.2139563034871@QUCDN.QueensU.CA>
  9. Date: Mon, 14 Dec 1992 07:50:26 GMT
  10. Lines: 20
  11.  
  12. In <92348.2139563034871@QUCDN.QueensU.CA> <3034871@QUCDN.QueensU.CA> writes:
  13.  
  14. >I'm wondering if it is possible to define a word that then defines
  15. >new variables when it is executed.  That is,
  16.  
  17.     You ask if input to the VARIABLE''s name generation can be
  18. redirected. It can, in most systems. The trick is to change the source
  19. of the input stream.
  20.  
  21.     This can be done in a number of ways. In ANS Forth, it will
  22. be regularized. SAVE-INPUT and RESTORE-INPUT handle preserving
  23. the current input stream. Then input can be obtained from the user,
  24. from a file, from an arbitrary character-address + count.
  25.  
  26.         =jax=
  27. -- 
  28.  # jax@well.{UUCP,sf.ca.us}  # #  Member  # # Vice President,       #
  29.  # du!isis!koscej!jax        # # X3J14 TC # #  Forth Interest Group #
  30.  # JAX on GEnie              # # for ANS  # #   P.O. Box 2154       #
  31.  # SYSOP RCFB (303) 278-0364 # #  Forth   # #    Oakland, CA 94621  #
  32.