🚀 go-pugleaf

RetroBBS NetNews Server

Inspired by RockSolid Light RIP Retro Guy

Article View: comp.lang.scheme.c
Article #199

Re: unbound variable detection

#199
From: Guillermo J. Rozas
Date: Fri, 22 Jan 1993 16:57
25 lines
1233 bytes
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.
Technical Details
Message-ID: <GJR.93Jan22085748@chamarti.ai.mit.edu>
Path: arc1-ca.pugleaf.net!sparky!uunet!olivea!spool.mu.edu!yale.edu!yale!mintaka.lcs.mit.edu!ai-lab!zurich.ai.mit.edu!gjr
References: <1993Jan22.044623.19581@cc.umontreal.ca>

Show Full Headers
Complete Article Headers
Path: arc1-ca.pugleaf.net!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