com.phasmidsoftware.number.expression.expr.AtomicExpression
See theAtomicExpression companion trait
object AtomicExpression
Companion object for the AtomicExpression trait. Provides utility methods for working with instances of AtomicExpression.
The unapply method enables pattern matching on AtomicExpression instances, providing an optional Valuable as a result based on the type of the expression. The behavior of this method varies for different subtypes of AtomicExpression, such as Complex, ValueExpression, Literal, Valuable, Noop, and ReducedQuadraticRoot.
Notes:
- For
Complex, the method directly returns theComplexinstance as aValuable. - For
ValueExpressionandLiteral, the value of the Valuable is returned, but the name might be discarded during extraction. - For
Valuable, the method directly returns the Valuable. - For
ReducedQuadraticRoot, the method attempts to evaluate it "as-is." - For
Noop, the method returnsNone.
Considerations:
- The use of
ComplexandValuabledirectly in the extraction may warrant re-evaluation. - The potential loss of the name in
ValueExpressionandLiteralis noted as a trade-off.
Attributes
- Companion
- trait
- Graph
-
- Supertypes
-
class Objecttrait Matchableclass Any
- Self type
-
AtomicExpression.type
Members list
In this article