Skip to content

nyuichi/mruby-partcont

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

6 Commits
 
 
 
 
 
 

Repository files navigation

mruby-partcont

partial continuation support for mruby.

Install

MRuby::Build.new do |conf|

    # ... (snip) ...

    conf.gem :github => 'wasabiz/mruby-partcont'
end

mruby-partcont does not depends on other libraries or extensions, but for the safety it is highly recommended to add at the end of the gem build conf.

Example

reset {
  p 1
  shift {|k|
    p 2
	k.call()
	p 3
  }
  p 4
}
# 1
# 2
# 4
# 3
# => nil

APIs

  • Continuation class

Represents a delimited continuation that cuts the process from where the shift operator is called up to the nearest reset operator. Since continuations have infinite extent, once they are created it is possible to call them anytime anywhere, and even however many times. When the continuation is cut (making a continuation closure), the bottom of the stack of the delimited continuation is dynamically chosen.

  • Kernel.#reset { ... } -> value
  • Kernel.#shift {|k| ... } -> value

ToDos

  • control/prompt
  • full (undelimited) continuation support
  • documentation

auther

Yuichi Nishiwaki

About

partial continuation (a.k.a. delimited continuation) extension for mruby

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published