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

  1. Path: sparky!uunet!cs.utexas.edu!sun-barr!decwrl!mips!darwin.sura.net!jvnc.net!yale.edu!think.com!barmar
  2. From: barmar@think.com (Barry Margolin)
  3. Newsgroups: comp.lang.lisp
  4. Subject: Re: dynamic-extent control transfers
  5. Date: 22 Jul 1992 21:22:28 GMT
  6. Organization: Thinking Machines Corporation, Cambridge MA, USA
  7. Lines: 29
  8. Distribution: comp
  9. Message-ID: <14kjikINNdj5@early-bird.think.com>
  10. References: <JBA.92Jul22143439@kix.ai.mit.edu>
  11. NNTP-Posting-Host: telecaster.think.com
  12.  
  13. In article <JBA.92Jul22143439@kix.ai.mit.edu> jba@ai.mit.edu (Jonathan Amsterdam) writes:
  14. >2. Associate a unique tag with each block and invalidate the tag on return
  15. >   from the block.
  16. >
  17. >(2) is cheap but requires consing, which seems counter
  18. >to the whole point of giving control transfers dynamic extent.
  19.  
  20. I think I'd go with (2).  I don't think the whole point of making exit
  21. points dynamic extent was to save on consing, at least not to this extent.
  22. It's to save the need to cons a representation of the entire control state.
  23.  
  24. >  (The unique
  25. >tag could start out being a fixnum, eliminating consing for the first
  26. >couple of billion occurrences, but eventually you'd have to either cons
  27. >bignums or wrap around, risking tag duplication.)
  28.  
  29. The tag only has to be unique for a particular exit point.  So they won't
  30. have to increment as often as if there was a single, global ID generator.
  31.  
  32. If you're worried about using generic arithmetic for this, you could simply
  33. have a two-fixnum tag field, and roll your own double-precision integer
  34. arithmetic routine using fixnum arithmetic.  Given typical fixnum sizes,
  35. this should be enough to re-enter a block every microsecond for several to
  36. several thousand years.
  37. -- 
  38. Barry Margolin
  39. System Manager, Thinking Machines Corp.
  40.  
  41. barmar@think.com          {uunet,harvard}!think!barmar
  42.