jade or DSSSL: either one is strange - compared to Scheme

Subject: jade or DSSSL: either one is strange - compared to Scheme
From: Ralph Ferris <ralph@xxxxxxxxxxxxxxx>
Date: Wed, 21 Jul 1999 15:34:50 -0400
>Date: Tue, 20 Jul 1999 13:45:32 +0200
>From: Matthias Clasen <clasen@xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx>
>Subject: Re: jade or DSSSL: either one is strange - compared to Scheme
>
>> Date: Tue, 20 Jul 1999 11:24:27 +0200 (CEST)
>> From: Joerg Wittenberger <Joerg.Wittenberger@xxxxxxxxx>
>> Organization: softeYes
>> X-Url: http://pobox.com/~Joerg.Wittenberger
>> Sender: owner-dssslist@xxxxxxxxxxxxxxxx
>> Precedence: bulk
>> Reply-To: dssslist@xxxxxxxxxxxxxxxx
>> 
>> Hello,
>> 
>> This is a snippet of a DSSSL Style sheet. It should customize Norman
>> Walsh's famous docbook style sheets.
>> 
>> The original style sheets labels nested sections to arbitrary
>> depth. I'd like to restrict those labels to a level up to three.
>> 
>> Implementation idea
>> 
>> I assumed that I could overwrite the definition of section-autolabel
>> (within my derived style sheet) as follows:
>> 
>> (define section-autolabel
>>   (let ((old-definition section-autolabel))
>>     (lambda (nd #!optional (force-label? #f))
>>       (let ((depth (node-list-length (ancestor (normalize "section") nd))))
>>         (if (> depth 3)
>>             ""
>>             (old-definition nd force-label?))))))
>> 
>> Problem
>> 
>> Unfortunatly jade complains 
>> 
>> ...:E: loop in specification of value of "section-autolabel"
>> 
>> Any ideas what's wrong? Is this what the DSSSL spec requires? 
>
>I think that in Scheme, top-level definitions are evaluated sequentially,
>enabling redefinitions like the one you showed. But the dsssl expression
>language is purely functional and doesn't make promises about the evaluation
>order of top-level definitions apart from the one that redefinitions in
>later parts are ignored, redefinitions in the same part are an error and
>builtin definitions can be overridden.
>
>Matthias

Try using let* (i.e., (let* ((old-definition section-autolabel)) ) to force
the binding order and see if that helps.

--Ralph



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


Current Thread