RE: Using "DEFINE"

Subject: RE: Using "DEFINE"
From: "Pawson, David" <DPawson@xxxxxxxxxxx>
Date: Fri, 3 Apr 1998 12:19:50 +0100
> Chuck Darney [SMTP:cdarney@xxxxxxxxxxxxxxxx] wrote
> 
> I would like to add attributes to my top-most element (in this case,
> "cgideliv") to be used to set some variable options in the DSL.  I
> want
> to try something like:
> 
> (element cgideliv
>    (let (deliv (inherited-attribute-string "type))
>       (case deliv
>          (("generic")
>             (define %page-numbering% #f)
>             (define %page-header% #t)
>             (define %use-footer% #t))
>          (("summary"
>             (define %page-numbering% #f)
>             (define %page-header% #f)
>             (define %use-footer% #f))
>          (("cert"
>             (define %page-numbering% #t)
>             (define %page-header% #t)
>             (define %use-footer% #t))))
> 
> I would then use the defined names later in the DSL to use or not use
> the particular option.  
> 
Methinks you are hitting the 'no side effects' barrier.
I.e. cannot define in the top level (where all the std defines are)
    the page-headers etc.

could you put the (let (deliv (... ) case deliv
inside each of the appropriate characteristics for page-header?

e.g. 

(define %page-numering% (let
                          ((deliv (inherited-attribute-string "type"))
                           (case deliv
                             (("generic" "summary")) #f)
                           (else #t))))

Then do the same for the other defines?

Untested, seems sound.
regards, DaveP



 DSSSList info and archive:  http://www.mulberrytech.com/dsssl/dssslist


Current Thread
  • Using "DEFINE"
    • Chuck Darney - from mail1.ability.netby web4-1.ability.net (8.8.5/8.6.12) with ESMTP id PAA03108Thu, 2 Apr 1998 15:15:42 -0500 (EST)
      • <Possible follow-ups>
      • Pawson, David - from mail1.ability.netby web4-1.ability.net (8.8.5/8.6.12) with ESMTP id GAA29860Fri, 3 Apr 1998 06:26:49 -0500 (EST) <=