Re: Bug 23935 - Proposal: New syntax for constraints

On 12/4/13 5:13 AM, Harald Alvestrand wrote:
> On 12/03/2013 10:47 PM, Jan-Ivar Bruaroey wrote:
>> If expressiveness is a problem, we should address this directly, 
>> which is what I believe my syntax proposal does. I can say:
>>
>> [ { width: 4096, height: 2160 },
>>   { width: 3840, height: 2160 },
>>   { width: 2880, height: 1800 },
>>   { width: { min: 1024, max: 4096 }, height: { min: 768, max: 2160 }, 
>> aspect: { min: 1.6, max: 1.9 } ]
>>
>> In this example, I prefer certain resolutions I have tested with 
>> (even when higher ones are available), and only if I cannot get one 
>> of those exact ones will I accept a range, but no less than 1024x768. 
>> How would you express that today?
>
> Actually, this is ALMOST legal current syntax.
>
> { optional: [ { width: 4096, height: 2160 },
>   { width: 3840, height: 2160 },
>   { width: 2880, height: 1800 },
>   { width: { min: 1024, max: 4096 }, height: { min: 768, max: 2160 }, 
> aspect: { min: 1.6, max: 1.9 } ]
> }
>
> would be legal syntax if we allowed multiple constraints per element 
> in the optional sequence; the argument for not doing so is that we 
> haven't specified what happens if we have two constraints in a single 
> element, one of which can be satisfied and the other one cannot be.
>
> I could be convinced of relaxing that constraint more easily than I 
> could be convinced of changing to an "OR of ANDs" syntax.

That's great! In case it isn't obvious, the optional structure you're 
proposing *is* the "OR of AND" I'm proposing. I'm happy to postpone the 
discussion of whether mandatory is now redundant (as I'm confident 
you'll come to the same conclusion I did, that it is).

Thank you for bridging the gap. I think this is the way to present this, 
take people through the steps.

.: Jan-Ivar :.

Received on Thursday, 5 December 2013 15:11:50 UTC