Sha256: b0114ccf0975f6f3dece2de8593a4a3fbb7057bd86001c525ee428d531482755

Contents?: true

Size: 1006 Bytes

Versions: 4

Compression:

Stored size: 1006 Bytes

Contents

# STL functions
module SchemeStl
  DO_NOT_CALCULATE_FUNCTIONS =
    %w[
      foldl foldr map filter
      if apply numerator denominator
      lambda compose define
    ].freeze

  SPECIAL_CHARACTER_FUNCTIONS =
    {
      'string-downcase'  => 'strdowncase', 'string-upcase'  => 'strupcase',
      'string-contains?' => 'strcontains', 'string-length'  => 'strlen',
      'string->list'     => 'strlist',     'string-split'   => 'strsplit',
      'string-sufix?'    => 'strsufix',    'string-prefix?' => 'strprefix',
      'string-replace'   => 'strreplace',  'string-join'    => 'strjoin'
    }.freeze

  PREDEFINED_FUNCTIONS =
    %w[
      define not equal? if quotient remainder modulo numerator denominator
      min max sub1 add1 abs string? substring null? cons null list car
      cdr list? pair? length reverse remove shuffle map foldl foldr filter
      member lambda apply compose
    ].freeze

  RESERVED_KEYWORDS =
    {
      'null' => '\'()'
    }.freeze
end

Version data entries

4 entries across 4 versions & 1 rubygems

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