locator variable + conditionals

Working on the MLZ suite of legal styles, I’ve been trying to figure
out a reasonably clean way to handle discretionary locator joins. For
example, a style might require something like this where the pinpoint
(23) is a paragraph:

Smith v Jones (2010) 1 All ER 100 [23]

But something like this where it is a page number:

Doe v Roe (1950) 1 All ER 100, 23

These discretionary joins are common, and they are very awkward to
handle with proper use of delimiter joins. We would use something like
this:

The locator-if-locator-is-* macros in turn contain a potentially
bewildering array of conditions that need to be kept in harmony with
one another. It’s a bit of a nightmare, and won’t be maintainable;
there will be a constant risk of either dropping the locator or
rendering it twice whenever the conditionals are touched during
revision.

What I’d like to do is limit the locator variable to a single
rendering within a cite. This way, the conditionals would be wrapped
on the first use of the variable, in the second use it could just be
rendered straight. It would make the behavior much easier to control,
and the code would become more readable.

I can’t see any downside to coding this into the processor, but if
anyone spots a potential difficulty with it, feel free to raise a red
flag.

Frank

Aren’t locators about the only type of content where it’s always safe to
use prefixes instead of delimiters? A lone locator isn’t of any use, and to
be useful must always be preceded by a non-empty cite.

RintzeOn Wed, Feb 22, 2012 at 8:22 PM, Frank Bennett <@Frank_Bennett>wrote:

Working on the MLZ suite of legal styles, I’ve been trying to figure
out a reasonably clean way to handle discretionary locator joins. For
example, a style might require something like this where the pinpoint
(23) is a paragraph:

Smith v Jones (2010) 1 All ER 100 [23]

But something like this where it is a page number:

Doe v Roe (1950) 1 All ER 100, 23

These discretionary joins are common, and they are very awkward to
handle with proper use of delimiter joins.

Aren’t locators about the only type of content where it’s always safe to use
prefixes instead of delimiters? A lone locator isn’t of any use, and to be
useful must always be preceded by a non-empty cite.

Using prefixes, you still need two separate macros (one with prefix A,
the other with prefix B), each wrapped in a different conditional. You
can reduce the problem to a single conditional if cs:text is used to
place a single comma in output, but that’s still pretty messy, and if
quote-swapping is needed it will break, because the comma is in the
body of a node.