Re: Thoughts on pragmas and iXML

On Thu, Feb 06, 2025 at 01:16:57PM +0000, Bethan Tovey-Walsh scripsit:
> To be honest, I would currently argue against allowing pragmas to
> annotate other pragmas, because of these complexities. Requirement 10
> states that there should be solid use cases for allowing annotation of
> any other constructs, and I can't immediately imagine solid use cases
> that couldn't be designed in some alternative way without making
> pragmas annotatable. But someone may change my mind on that. 

The use case I've been thinking of is serialization, where one might
wish to set a grammar-scope pragma and then except some terminals or
non-terminals. (LTR quotations in a RTL text, different prefered normal
forms, private-use-area mappings, etc. that apply to a portion of the
content set but not to the whole.)

> In any case, that problem is some way down the road for us, since
> we're currently having trouble agreeing that there should be any
> constraints at all on pragma scope.

Might it be agreed that the pragma scope needs to be identifiable? Since
they are supposed to be human-readable, on the one hand, and someone
needs to implement it, on the other.

One thought I've had is that a pragma with a scope unrelated to the
grammar is obviously possible; "put the verbose log files here", for
example. There might be a requirement that the function of a pragma must
apply to the processing of the grammar?

> I hope that's somewhat helpful. Thanks for giving me the scope (ha!)
> to work this stuff through in my own mind. 

Entirely helpful, thank you!

-- Graydon


--  
Graydon Saunders  | graydonish@fastmail.com
Þæs oferéode, ðisses swá mæg.
-- Deor  ("That passed, so may this.")

Received on Sunday, 9 February 2025 05:47:41 UTC