Sha256: afb746deb8153093f99db8e158a5ecc276390fe161dfc6d896ec1aaffefc13a8

Contents?: true

Size: 481 Bytes

Versions: 2

Compression:

Stored size: 481 Bytes

Contents

# frozen_string_literal: true

require 'singleton' # Use the Singleton design pattern
require_relative 'builtin_datatype'

module Loxxy
  module Datatype
    # Class for representing a Lox nil "value".
    class Nil < BuiltinDatatype
      include Singleton # Make a singleton class
      
      # Build the sole instance
      def initialize
        super(nil)
      end
    end # class
    
    Nil.instance.freeze  # Make the sole instance immutable
  end # module
end # module

Version data entries

2 entries across 2 versions & 1 rubygems

Version Path
loxxy-0.0.4 lib/loxxy/datatype/nil.rb
loxxy-0.0.3 lib/loxxy/datatype/nil.rb