Subject: Re: Another scheme/dsssl question From: Norman Walsh <norm@xxxxxxxxxxxxx> Date: Tue, 30 Dec 1997 09:02:58 -0500 |
> No, but according to 8.4 "Definitions", Rats. That really would be handy. > | [...] A top-level definition of > | a variable in a process specification part is ignored if that variable > | has been defined at the top level in a previous process specification > | part. > > So you can simply use > > (define default-foo '("x" "y" "z")) > (define foo default-foo) > ... > (... foo ...) > > in the base stylesheet, and derived stylesheets can > override the default by including (define foo ...) in a > process specification part that precedes the base > stylesheet. Yes, but alas, in the particular instance that I want to do this, the stylesheet fragment (dblib.dsl for those of you wondering) isn't in its own process specification so that won't work either. And I'm not inclined to put it in a process specification because I haven't carefully considered the precedence constraints that that would introduce. Here, in all its glory, is the problem I'm trying to deal with: The dblib.dsl module includes two functions for doing case-folding. In order for these functions to work, they need to have two lists: the uppercase and lowercase letters. If I don't define these lists in dblib.dsl, then trying to use dblib.dsl in another stylesheet is momentarily confusing because you get all these error messages about an undefined variables. (And I fear it would be more than momentarily confusing for someone other than me ;-) But if I do define them in dblib.dsl, then it's difficult to override them. And since case folding is naturally language dependent, it is necessary that it be possible to override them. At this point, I can't think of any better solution than passing the lists as optional arguments to the functions. > Regarding your earlier question (given a string or symbol "foo", > is there a way to retrieve the value of "foo") -- no, there > is no way to do this in DSSSL or in R4RS Scheme. Common > Lisp has 'eval' and 'symbol-value', which would do what you > want, but these are not present in Scheme. (In fact, it's > not entirely clear what 'eval' and 'symbol-value' should > even _mean_ in the context of Scheme.) > > You didn't mention why you wanted this feature, but if > there is a finite, predefined set of symbols that your > stylesheet needs to look up at runtime, you can use > an association list: Thanks. That's what I did. Then realized what I was trying to do was fundamentally broken anyway. Sigh. Good thing the bit bucket never fills up ;-) --norm DSSSList info and archive: http://www.mulberrytech.com/dsssl/dssslist
Current Thread |
---|
|
<- Previous | Index | Next -> |
---|---|---|
Re: Another scheme/dsssl question, Joe English | Thread | List of pairs., Andrei Kaikov |
Re: Some XSL Questions, Norman Walsh | Date | Howto change appearance with modula, Christian Leutloff |
Month |