Ruby 㧠callcc ã使ã£ã¦ coroutine ã semi-coroutine ãæ¸ãã¦ã¿ã¾ããããã¾ãèããã«è©¦è¡é¯èª¤ã§æ¸ããã®ã§ééã£ã¦ãããããã¾ããããã¨ããããæãã¦ã¿ã¾ãã coroutine 㯠Modula-2 ã§æ¡ç¨ããã¦ãããã®ãsemi-coroutine 㯠Lua ã§æ¡ç¨ããã¦ãããã® *1 ãå®è£ ããã¤ããã§ãã callcc 㧠coroutine ã¾ããµã³ãã«ã以ä¸ã®ã³ã¼ã㯠1 ã3 ã2 ãåºåãã¦çµäºãã¾ãã c1, c2 = Coroutine.new { p 1; c2.start; p 2 }, Coroutine.new { p 3; c1.start; p 4 } c1.start $ ruby -rcoroutine test.rb 1 3 2ããã¤ã¾ãã§è§£èª¬ã coroutine.start 㧠coroutine ãèµ·åãã¾
{{#tags}}- {{label}}
{{/tags}}