Sha256: 131ced086c1fa2a2d6e773f8a03cc5c38576e8703b68759b358980881963f21e

Contents?: true

Size: 948 Bytes

Versions: 4

Compression:

Stored size: 948 Bytes

Contents

require_relative 'object'
require_relative 'stl_functions'
require_relative 'errors'
require_relative 'numbers'
require_relative 'strings'
require_relative 'boolean'
require_relative 'list'
require_relative 'functional'

# Module for loading stl functions and keywords
module StlLoader
  include SchemeStl
  def initialize
    @other = []
    @procs = {}
    @do_not_calculate = init_do_not_calculate_fn
    @reserved = init_reserved_fn
    set_reserved_keywords
    @functions = init_functions.dup
    init_predefined.each { |f| @functions[f] = f }
  end

  def init_do_not_calculate_fn
    DO_NOT_CALCULATE_FUNCTIONS
  end

  def init_functions
    SPECIAL_CHARACTER_FUNCTIONS
  end

  def init_predefined
    PREDEFINED_FUNCTIONS
  end

  def init_reserved_fn
    RESERVED_KEYWORDS
  end

  def set_reserved_keywords
    @reserved.each do |key, value|
      @procs[key.to_s] = value
    end
  end
end

Version data entries

4 entries across 4 versions & 1 rubygems

Version Path
lisp-interpreter-0.5.2 lib/lisp/interpreter/core/loader.rb
lisp-interpreter-0.5.1 lib/lisp/interpreter/core/loader.rb
lisp-interpreter-0.5.0 lib/lisp/interpreter/core/loader.rb
lisp-interpreter-0.4.4 lib/lisp/interpreter/core/loader.rb