Class: Campa::Lisp::Core

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

Direct Known Subclasses

Campa::Language

Constant Summary collapse

CORE_FUNCS_MAP =
{
  "quote" => Quote,
  "atom" => Atom,
  "eq" => Eq,
  "car" => Car,
  "cdr" => Cdr,
  "cons" => Cons,
  "cond" => Cond,
  "lambda" => LambdaFn,
  "label" => Label,
  "defun" => Defun,

  "_cadr" => Cadr,
  "list" => ListFn,

  "load" => Campa::Core::Load,
}.freeze

Instance Attribute Summary

Attributes inherited from Context

#fallback

Instance Method Summary collapse

Methods inherited from Context

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

Constructor Details

#initializeCore

Returns a new instance of Core.



22
23
24
25
26
# File 'lib/campa/lisp/core.rb', line 22

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