ValueExpression

com.phasmidsoftware.number.expression.expr.ValueExpression
See theValueExpression companion class

The ValueExpression companion object provides a mechanism to extract elements from a ValueExpression instance. It defines the unapply method to enable pattern matching and decomposition of ValueExpression objects.

The extraction operation retrieves the underlying Eager and an optional name, if available. It handles two main cases:

  1. For instances of Literal, it extracts the Eager value along with None for the optional name.
  2. For other cases, it extracts the Eager value along with its associated optional name.

Attributes

See also

ValueExpression

Literal

Companion
class
Graph
Supertypes
trait Sum
trait Mirror
class Object
trait Matchable
class Any
Self type

Members list

Type members

Inherited and Abstract types

type MirroredElemLabels <: Tuple

The names of the product elements.

The names of the product elements.

Attributes

Inherited from:
Mirror
type MirroredLabel <: String

The name of the type.

The name of the type.

Attributes

Inherited from:
Mirror

Value members

Concrete methods

Creates a ValueExpression instance by wrapping the provided Valuable object. NOTE: client code should not normally invoke this method directly. Prefer to use the Expression.apply method for creating ValueExpression instances.

Creates a ValueExpression instance by wrapping the provided Valuable object. NOTE: client code should not normally invoke this method directly. Prefer to use the Expression.apply method for creating ValueExpression instances.

Value parameters

v

the Eager instance to be encapsulated within a ValueExpression.

Attributes

Returns

a ValueExpression representing the provided Eager object, with its rendered representation.

def apply(x: Int): ValueExpression

Creates a Literal instance using an integer value. NOTE not recursive

Creates a Literal instance using an integer value. NOTE not recursive

Value parameters

x

the integer value to be used for constructing the Literal.

Attributes

Returns

a Literal instance wrapping the provided integer value as a Real number.

def unapply(f: ValueExpression): Option[(Eager, Option[String])]

Extracts components from a ValueExpression instance, enabling pattern matching.

Extracts components from a ValueExpression instance, enabling pattern matching.

The unapply method decomposes a ValueExpression into its constituent Valuable and an optional name. For instances of Literal, the optional name is always None.

Value parameters

f

the ValueExpression to be decomposed.

Attributes

Returns

an Option containing a tuple of the Valuable and an optional name derived from the given ValueExpression. If the input cannot be decomposed, returns None.

Implicits

Implicits

LatexRenderer for ValueExpression expressions.

LatexRenderer for ValueExpression expressions.

Attributes