home *** CD-ROM | disk | FTP | other *** search
- Path: sparky!uunet!olivea!spool.mu.edu!yale.edu!yale!mintaka.lcs.mit.edu!ai-lab!zurich.ai.mit.edu!gjr
- From: gjr@zurich.ai.mit.edu (Guillermo J. Rozas)
- Newsgroups: comp.lang.scheme.c
- Subject: Re: unbound variable detection
- Message-ID: <GJR.93Jan22085748@chamarti.ai.mit.edu>
- Date: 22 Jan 93 16:57:48 GMT
- References: <1993Jan22.044623.19581@cc.umontreal.ca>
- Reply-To: gjr@zurich.ai.mit.edu
- Distribution: inet
- Organization: M.I.T. Artificial Intelligence Lab.
- Lines: 25
- NNTP-Posting-Host: chamartin.ai.mit.edu
- In-reply-to: kardank@ERE.UMontreal.CA's message of 22 Jan 93 04:46:23 GMT
-
- In article <1993Jan22.044623.19581@cc.umontreal.ca> kardank@ERE.UMontreal.CA (Kardan Kaveh) writes:
-
- | From: kardank@ERE.UMontreal.CA (Kardan Kaveh)
- | Newsgroups: comp.lang.scheme.c
- | Date: 22 Jan 93 04:46:23 GMT
- |
- | Is it possible to tell if a given variable is undefined?
- |
- | For example, something along the lines of:
- |
- | (define x 3)
- |
- | (bound? x) --> #t
- |
- | (bound? y) --> #f
-
- (define-macro (bound? name)
- `(not (lexical-unbound? (the-environment) ',name)))
-
- or
-
- (define-macro (bound? name)
- `(not (lexical-unbound? user-initial-environment ',name)))
-
- depending on exactly what you want.
-