home *** CD-ROM | disk | FTP | other *** search
/ NetNews Usenet Archive 1992 #26 / NN_1992_26.iso / spool / comp / lang / scheme / 2586 < prev    next >
Encoding:
Internet Message Format  |  1992-11-13  |  1.2 KB

  1. Path: sparky!uunet!stanford.edu!agate!anarres.CS.Berkeley.EDU!bh
  2. From: bh@anarres.CS.Berkeley.EDU (Brian Harvey)
  3. Newsgroups: comp.lang.scheme
  4. Subject: Re: Location tags of primitive procedures
  5. Date: 13 Nov 1992 15:25:47 GMT
  6. Organization: University of California, Berkeley
  7. Lines: 20
  8. Distribution: world
  9. Message-ID: <1e0hdrINN5pr@agate.berkeley.edu>
  10. References: <PK.92Nov13122624@talitiainen.cs.tut.fi>
  11. NNTP-Posting-Host: anarres.cs.berkeley.edu
  12.  
  13. pk@cs.tut.fi (Kellom{ki Pertti) writes:
  14. | [...] I try to catch application of a primitive procedure that
  15. |would cause a runtime error. This is done by having an alist of
  16. |procedures and associated information about the parameters they
  17. |accept, for example
  18. |
  19. |  ...
  20. |  (,close-input-port (1 ,(assert 1 input-port?)))
  21. |  (,close-output-port (1 ,(assert 1 output-port?)))
  22. |
  23. |Before a procedure is actually applied, it is first looked up in the
  24. |alist.
  25.  
  26. Haven't we all had to do things like this?  Doesn't it seem silly
  27. to spend our time rewriting the Scheme interpreter?  That's what this
  28. amounts to.  I think we should find a way to solve this particular
  29. problem by having a portable catch-error mechanism.
  30.  
  31. (P.S.  Your article arrived with "Distribution: comp" in the header
  32. and that made my attempted reply bounce the first time.)
  33.