Re: Scheme help...

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
  • Scheme help...
    • Norman Walsh - from mail1.ability.netby web4.ability.net (8.8.5/8.6.12) with ESMTP id MAA11150Tue, 24 Feb 1998 12:38:36 -0500 (EST)
      • Chris Maden - from mail1.ability.netby web4.ability.net (8.8.5/8.6.12) with ESMTP id NAA11905Tue, 24 Feb 1998 13:25:56 -0500 (EST) <=
        • Harald Hanche-Olsen - from mail1.ability.netby web4.ability.net (8.8.5/8.6.12) with ESMTP id NAA12831Tue, 24 Feb 1998 13:55:43 -0500 (EST)
      • Daniel Speck - from mail1.ability.netby web4.ability.net (8.8.5/8.6.12) with ESMTP id NAA12415Tue, 24 Feb 1998 13:40:36 -0500 (EST)
      • Paul Prescod - from mail1.ability.netby web4.ability.net (8.8.5/8.6.12) with ESMTP id PAA14183Tue, 24 Feb 1998 15:30:40 -0500 (EST)
        • Earl Hood - from mail1.ability.netby web4.ability.net (8.8.5/8.6.12) with ESMTP id QAA14800Tue, 24 Feb 1998 16:06:14 -0500 (EST)