Subject: Re: jade or DSSSL: either one is strange - compared to Scheme From: "Joerg F. Wittenberger" <Joerg.Wittenberger@xxxxxxxxx> Date: 21 Jul 1999 12:19:24 +0200 |
Matthias Clasen <clasen@xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx> writes: > 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. I don't by that purly functional argument. Functional means roughly "the result value depends on the parameters only", in other words there is no rebinding of names to values during the runtime. Rebinding names during load time is equivalent to opening a new scope for the lower half of the program text. From that point of view there is nothing wrong with sequentional name binding. To put it into DSSSL/Scheme terms: DSSSL-define (or maybe just jade, that's the question I had) binds the name within a definition magicaly to the not yet defined value of the definition. Scheme-define at the other hand evaluates the value to be bound to a name and establishes the binding thereafter. The Scheme way can be transformed into nested lambda expressions. Like this: (define (section-autolabel nd #!optional (force-label? #f)) (whatever)) ; note: the following top-level define/set! is equivalent to a ; DSSSL-define within another style sheet, which uses this here or to ; a set! for Scheme rules. (define/set! section-autolabel (let ((old-definition section-autolabel)) (lambda (nd #!optional (force-label? #f)) (whatevernew using old-definition when needed)))) ==> (let ((section-autolabel (lambda (nd #!optional (force-label? #f)) (whatever)))) ((lambda (old-definition) (let ((section-autolabel (lambda (nd #!optional (force-label? #f)) (whatevernew using old-definition when needed)))) ... here we use it the new section-label...)) section-label)) For the dsssl (jade) way I failed to find a way to express the binding mechanism using lambda expressions. If anybody can give me that - would be great for understanding! At the other hand - it might not be worth if it's not an intended behavior. The DSSSL-way can be expressed in terms of dynamic name lookup. I've got the *feeling* that removing that lookup might speed up jade. Regards /Jerry DSSSList info and archive: http://www.mulberrytech.com/dsssl/dssslist
Current Thread |
---|
|
<- Previous | Index | Next -> |
---|---|---|
Re: jade or DSSSL: either one is st, Matthias Clasen | Thread | jade or DSSSL: either one is strang, Ralph Ferris |
Re: About Constructions rules, Daniel Mahler | Date | Re: OpenJade and Debian, Matthias Clasen |
Month |