Re: DSSSL and braille

Subject: Re: DSSSL and braille
From: Paul Prescod <papresco@xxxxxxxxxxxxxxxx>
Date: Thu, 31 Jul 1997 07:29:07 -0400
David Pawson wrote:
> One item of concern is the need to 'add a two cell
> indent' repeatedly. In a procedural language I would
> have a global variable hold the present value, and
> use this to judge where to take the margin. This is
> used so often in braille that it makes me ask how
> this might be done in DSSSL (scheme). Is there a
> function to find out what the present value is and
> make it relative (add 2 char positions to whatever
> is present?)

There is no need to use a global variable. The level of indentation is
local to a part of a document, so you can use a "local variable." But
DSSSL doesn't really have local variables that can be passed from
constrution rule to construction rule. In DSSSL, local variables that
are passed between construction rules can sometimes be simulated using
inherited characteristics:

(declare-characteristic indent-counter "-//...//" 0)

(element para 
	indent-counter: (+ 2 (inherited-counter)) 
	start-indent: (actual-indent-counter)
	(process-children))

The downside of this is that you can't actually get at that
characteristic anywhere but in the specification of some other
characteristic (like start-indent, or whatever). If you want to output
two literal spaces using (literal) or a (make formatting-instruction
...) then you will have to take more drastic measures. On the other
hand, if your back-end can be trusted to translate the counter or
start-indent charactereristics properly, then you are okay.

 Paul Prescod

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


Current Thread