diff --git a/kmath-core/src/commonMain/kotlin/kscience/kmath/expressions/Expression.kt b/kmath-core/src/commonMain/kotlin/kscience/kmath/expressions/Expression.kt index 7da5a2529..b523d99b1 100644 --- a/kmath-core/src/commonMain/kotlin/kscience/kmath/expressions/Expression.kt +++ b/kmath-core/src/commonMain/kotlin/kscience/kmath/expressions/Expression.kt @@ -10,7 +10,6 @@ import kotlin.properties.ReadOnlyProperty public interface Symbol { /** * Identity object for the symbol. Two symbols with the same identity are considered to be the same symbol. - * By default uses object identity */ public val identity: String } @@ -33,8 +32,6 @@ public fun interface Expression { * @return the value. */ public operator fun invoke(arguments: Map): T - - public companion object } /** @@ -81,17 +78,13 @@ public interface ExpressionAlgebra : Algebra { public fun const(value: T): E } -//public interface ExpressionBuilder> { -// public fun expression(block: A.() -> E): Expression -//} - /** * Bind a given [Symbol] to this context variable and produce context-specific object. */ public fun ExpressionAlgebra.bind(symbol: Symbol): E = bindOrNull(symbol) ?: error("Symbol $symbol could not be bound to $this") -public val symbol: ReadOnlyProperty = ReadOnlyProperty { _, property -> +public val symbol: ReadOnlyProperty = ReadOnlyProperty { _, property -> StringSymbol(property.name) } diff --git a/kmath-core/src/commonMain/kotlin/kscience/kmath/expressions/expressionBuilders.kt b/kmath-core/src/commonMain/kotlin/kscience/kmath/expressions/expressionBuilders.kt index 1702a5921..defbb14ad 100644 --- a/kmath-core/src/commonMain/kotlin/kscience/kmath/expressions/expressionBuilders.kt +++ b/kmath-core/src/commonMain/kotlin/kscience/kmath/expressions/expressionBuilders.kt @@ -7,6 +7,12 @@ import kscience.kmath.operations.Space import kotlin.contracts.InvocationKind import kotlin.contracts.contract + +//public interface ExpressionBuilder> { +// public fun expression(block: A.() -> E): Expression +//} + + /** * Creates a functional expression with this [Space]. */