Class: Campa::Lisp::Core

Inherits:
Context show all
Defined in:
lib/campa/lisp/core.rb

Overview

Context representing the base for the minimal Lisp stablished by Paul Graham’s: The Roots of Lisp.

Since this is a Context it can be instantiated and use as a parameter to any function invocation that want’s to use Lisp functions on it’s body. And also, it can be used as a fallback so if we want to “extend” Lisp we could Inherit it or Context#push a new Context on it.

Direct Known Subclasses

Campa::Language

Instance Method Summary collapse

Methods inherited from Context

#[], #[]=, #bindings, #include?, #push

Constructor Details

#initializeCore

Returns a new instance of Core.



14
15
16
17
18
# File 'lib/campa/lisp/core.rb', line 14

def initialize
  super Hash[
    CORE_FUNCS_MAP.map { |label, handler| [sym(label), handler.new] }
  ]
end