How to implementing the operation of concatenation on P4?

Hello Everyone, I would like to ask a question about the limitations of p4. I would like to implement a couple of functions on p4, first I would like to store two list consisting of tuples, and then I would like to implement concatenation of tuples from these two tables on p4. Intuitively, this may involve a looping process, and as far as I know p4 is not capable of looping, but since I’m new to p4, I’m not sure if there’s any other way to accomplish this? So I’m asking for your advice, could you tell me how to solve it please? and if you’re not too sure, could you tell me the general learning route and the direction please? thank you all!

Yes, it is true that there are no loops in P4.

There are ways to write programs that write repetitive P4 programs for you, though, that may be helpful to you: p4-guide/code-generation at master · jafingerhut/p4-guide · GitHub

Basically you can unroll the loop you want, as long as it has a compile-time known maximum number of iterations.