How to iterate over a compile time `List`/`Tuple` in Mojo

fn main():
    alias literals = ("some", "string", "tuple")
    alias strings = List("some", "string", "list")

    @parameter
    for i in range(len(literals)):
        alias literal = literals.get[i, StringLiteral]()

        @parameter
        for j in range(len(strings)):
            alias string_msg = strings[j]
            print(literal, string_msg)
3 Likes