module Klam::CompilationStages::KlToInternalRepresentation

Kl to Internal Represenation

To simplify coding and improve performance, the compiler uses arrays rather than Kl lists to represent nested s-expressions. This stage performs the conversion.

Public Instance Methods

kl_to_internal_representation(kl) click to toggle source
# File lib/klam/compilation_stages/kl_to_internal_representation.rb, line 12
def kl_to_internal_representation(kl)
  if cons?(kl) || kl == Klam::Primitives::Lists::EMPTY_LIST
    listToArray(kl)
  else
    kl
  end
end