home *** CD-ROM | disk | FTP | other *** search
/ NetNews Usenet Archive 1992 #16 / NN_1992_16.iso / spool / comp / lang / forth / 2843 < prev    next >
Encoding:
Internet Message Format  |  1992-07-23  |  1.8 KB

  1. Path: sparky!uunet!gatech!pitt!willett!dwp
  2. From: dwp@willett.pgh.pa.us (Doug Philips)
  3. Newsgroups: comp.lang.forth
  4. Subject: What is the return stack for? (was: What should the Standard include?)
  5. Message-ID: <3938.UUL1.3#5129@willett.pgh.pa.us>
  6. Date: 23 Jul 92 20:52:02 GMT
  7. Organization: EIEI-U
  8. Lines: 30
  9.  
  10. In article <3915.UUL1.3#5129@willett.pgh.pa.us>
  11.     B.RODRIGUEZ2 [Brad] writes:
  12. +I don't use '&' inside DO..LOOPs, just as I don't factor 'I' or 'J' into words
  13. +which are used within DO..LOOPs.  Just one more of those things you have to
  14. +learn to live with.
  15.  
  16. Pardon me for being confused here.  Aren't I and J are effectively local
  17. variables to the DO LOOP 'block' in which they occur?  If so then it makes
  18. sense that they cannot be "factor"ed in the manner you suggest.  Personally,
  19. I find DO LOOPS to be egregiously restrictive for other reasons.
  20.  
  21. +Apologies for unclarity in my previous posting:  all I need is your #R>, to
  22. +drop a given number of items from the return stack. (Actually, I need to "pop"
  23. +the RP to a previously saved position, which would require RDEPTH as well as
  24. +#R>.)  But I still need on other occasions to move return stack items to and
  25. +from the parameter stack, and preserve their meaning.
  26.  
  27. I think one of the "problems" with return stack "entitlements" is that
  28. the return stack is used for more than just "get me back to my invoking
  29. word" information, _and_ that the return stack is not typed.  So, even
  30. if you are given the size in cells of "return addresses", you still don't
  31. know if there are other items on the return stack.  Although DO LOOP
  32. (and perhaps CASE ENDCASE  I don't recall) are known to muddle the
  33. return stack, the mere existance of >R R> means that the user is
  34. free to diddle the return stack, and therefore you simply can't know what
  35. is "really" on it.
  36.  
  37. -Doug
  38. ---
  39. Preferred:  dwp@willett.pgh.pa.us    Ok:  {pitt,sei}!willett!dwp
  40.