Provide negation for rules. #3

Merged
merged 1 commit into from Apr 16, 2012

Projects

None yet

2 participants

@blt
blt commented Apr 16, 2012

The 'aint' rule allows you to specify the negation of a rule, if that
rule returns ok or error, at least. Example:

check_rule(<<"a">>, {aint, {in, [<<"b">>]}}) => ok

This is useful if you have a property that must be false.

Signed-off-by: Brian L. Troutwine brian.troutwine@rackspace.com

Brian L. Troutwine Added 'aint' rule, offers negation.
The 'aint' rule allows you to specify the negation of a rule, if that
rule returns ok or error, at least. Example:

   check_rule(<<"a">>, {aint, {in, [<<"b">>]}}) => ok

This is useful if you have a property that must be false.

Signed-off-by: Brian L. Troutwine <brian.troutwine@rackspace.com>
d570250
@bfrog
Contributor
bfrog commented Apr 16, 2012

Would you be opposed to changing {aint, {...}} to {not, {...}}?

I like the idea!

@blt
blt commented Apr 16, 2012

I'd prefer not, but it's a reserved keyword. aint was the closest synonym that I could scrounge up.

@bfrog bfrog merged commit 6534e2b into treetopllc:master Apr 16, 2012
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment