Re: signifigance of nested parenthesis with only ORs? (was: OpenJ9 license)

David A. Wheeler

Bradley M. Kuhn:
Could you explain a bit further why the extra parenthesis grouping is
needed when only ORs are involved?
As you guessed, the parentheses are not *needed*. The SPDX spec says that parentheses SHOULD be used when there are multiple license identifiers or license refs, but this is a SHOULD not a MUST.

The section you want to consult is SPDX specification version 2.1, Appendix IV ("SPDX License Expressions"):

Subsection "Composite License Expressions" says:
"More expressive composite license expressions can be constructed using "OR", "AND", and "WITH" operators similar to constructing mathematical expressions using arithmetic operators. For the Tag:value format, any license expression that consists of more than one license identifier and/or LicenseRef, should be encapsulated by parentheses: "( )". This has been specified to facilitate expression parsing. Nested parentheses can also be used to specify an order of precedence which is discussed in more detail in subsection (4)."

So the spec recommends using parentheses when there are multiple license identifiers. Again, this is only a SHOULD, not a MUST. I view this as a stylistic recommendation.

--- David A. Wheeler

Join { to automatically receive all group messages.