-
Notifications
You must be signed in to change notification settings - Fork 305
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
PR: builtin range function #326 #328
Conversation
Nice one! I would expect range(0,0) to be [] for consistency. |
@geseq Okay, i will change range(0,0) to be [] , any ideas for support for a single parameter? range(5) to [0, 1, 2, 3, 4], current implementions are not supported, if you want, i can support it |
I think you might be right and I can see one argument being confusing. I pretty much pulled the idea out of python but we don’t need to stick exactly to python syntax. |
@geseq ok, Use the same upper and lower bounds will get empty array ( [] ) as you expect, github action seems to have some problems ? please check this PR. I think it's done now ! |
errors.go
Outdated
@@ -49,6 +49,10 @@ var ( | |||
// ErrNotImplemented is an error where an Object has not implemented a | |||
// required method. | |||
ErrNotImplemented = errors.New("not implemented") | |||
|
|||
// ErrNotImplemented is an error where an Object has not implemented a |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
please update comment?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@d5 ok, it fixed
I've merged a fix for the GitHub Actions to master. Please rebase with master |
please fix linting issues too! |
emmmm.... okay, I will fix go lint problem |
add builtin range function:
range(start, stop[, step])
usage examples:
range(0,0) ----> []
range(0, 5) -----> [0, 1, 2, 3, 4]
range(0, 10, 3) -----> [0, 3, 6, 9]
range(0, -10, 2) -----> [0, -2, -4, -6, -8]
special:
The step must be greater than 0 to prevent infinite loops