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

Add CArray.iteri #775

Merged
merged 1 commit into from
Jun 26, 2024
Merged

Add CArray.iteri #775

merged 1 commit into from
Jun 26, 2024

Conversation

Ant1-Provot
Copy link

@Ant1-Provot Ant1-Provot commented Jun 26, 2024

Description

Hi !

Working with Ctypes I realized I needed a CArray.iteri method in order to iter over a carray passing the index to the argument function.

As it doesn't exist I felt it was time for me to do my first open source PR :)

Type of change

val iteri : (int -> 'a -> unit) -> 'a t -> unit

This is a new feature, non breaking that just adds a functionality.

How Has This Been Tested?

I tried to stick with testing and coding style of the already existing CArray.iterfunction:

  • First test checks that the 3 loops of value + index indeed equals 9 -> 9 = (0 + 1 ) + (1 + 2 ) + (2 + 3)
  • Second test checks with an empty list.

If you believe this change is futile for the code base

No worry, I just wanted to learn how to do an opensource PR.

@yallop
Copy link
Owner

yallop commented Jun 26, 2024

Thank you for the contribution, @Ant1-Provot! This looks good to me.

@yallop yallop merged commit 4a134bc into yallop:master Jun 26, 2024
17 checks passed
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.

2 participants