Is it possible in Elixir to call a function i times with 2 parameters? It would look line this in Java:
List myList = new ArrayList();
for(int i=1; i<10; i++) {
myList.addAll(doSomething(other_list,i))
}
Basing on your Java code, I suppose doSomething(otherList, i)
returns a list. If so, then you can use Enum.flat_map
in Elixir, like this:
Enum.flat_map(1..9, fn i ->
do_something(other_list, i)
end)