Method: Heist::Runtime#initialize

Defined in:
lib/heist/runtime/runtime.rb

#initialize(options = {}) ⇒ Runtime

A Runtime is initialized using a set of options. The available options include the following, all of which are false unless you override them yourself:

  • :continuations: set to true to enable call/cc

  • :lazy: set to true to enable lazy evaluation

  • :unhygienic: set to true to disable macro hygiene



46
47
48
49
50
51
52
53
54
55
56
57
# File 'lib/heist/runtime/runtime.rb', line 46

def initialize(options = {})
  @lazy          = !!options[:lazy]
  @continuations = !!options[:continuations]
  @hygienic      = !options[:unhygienic]
  
  @top_level  = Scope.new(self)
  @user_scope = Scope.new(@top_level)
  @stack      = stackless? ? Stackless.new : Stack.new
  
  load_builtins(options)
  @start_time = Time.now.to_f
end