Page 1 of 1

Coroutine support

Posted: Sun Mar 21, 2010 11:23 am
by max
First I want to thank you for the best mud client ever!

I have a question regarding coroutines: are there plans to support coroutines and if - when will it happen?

With coroutines in combination with timers a very nice continuation-pattern like programming style would be possible.

Here is an example with wait, much more powerful things could be done with eg. input based triggers:

Code: Select all

function wait(co, t)
  tempTimer(t, [[coroutine.resume(co)]])
  coroutine.yield();
end

function myCo(me)
  for i=1,10 do
    wait(me, 5)
    echo("every 5 secs")
  end
end

co = coroutine.create(myCo)
coroutine.resume(co, co)
thanks,
max

Re: Coroutine support

Posted: Sun Mar 21, 2010 12:56 pm
by Vadi
I believe if 5.2 gets mutexes back, heiko will add support.

Re: Coroutine support

Posted: Wed Jun 07, 2017 5:23 pm
by Vadi
coroutines are now available in Mudlet 3.2! http://www.mudlet.org/2017/06/mudlet-3-2/