Sha256: 458ffc90680e889227068ea106fbf1535f8c74fc840ff7cccd6c0267bff69fd3

Contents?: true

Size: 638 Bytes

Versions: 9

Compression:

Stored size: 638 Bytes

Contents

module Kl
  module Primitives
    # The following functions are implemented as special forms
    # in Kl::Compiler:
    #
    #  - defun
    #  - lambda
    #  - let
    #  - freeze
    #  - type
    module GenericFunctions
      define_method '=' do |a, b|
        a == b
      end

      # Curried after inclusion
      define_method 'eval-kl' do |exp|
        __eval(exp)
      end

      # Freeze is also provided as a normal function to support
      # the partial application of zero arguments case. In this
      # case it becomes a non-special-form.
      def freeze(exp)
        Kernel.lambda { exp }
      end
    end
  end
end

Version data entries

9 entries across 9 versions & 1 rubygems

Version Path
shen-ruby-0.10.0 lib/kl/primitives/generic_functions.rb
shen-ruby-0.9.0 lib/kl/primitives/generic_functions.rb
shen-ruby-0.8.1 lib/kl/primitives/generic_functions.rb
shen-ruby-0.8.0 lib/kl/primitives/generic_functions.rb
shen-ruby-0.7.0 lib/kl/primitives/generic_functions.rb
shen-ruby-0.6.0 lib/kl/primitives/generic_functions.rb
shen-ruby-0.5.0 lib/kl/primitives/generic_functions.rb
shen-ruby-0.4.1 lib/kl/primitives/generic_functions.rb
shen-ruby-0.4.0 lib/kl/primitives/generic_functions.rb