Philippe Ombredanne:
> I suggest instead to change this application design and data model to track 
> several license expressions, one for each of your "keywords".
> For instance, by storing a list of expressions and what they apply to or by 
> breaking down top level packages in sub-packages each with their own 
> expressions. Or by storing a multiline string, where each line is an 
> expression possibly prefixed by some symbol describing what this expression 
> applies to.
> And define the convention of what this prefix means in this application. 
> Whatever would work there.

This appears *much* more complicated compared to IF... THEN... ELSE.  If 
there's only one possible condition, then they're equivalent, but in general 
they aren't.

A common case is that in one country (say the US) one license applies, and 
elsewhere a difference license applies.  This can't be solved by breaking down 
packages.  Documentation is combined with source code (sometimes within the 
same file), and distributed in various ways; again, breaking down packages 
doesn't help.  Even worse, you can have a combination; "In the US the 
documentation is LICENSE1, in the US the rest is LICENSE2, otherwise it's 
LICENSE3 if documentation and LICENSE4 if not."  Trivial to do with IF.

> That said, packing in an single expression multiple sub-expressions and state 
> which files/directory this licensing applies to is a fine goal. Possibly 
> useful. But it eventually means summarizing several SPDX doc(s) data points 
> in a single line...

That already happens.  If you are distributing a set of packages, each of which 
have SPDX license expressions, then the distribution is affected by the set of 
those expressions however they are defined.

> Verbosity matters. Simplicity too. IF/THEN/ELSE is both verbose and complex 
> IMHO.

Huh? The "scope" keyword is longer; it's just an overly long synonym for "if" 
except the colon creates a new syntax and you have to restate the condition 
after *every* use (in contrast, "else" handles all other conditions).  The 
"scope" term seems MORE complicated. You could drop "THEN" if you like.  Then 
compare:

scope:documentation (CC-BY-SA-3.0+ OR MIT)
scope:(not documentation) MIT

if documentation (CC-BY-SA-3.0+ OR MIT)
else MIT


Now imagine my longer case:

scope:(country = "US" and documentation) LICENSE1
scope:(country = "US" and not documentation) LICENSE2
scope:(country != "US" and documentation) LICENSE3
scope:(country != "US" and not documentation) LICENSE4

if (country = "US")
  if documentation LICENSE1 else LICENSE2
else
  if documentation LICENSE3 else LICENSE4

The "else"s make it much more likely that you'd collect the "other cases" 
without missing any.

This is obviously a new direction for license expressions, but that's why I 
raise it :-).

--- David A. Wheeler

_______________________________________________
Spdx-tech mailing list
[email protected]
https://lists.spdx.org/mailman/listinfo/spdx-tech

Reply via email to