Re: Bug 23935 - Proposal: New syntax for constraints

I spoke too soon. Our proposals are not the same. :-( See below.

.: Jan-Ivar :.

On 12/5/13 10:11 AM, Jan-Ivar Bruaroey wrote:
> 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 } ]
>> }

Your example looked so much like mine it threw me. But it will NOT do 
what you intended (or at least what was clear in mine), since the 
optional algorithm is to try to satisfy ALL non-overconstraining 
entries. I.e. a camera that supports both 4096x2160 and 2880x1800 will 
get selected, but always set to the lower resolution, because both 
constraints #0 and #2 will be applied to it.

In contrast, mine bails at the first constraint that applies, which I 
think adheres to POLA. So they are truly different.

Sorry for not catching that sooner.

.: Jan-Ivar :.

Received on Friday, 6 December 2013 06:28:08 UTC