Skip to content

✨ Add SequenceSet predicates for comparing any/all/none above/below a number - #737

Merged
nevans merged 1 commit into
masterfrom
sequence_set/above_p-and-below_p
Aug 28, 2026
Merged

✨ Add SequenceSet predicates for comparing any/all/none above/below a number#737
nevans merged 1 commit into
masterfrom
sequence_set/above_p-and-below_p

Conversation

@nevans

@nevans nevans commented Aug 27, 2026

Copy link
Copy Markdown
Collaborator

Adds the following comparison methods to Net::IMAP::SequenceSet

  • #all_above?: Are all numbers in the set greater than a given number?
  • #all_below?: Are all numbers in the set less than a given number?
  • #any_above?: Are any numbers in the set greater than a given number?
  • #any_below?: Are any numbers in the set less than a given number?
  • #none_above?: Are no numbers in the set greater than a given number?
  • #none_below?: Are no numbers in the set less than a given number?

These are mostly just convenience methods for checking if some number is greater than or less than set.min or set.max.

My primary motivation is that giving names to these simple operations helps with:

  • avoiding simple logic mistakes, e.g: like off-by-one errors,
  • using the faster implementation, e.g: avoiding #intersect? or #disjoint?, when comparing to minormax` would be considerably faster

@nevans nevans changed the title ✨ Add SequenceSet predicate methods for comparing above/below a number ✨ Add SequenceSet predicates for comparing above/below a number Aug 27, 2026
@nevans nevans changed the title ✨ Add SequenceSet predicates for comparing above/below a number ✨ Add SequenceSet predicates for comparing any/all/none above/below a number Aug 27, 2026
Adds the following comparison methods to `Net::IMAP::SequenceSet`
* `#all_above?`: Are all numbers in the set greater than a given number?
* `#all_below?`: Are all numbers in the set less than a given number?
* `#any_above?`: Are any numbers in the set greater than a given number?
* `#any_below?`: Are any numbers in the set less than a given number?
* `#none_above?`: Are no numbers in the set greater than a given number?
* `#none_below?`: Are no numbers in the set less than a given number?

These are mostly just convenience methods for checking if some number is
greater than or less than `set.min` or `set.max`.
@nevans
nevans force-pushed the sequence_set/above_p-and-below_p branch from edaacba to a3be7cc Compare August 27, 2026 21:29
@nevans
nevans merged commit 9643fb0 into master Aug 28, 2026
34 checks passed
@nevans
nevans deleted the sequence_set/above_p-and-below_p branch August 28, 2026 14:33
@nevans nevans added the enhancement New feature or request label Aug 28, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

enhancement New feature or request

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant