Re: Bug 23935 - Proposal: New syntax for constraints

On 12/13/13 2:38 PM, Martin Thomson wrote:
> On 13 December 2013 11:33, cowwoc <cowwoc@bbs.darktech.org> :
>> So if I understand you correctly, constraints specified by the array are
>> combined using logical AND.
> No, as I understand Jan-Ivar's proposal, the constraints are applied
> in order, best effort.  Any constraint that cannot be met is ignored,
> unless it is marked "required".

Right, in which case the algorithm jumps to Constraint Failure.

> That said, I'm not sure that this is easy to implement.  Maybe the
> only way to implement it would be to do two passes: one with required:
> true sets and a second pass without.

No no, I was thinking straight forward here: Any constraint that cannot be met is ignored, unless it is marked "required", in which case jump to Constraint Failure.

This is the optional algorithm, not declarative, so where something is in the array affects the outcome you get. If your head hurts, that's the optional array's fault, nor mine. ;-)

It is slightly more expressive: You can do complex things like optionally constrain by something first, then require something of the subset you get.

But in most cases, put your required ones first, like you used to do with mandatory, and it is straight forward.

.: Jan-Ivar :.

Received on Friday, 13 December 2013 19:55:54 UTC