Path: utzoo!utgpu!jarvis.csri.toronto.edu!mailrus!cornell!uw-beaver!rice!titan!dorai From: dorai@titan.rice.edu (Dorai Sitaram) Newsgroups: comp.lang.scheme Subject: Re: Question with binding Summary: Goof-correction Message-ID: <3153@kalliope.rice.edu> Date: 23 Apr 89 19:31:51 GMT References: <19890421061138.6.VANMEULE@PERTA.SCRC.Symbolics.COM> <3140@kalliope.rice.edu> Sender: usenet@rice.edu Reply-To: dorai@titan.rice.edu (Dorai Sitaram) Organization: Rice University, Houston Lines: 26 In article <3140@kalliope.rice.edu> I wrote: $The reason is that you can devise your own security blanket (and sleep $tight ;-}) with the macro system that comes with any Scheme. The $declare-constant and undeclare-constant that I referred to in my $earlier posting are now simple macros. One method would be: $ $(defmacro (declare-constant x) $ `(put 'x 'constant t)) $ $(defmacro (undeclare-constant x) $ `(put 'x 'constant nil)) $ $(defmacro (setq x v) $ `(if (get 'x 'constant) $ (error "hey watch out, salman rushdie is out to set constants!") $ (set! x ,v))) All the x's above should have commas before them. I guess the constant shuttling between the new extend-syntax (which doesn't use the backquote system) and the old def*macro (which does) has taken its toll. --dorai ------------------------------------------------------------------------------ We must believe in free will. We have no choice. --Isaac Bashevis Singer ------------------------------------------------------------------------------