markh-de / KiVar

PCB Assembly Variants for KiCad
MIT License
29 stars 0 forks source link

RFC: Introduce reserved "?" Choice name, which only applies to undefined Choices #72

Closed markh-de closed 1 month ago

markh-de commented 3 months ago

Currently, the Default Choice ("*") sets initial Property values for all Choices. There is no way to make use of Implicit Defaults if a Default Choice is used, because Implicit Defaults are overridden by Default data.

If we would have a dedicated Choice Type (name TBD) which only applies to Choices that are not defined, Implicit Defaults would still apply.

For example: *(+m1) C2(+m2) will use the +m1 for both C1 (assuming that this is the Choice that the Default applies to) and C2. What we really wanted was: Use +m2 for C2 and +m1 for all other Choices. And use Implicit Defaults, i.e. -m2 for C1, -m1 for C2. But as * overrides these Implicit Defaults, this does not work as desired. To fix this we need to use *(+m1 -m2) C2(-m1 +m2), which is longer than desired.

The new Choice to be implemented would only apply to all undefined Choices, but not act as Default for all other Choices. So: ?(+m1) C2(+m2) would apply the +m1 to existing other Choices (C1 here) that are not defined for assignment, but would not apply the +m1 as Default value to the m1 Property in the C2 Choice.

Comments welcome.

markh-de commented 1 month ago

Implemented on main branch.