Re: Bug 23935 - Proposal: New syntax for constraints

On 12/4/13 2:07 PM, Martin Thomson wrote:
> On 4 December 2013 02:13, Harald Alvestrand <harald@alvestrand.no> wrote:
>> 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 } ]
>> }
> Those two blocks of "constraints" are different.  Close but not identical.
>
> The difference is that Jan-Ivar's proposal does not permit all options to fail.

Good eye. ;-) It would be identical to:

[ { 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 },
   {} ]

(only the last {} is different. An empty entry = "I'll accept anything").

Yes, my proposal has an edge that it lets you specify "it's one of these combinations or nothing", thanks for that, but that's a minor difference if Bug 23935 is accepted, so I'd rather emphasize the similarity between Harald's proposal and mine at this point.

> (I don't consider the only one keys per optional constraint restriction valid either.)

Great! I think being able to specify width x height combinations will simplify the most common complex expressions quite a bit, and is hopefully a noncontroversial step we can reach agreement on.

All in favor?

.: Jan-Ivar :.

Received on Thursday, 5 December 2013 15:25:14 UTC