Compile time check on __getitem__() #348
Locked
mojodojodev
started this conversation in
Ideas
Replies: 0 comments
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
-
Hi I was experimenting with compile time checking shapes using
NDBuffer
:So that something like:
Throws a compile time error
Wondering if you've discussed potentially allowing this behavior by specifying parameters on
__getitem__
:Compile time shape checks inside
[]
would be really nice, and fit nicely with Mojo how everything in[]
is a compile time parameter.Even better would be the ability to overload it:
So you can do:
x(2, 0, 0)
for no compile time checks if using dynamic valuesx[2, 0, 0]
for compile time checksBeta Was this translation helpful? Give feedback.
All reactions