You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Also, this would require a new const mechanism for def arguments:
defsomething_unroll(AMT):
loopAMT i: #<-- with this mechanism, this will be unrolled!print i
defsomething_normal(amt):
loopamt i: #<-- not unrolled, amt is not a constprint i
init:
something_unroll10something_unroll5CONST=10; something_unrollCONST#All good, explicit constCONST= in1; something_unrollCONST#<-- ERROR: CONST value not known at compile time
a =10; something_unroll a #<-- ERROR: a is not an int or float lit!
a =10; something_normal a #<-- This would still work, normal call
For implementation specifics, check explicitUnrolls/explicitUnroll.nim in omni_lang/tests.
As of now, all
loop
with integer literals are unrolled:In the typed section, however, it would be cool to unroll all loops where the integer is known (like coming from a const)
The text was updated successfully, but these errors were encountered: