class Object

In Porolog, Objects represent atomic values.

Public Instance Methods

/(other)

Syntactic sugar to look like Prolog's [H|T]

Alias for: tail
headtail?() click to toggle source

@return [Boolean] whether the Object is an Array with a head and a tail (for an Object, should be false).

# File lib/porolog/core_ext.rb, line 48
def headtail?
  false
end
myid() click to toggle source

A convenience method for testing/debugging. @return [String] the equivalent of inspect.

# File lib/porolog/core_ext.rb, line 16
def myid
  inspect
end
tail(other) click to toggle source

@param other [Object] the Object which is to be the tail @return [Array] an Array with the Object being the head and the other Object being the tail. @example

'head' / ['body', 'foot']   # ==> ['head', 'body', 'foot']
7.tail(:t)                  # ==> [7, *:t]
# File lib/porolog/core_ext.rb, line 40
def tail(other)
  [self]/other
end
Also aliased as: /
type() click to toggle source

@return [Symbol] the type of the object (for an Object, should be :atomic)

# File lib/porolog/core_ext.rb, line 26
def type
  :atomic
end
value(*) click to toggle source

@return [Object] the value of the object, which is itself.

# File lib/porolog/core_ext.rb, line 31
def value(*)
  self
end
variables() click to toggle source

@return [Array] embedded variables (for an Object, should be none).

# File lib/porolog/core_ext.rb, line 21
def variables
  []
end