[plt-scheme] verifying whether a symbol is defined at compile time?

From: jos koot (jos.koot at telefonica.net)
Date: Sun Apr 22 05:57:53 EDT 2007

Oops, the contra-example should read:

(require (lib "etc.ss"))

(define-syntax my-define
 (syntax-rules ()
  ((my-define (name . args) . body) (my-define name (lambda args . body)))
  ((my-define var value)
   (define var ; <== correction
     (printf "my-define ~a status is ~s~n" 'var
      (if (namespace-defined? 'var) 'defined 'undefined))

(if (read) (namespace-set-variable-value! 'b 2))
(my-define b 2)

Jos Koot
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.racket-lang.org/users/archive/attachments/20070422/e368f834/attachment.html>

Posted on the users mailing list.