Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[Proposal]: Mathematical range expression (10 < foo <= 100) #4254

Closed
1 of 4 tasks
gstrasd opened this issue Dec 21, 2020 · 1 comment
Closed
1 of 4 tasks

[Proposal]: Mathematical range expression (10 < foo <= 100) #4254

gstrasd opened this issue Dec 21, 2020 · 1 comment

Comments

@gstrasd
Copy link

gstrasd commented Dec 21, 2020

FEATURE_NAME

  • Proposed
  • Prototype: Not Started
  • Implementation: Not Started
  • Specification: Not Started

Summary

This would be a feature that mirrors a mathematical expression that defines an allowed range of values.

Motivation

This for brevity and to better express a range of valid (or invalid) values in a mathematical context.

Detailed design

Instead of pairing two boolean expressions, declare the expression in a simpler, more concise syntax.

Instead of...
if (foo > 10 && foo <= 100) { }
Do this...
if (10 < foo <= 100) { }

Instead of...
if (bar < 23 || bar > 456) { }
Do this...
if (23 > bar > 456) { }

Drawbacks

The syntax might be confusing to those without a mathematical background.

Alternatives

NA

Unresolved questions

NA

Design meetings

NA

@333fred
Copy link
Member

333fred commented Dec 21, 2020

Duplicate of #4108.

@333fred 333fred closed this as completed Dec 21, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants