🚀 go-pugleaf

RetroBBS NetNews Server

Inspired by RockSolid Light RIP Retro Guy

Thread View: comp.lang.scheme.c
2 messages
2 total messages Started by Kardan Kaveh Fri, 22 Jan 1993 04:46
unbound variable detection
#196
Author: Kardan Kaveh
Date: Fri, 22 Jan 1993 04:46
20 lines
794 bytes
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

Thanks,

Kaveh


-- 
------------
Kaveh Kardan                                       kaveh@taarna.UUCP
Systeme Taarna                                     kardank@eole.umontreal.qc.ca
Montreal Quebec Canada                             (514)844-8448
Re: unbound variable detection
#199
Author: 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.
Thread Navigation

This is a paginated view of messages in the thread with full content displayed inline.

Messages are displayed in chronological order, with the original post highlighted in green.

Use pagination controls to navigate through all messages in large threads.

Back to All Threads