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

Allow custom sequence start #48

Open
parzhitsky opened this issue May 8, 2020 · 2 comments
Open

Allow custom sequence start #48

parzhitsky opened this issue May 8, 2020 · 2 comments
Labels
Change: minor [Issue / PR] describes a non-breaking change, such as adding a new functionality Domain: main [Issue / PR] describes change in the functionality, its optimization good first issue [Issue] can be addressed by a first-time contributor Pending: blocked [Issue / PR] cannot be addressed until another issue is resolved Priority: medium [Issue / PR] should be addressed without delay Type: improvement [Issue / PR] addresses lack of a functionality or an open possibility of enhancement

Comments

@parzhitsky
Copy link
Member

parzhitsky commented May 8, 2020

When generating numeric sequences, allow starting them with more than one number:

xrange([1, 1], () => true, ([ last, prelast ]) => last + prelast);
// 1, 1, 2, 3, 5, 8, 13, 21, 34, …

xrange([0, 1, 2, 3, 4], (next) => next < 3, ([ last ]) => last + 1);
// 0, 1, 2
// custom sequence start goes through ("obeys") the predicate

xrange([], (next) => next < 100, ([ last ]) => last + 1);
// (no iterations)
// since sequence start is not defined, the first sequence member is `NaN`, and `NaN < 100` is `false`
@parzhitsky parzhitsky added Change: minor [Issue / PR] describes a non-breaking change, such as adding a new functionality Domain: main [Issue / PR] describes change in the functionality, its optimization Priority: medium [Issue / PR] should be addressed without delay Type: improvement [Issue / PR] addresses lack of a functionality or an open possibility of enhancement good first issue [Issue] can be addressed by a first-time contributor labels May 8, 2020
@parzhitsky
Copy link
Member Author

Moved to the 3.0 release, since this feature would require a change in error codes, and they will be getting rid of in #71, which is scheduled to 3.0

@parzhitsky parzhitsky added the Pending: blocked [Issue / PR] cannot be addressed until another issue is resolved label Jan 5, 2021
@parzhitsky
Copy link
Member Author

Blocked by #71

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Change: minor [Issue / PR] describes a non-breaking change, such as adding a new functionality Domain: main [Issue / PR] describes change in the functionality, its optimization good first issue [Issue] can be addressed by a first-time contributor Pending: blocked [Issue / PR] cannot be addressed until another issue is resolved Priority: medium [Issue / PR] should be addressed without delay Type: improvement [Issue / PR] addresses lack of a functionality or an open possibility of enhancement
Projects
None yet
Development

No branches or pull requests

1 participant