[racket] Eval, namespaces redefinitions, and (maybe) code-inspectors

From: Galler (lzgaller at optonline.net)
Date: Tue Oct 15 00:51:53 EDT 2013

> I don't see any obstacle to adding a more fine-grained reflective
> operation, such as `namespace-set-variable-constant!`. Would that be
> useful?
Matt,
I don't think the introduction of namespace-set-variable-constant! worth 
the effort, though I thank you for the solution.
Let me explain my reasoning:
The context is using eval in a module defined with #lang s-expr 
<my-language-module>
there are two distinct sub-problems involving re-definition
Problem one is the potential for an eval'd expression to re-define the 
(provide ..)ed-bindings of <my-language-module> (including potentially 
eval itself, were it one of the exports)
Problem two  is the potential for an eval'd expression to re-define a 
previously eval'd binding.
Problem one is solved by  your suggestion of  
(namespace-require/constant ''m)
For Problem two, I can rename-out a safe-define which memq's the 
namespace bindings and prevents re-definition
I hope my terminology was understandable. I'm new to writing languages 
and evaluators.
On a separate note, I got an enormous amount of value from your ACM 
paper "Creating Languages in Racket"
The other piece of writing that was revelatory was Matthias' "Racket 
is..."
The expressive power of the #lang system and define-syntax is 
staggering.  Also, I was an idiot for hanging on to defmacro style 
macros for so long.
Thank you very much.
R,.
Zack

-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.racket-lang.org/users/archive/attachments/20131015/dab186be/attachment-0001.html>

Posted on the users mailing list.