i've got a mutable list of <Any>. would like...
# getting-started
b
i've got a mutable list of <Any>. would like to iterate through it in a for loop.
k
Great, what's going wrong?
b
for loop range must have an iterator error
k
Can you post a complete code sample?
b
var ast = readfromtokens(tokenise(str).toMutableList()) for (e in ast) print(e + "(" + e.getClass().toString + ")")
k
A complete code sample that I can actually run, how can I possibly know what's going on in this code when you don't show the signature of
readFronTokens
?
b
it's a mutable list of Any
eg, [+ 1, 2, 4, [* 4, 5] 32]
k
Please post some example code I can actually run: https://stackoverflow.com/help/minimal-reproducible-example