home *** CD-ROM | disk | FTP | other *** search
/ NetNews Usenet Archive 1993 #3 / NN_1993_3.iso / spool / comp / lang / scheme / c / 100 next >
Encoding:
Internet Message Format  |  1993-01-22  |  1.2 KB

  1. Path: sparky!uunet!olivea!spool.mu.edu!yale.edu!yale!mintaka.lcs.mit.edu!ai-lab!zurich.ai.mit.edu!gjr
  2. From: gjr@zurich.ai.mit.edu (Guillermo J. Rozas)
  3. Newsgroups: comp.lang.scheme.c
  4. Subject: Re: unbound variable detection
  5. Message-ID: <GJR.93Jan22085748@chamarti.ai.mit.edu>
  6. Date: 22 Jan 93 16:57:48 GMT
  7. References: <1993Jan22.044623.19581@cc.umontreal.ca>
  8. Reply-To: gjr@zurich.ai.mit.edu
  9. Distribution: inet
  10. Organization: M.I.T. Artificial Intelligence Lab.
  11. Lines: 25
  12. NNTP-Posting-Host: chamartin.ai.mit.edu
  13. In-reply-to: kardank@ERE.UMontreal.CA's message of 22 Jan 93 04:46:23 GMT
  14.  
  15. In article <1993Jan22.044623.19581@cc.umontreal.ca> kardank@ERE.UMontreal.CA (Kardan Kaveh) writes:
  16.  
  17. |   From: kardank@ERE.UMontreal.CA (Kardan Kaveh)
  18. |   Newsgroups: comp.lang.scheme.c
  19. |   Date: 22 Jan 93 04:46:23 GMT
  20. |
  21. |   Is it possible to tell if a given variable is undefined?
  22. |
  23. |   For example, something along the lines of:
  24. |
  25. |   (define x 3)
  26. |
  27. |   (bound? x) --> #t
  28. |
  29. |   (bound? y) --> #f
  30.  
  31. (define-macro (bound? name)
  32.   `(not (lexical-unbound? (the-environment) ',name)))
  33.  
  34. or
  35.  
  36. (define-macro (bound? name)
  37.   `(not (lexical-unbound? user-initial-environment ',name)))
  38.  
  39. depending on exactly what you want.
  40.