Subject: Re: Scheme help... From: Chris Maden <crism@xxxxxxx> Date: Tue, 24 Feb 1998 13:28:46 -0500 |
[Norm Walsh] > It's clear from the way that they behave that > > (define %gentext-by% > (case ($lang$) > <![%l10n-usen[ (("usen") %gentext-usen-by%) ]]> > <![%l10n-dege[ (("dege") %gentext-dege-by%) ]]> > <![%l10n-ru[ (("ru") %gentext-ru-by%) ]]> > (else "L10N ERROR: %gentext-by%"))) > > is different from > > (define (%gentext-by%) > (case ($lang$) > <![%l10n-usen[ (("usen") %gentext-usen-by%) ]]> > <![%l10n-dege[ (("dege") %gentext-dege-by%) ]]> > <![%l10n-ru[ (("ru") %gentext-ru-by%) ]]> > (else "L10N ERROR: %gentext-by%"))) > > In particular (current-node) can be accessed in $lang$ if I use the > latter (literal (%gentext-by%)), but not if I use the former > (literal %gentext-by%). > > Can someone satisfy my intellectual curiosity and explain the > difference? In particular, why "current-node doesn't exist" in the > former. (define (%gentext-by%) ...) defines a procedure. That procedure is executed when it's called, in the context of the caller, so (current-node) means something. (define %gentext-by% ...) defines a... symbol? object? whatever. Not a procedure. It's evaluated to a static definition, in the context of the definition itself, which has no meaning for (current-node). Please excuse me if my terminology isn't correct; I'm not a CS major and can't locate the right parts of the Standard. -Chris -- <!NOTATION SGML.Geek PUBLIC "-//Anonymous//NOTATION SGML Geek//EN"> <!ENTITY crism PUBLIC "-//O'Reilly//NONSGML Christopher R. Maden//EN" "<URL>http://www.oreilly.com/people/staff/crism/ <TEL>+1.617.499.7487 <USMAIL>90 Sherman Street, Cambridge, MA 02140 USA" NDATA SGML.Geek> DSSSList info and archive: http://www.mulberrytech.com/dsssl/dssslist
Current Thread |
---|
|
<- Previous | Index | Next -> |
---|---|---|
Scheme help..., Norman Walsh | Thread | Re: Scheme help..., Harald Hanche-Olsen |
Scheme help..., Norman Walsh | Date | Re: conditionaly setting characteri, Chris Maden |
Month |