File: value/core/unit.rb

Overview
Module Structure
Class Hierarchy
Code

Overview

Module Structure

  module: <Toplevel Module>
  module: Umu#6
  module: Value#8
  module: Core#10
has properties
constant: UNIT #40
function: make_unit #45
  class: Unit#12
inherits from
  Object ( Umu::Value::Core )
has properties
method: to_s #13
method: meth_is_equal / 4 #23
method: meth_is_less_than / 4 #35

Class Hierarchy

Object ( Builtin-Module )
Top ( Umu::Value::Core )
Object ( Umu::Value::Core )
  Unit    #12

Code

   1  # coding: utf-8
   2  # frozen_string_literal: true
   3 
   4 
   5 
   6  module Umu
   7 
   8  module Value
   9 
  10  module Core
  11 
  12  class Unit < Object
  13      def to_s
  14          '()'
  15      end
  16 
  17 
  18      define_instance_method(
  19          :meth_is_equal,
  20          :'==', [],
  21          [VC::Top], VCA::Bool
  22      )
  23      def meth_is_equal(_loc, _env, _event, other)
  24          ASSERT.kind_of other, VC::Top
  25 
  26          VC.make_bool other.kind_of?(Unit)
  27      end
  28 
  29 
  30      define_instance_method(
  31          :meth_is_less_than,
  32          :'<', [],
  33          [self], VCA::Bool
  34      )
  35      def meth_is_less_than(_loc, _env, _event, _other)
  36          VC.make_false
  37      end
  38  end
  39 
  40  UNIT = Unit.new.freeze
  41 
  42 
  43  module_function
  44 
  45      def make_unit
  46          UNIT
  47      end
  48 
  49  end # Umu::Core
  50 
  51  end # Umu::Value
  52 
  53  end # Umu