Coroutine support

Post Reply
max
Posts: 2
Joined: Sun Mar 21, 2010 11:03 am

Coroutine support

Post by max » Sun Mar 21, 2010 11:23 am

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

User avatar
Vadi
Posts: 4674
Joined: Sat Mar 14, 2009 3:13 pm

Re: Coroutine support

Post by Vadi » Sun Mar 21, 2010 12:56 pm

I believe if 5.2 gets mutexes back, heiko will add support.

User avatar
Vadi
Posts: 4674
Joined: Sat Mar 14, 2009 3:13 pm

Re: Coroutine support

Post by Vadi » Wed Jun 07, 2017 5:23 pm

coroutines are now available in Mudlet 3.2! http://www.mudlet.org/2017/06/mudlet-3-2/

Post Reply

Who is online

Users browsing this forum: No registered users and 5 guests