Re: Another scheme/dsssl question

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
  • Another scheme/dsssl question
    • Norman Walsh - from mail1.ability.netby web4.ability.net (8.8.5/8.6.12) with ESMTP id NAA24872Mon, 29 Dec 1997 13:49:04 -0500 (EST)
      • Chris Maden - from mail1.ability.netby web4.ability.net (8.8.5/8.6.12) with ESMTP id QAA25937Mon, 29 Dec 1997 16:21:38 -0500 (EST)
        • Norman Walsh - from mail1.ability.netby web4.ability.net (8.8.5/8.6.12) with ESMTP id QAA26170Mon, 29 Dec 1997 16:37:10 -0500 (EST)
        • Joe English - from mail1.ability.netby web4.ability.net (8.8.5/8.6.12) with ESMTP id SAA26850Mon, 29 Dec 1997 18:53:30 -0500 (EST)
          • Norman Walsh - from mail1.ability.netby web4.ability.net (8.8.5/8.6.12) with ESMTP id JAA07051Tue, 30 Dec 1997 09:04:54 -0500 (EST) <=