this seems like a simple thing to do but I just don't seem to find a simple enough answer anywhere for me to grok.
So lets say I have an Elixir function like this:
def fetch_card_ids(offset, total_cards) when offset < total_cards do
url = "http://some.domanin?offset=#{offset}"
response = HTTPotion.get url
#return or yield response here
fetch_card_ids(offset+24,total_cards)
end
In C# I could yield a return value when iterating something which of course is not the same as recursion but nevertheless: can I do a similar thing in a recursive function in elixir?
Any help would be much appreciated of course.