diff --git a/dataforge-meta/src/commonMain/kotlin/hep/dataforge/meta/Delegates.kt b/dataforge-meta/src/commonMain/kotlin/hep/dataforge/meta/Delegates.kt index 119b78b0..8cb9250e 100644 --- a/dataforge-meta/src/commonMain/kotlin/hep/dataforge/meta/Delegates.kt +++ b/dataforge-meta/src/commonMain/kotlin/hep/dataforge/meta/Delegates.kt @@ -245,6 +245,7 @@ class MutableNumberDelegate>( } val double get() = ReadWriteDelegateWrapper(this, reader = { it?.toDouble() }, writer = { it }) + val float get() = ReadWriteDelegateWrapper(this, reader = { it?.toFloat() }, writer = { it }) val int get() = ReadWriteDelegateWrapper(this, reader = { it?.toInt() }, writer = { it }) val short get() = ReadWriteDelegateWrapper(this, reader = { it?.toShort() }, writer = { it }) val long get() = ReadWriteDelegateWrapper(this, reader = { it?.toLong() }, writer = { it }) @@ -303,6 +304,7 @@ class MutableSafeNumberDelegate>( } val double get() = ReadWriteDelegateWrapper(this, reader = { it.toDouble() }, writer = { it }) + val float get() = ReadWriteDelegateWrapper(this, reader = { it.toFloat() }, writer = { it }) val int get() = ReadWriteDelegateWrapper(this, reader = { it.toInt() }, writer = { it }) val short get() = ReadWriteDelegateWrapper(this, reader = { it.toShort() }, writer = { it }) val long get() = ReadWriteDelegateWrapper(this, reader = { it.toLong() }, writer = { it }) diff --git a/dataforge-meta/src/commonMain/kotlin/hep/dataforge/meta/MutableMeta.kt b/dataforge-meta/src/commonMain/kotlin/hep/dataforge/meta/MutableMeta.kt index f3b4f3ba..e1a56832 100644 --- a/dataforge-meta/src/commonMain/kotlin/hep/dataforge/meta/MutableMeta.kt +++ b/dataforge-meta/src/commonMain/kotlin/hep/dataforge/meta/MutableMeta.kt @@ -118,6 +118,7 @@ operator fun > M.set(name: Name, value: Any?) { is MetaItem.NodeItem<*> -> setNode(name, value.node) } is Meta -> setNode(name, value) + is Specification -> setNode(name, value.config) else -> setValue(name, Value.of(value)) } } @@ -183,3 +184,5 @@ fun > M.append(name: Name, value: Any?) { set(name.withIndex(index.toString()), value) } } + +fun > M.append(name: String, value: Any?) = append(name.toName(), value) \ No newline at end of file