-
Notifications
You must be signed in to change notification settings - Fork 2.5k
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
[mojo-stdlib] Add variadic initialiser, __iter__ and __contains__ to InlineList #2703
Conversation
- Variadic Initialisation - Iteration - Contains Signed-off-by: Chris Sutton <christopher.sutton12@gmail.com>
Signed-off-by: Chris Sutton <christopher.sutton12@gmail.com>
Signed-off-by: Chris Sutton <christopher.sutton12@gmail.com>
Signed-off-by: Chris Sutton <christopher.sutton12@gmail.com>
d2267df
to
1792993
Compare
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.
Awesome, thanks for making these improvements! Keep 'em coming! :)
✅🟣 This contribution has been merged 🟣✅ Your pull request has been merged to the internal upstream Mojo sources. It will be reflected here in the Mojo repository on the nightly branch during the next Mojo nightly release, typically within the next 24-48 hours. We use Copybara to merge external contributions, click here to learn more. |
_type_is_eq[ElementType, C](), "value type is not self.ElementType" | ||
]() | ||
for i in self: | ||
if value == rebind[C](i[]): |
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.
@laszlokindrat rebind
doesn't work for mem types.
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.
@soraros, right, I missed this, can you put up a patch to fix this? Or to document this limitation?
…tains__ to InlineList (#40189) [External] [mojo-stdlib] Add variadic initialiser, __iter__ and __contains__ to InlineList This PR adds some features to InlineList ( related issue #2658 ) *Variadic initialiser* ```mojo var x = InlineList[Int](1,2,3) ``` *iter* ```mojo var x = InlineList[Int](1,2,3) for i in x: print(i) ``` *contains* ```mojo var x = InlineList[Int](1,2,3) if 3 in x: print("ok") ``` Co-authored-by: Chris <32541739+ChristopherLR@users.noreply.github.com> Closes #2703 MODULAR_ORIG_COMMIT_REV_ID: 6a9eb7b41905e62f8db0855159fd851b7ffb6174
Landed in d5b7381! Thank you for your contribution 🎉 |
…tains__ to InlineList (#40189) [External] [mojo-stdlib] Add variadic initialiser, __iter__ and __contains__ to InlineList This PR adds some features to InlineList ( related issue modularml#2658 ) *Variadic initialiser* ```mojo var x = InlineList[Int](1,2,3) ``` *iter* ```mojo var x = InlineList[Int](1,2,3) for i in x: print(i) ``` *contains* ```mojo var x = InlineList[Int](1,2,3) if 3 in x: print("ok") ``` Co-authored-by: Chris <32541739+ChristopherLR@users.noreply.github.com> Closes modularml#2703 MODULAR_ORIG_COMMIT_REV_ID: 6a9eb7b41905e62f8db0855159fd851b7ffb6174
…tains__ to InlineList (#40189) [External] [mojo-stdlib] Add variadic initialiser, __iter__ and __contains__ to InlineList This PR adds some features to InlineList ( related issue modularml#2658 ) *Variadic initialiser* ```mojo var x = InlineList[Int](1,2,3) ``` *iter* ```mojo var x = InlineList[Int](1,2,3) for i in x: print(i) ``` *contains* ```mojo var x = InlineList[Int](1,2,3) if 3 in x: print("ok") ``` Co-authored-by: Chris <32541739+ChristopherLR@users.noreply.github.com> Closes modularml#2703 MODULAR_ORIG_COMMIT_REV_ID: 6a9eb7b41905e62f8db0855159fd851b7ffb6174
This PR adds some features to InlineList ( related issue #2658 )
Variadic initialiser
iter
contains