@lizardsquid coroutines, which means much simpler iterators
example in Lua:

local function range(a,b)
return coroutine.wrap(function()
for i = a, b or math.huge do
coroutine.yield(i)
end
end)
end

for i in range(0, 10000) do
print(i)
end

Python and JS have special syntaxes for it

Sign in to participate in the conversation
Computer Fairies

Computer Fairies is a Mastodon instance that aims to be as queer, friendly and furry as possible. We welcome all kinds of computer fairies!