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

Implement lists:split/2 #1019

Merged
merged 1 commit into from
Jan 31, 2024
Merged

Implement lists:split/2 #1019

merged 1 commit into from
Jan 31, 2024

Conversation

petermm
Copy link
Contributor

@petermm petermm commented Jan 29, 2024

As implemented in lists: module in OTP https://github.com/erlang/otp/blob/0e66b88db447954e1de70ec1fa0822d3a7e6133d/lib/stdlib/src/lists.erl#L1808

Unsure where the line goes for functions to be implemented by estdlib, so feel free to close PR.

Use case:
Using https://github.com/discord/limited_queue/ on top of the erlang queue: module (copy pasted), and the only missing lists function needed was the split/2 - so would be nice to have it out of the box.

These changes are made under both the "Apache 2.0" and the "GNU Lesser General
Public License 2.1 or later" license terms (dual license).

SPDX-License-Identifier: Apache-2.0 OR LGPL-2.1-or-later

Copy link
Collaborator

@bettio bettio left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Just to understand, is it your lists:split implementation or the one taken from Erlang?

@petermm
Copy link
Contributor Author

petermm commented Jan 29, 2024

Just to understand, is it your lists:split implementation or the one taken from Erlang?

100% from Erlang.

@bettio
Copy link
Collaborator

bettio commented Jan 29, 2024

Just to understand, is it your lists:split implementation or the one taken from Erlang?

100% from Erlang.

So if you took that function from Erlang (and it is not your code) please update the module copyright in order to mention the original copyright, also mention the source of that code in your commit.

@petermm
Copy link
Contributor Author

petermm commented Jan 29, 2024

Just to understand, is it your lists:split implementation or the one taken from Erlang?

100% from Erlang.

So if you took that function from Erlang (and it is not your code) please update the module copyright in order to mention the original copyright, also mention the source of that code in your commit.

Added, couldn't find an example elsewhere in codebase- so do let me know if further changes are required..

Signed-off-by: Peter M <petermm@gmail.com>
@bettio bettio merged commit f26a643 into atomvm:master Jan 31, 2024
74 of 76 checks passed
@petermm petermm deleted the lists-split/2 branch February 5, 2025 20:55
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

Successfully merging this pull request may close these issues.

3 participants