diff --git a/docs/samples/happy_numbers.lyng.bad b/docs/samples/happy_numbers.lyng.bad index e66d13f..ec71429 100644 --- a/docs/samples/happy_numbers.lyng.bad +++ b/docs/samples/happy_numbers.lyng.bad @@ -19,12 +19,13 @@ fun naiveCountHappyNumbers() { import lyng.time // -// After all optimizations it takes ~120ms. +// After all optimizations it took ~120ms - before. // -for( r in 1..100 ) { +for( r in 1..900 ) { val start = Instant.now() val found = naiveCountHappyNumbers() println("Found happy numbers: %d time %s"(found, Instant.now() - start)) assert( found == 55252 ) - delay(0.1) -} \ No newline at end of file + delay(0.05) +} + diff --git a/lynglib/build.gradle.kts b/lynglib/build.gradle.kts index 622a1f9..d4abb71 100644 --- a/lynglib/build.gradle.kts +++ b/lynglib/build.gradle.kts @@ -21,7 +21,7 @@ import org.jetbrains.kotlin.gradle.ExperimentalWasmDsl import org.jetbrains.kotlin.gradle.dsl.JvmTarget group = "net.sergeych" -version = "0.10.1-SNAPSHOT" +version = "0.10.2-SNAPSHOT" buildscript { repositories { diff --git a/lynglib/src/commonMain/kotlin/net/sergeych/lyng/obj/Obj.kt b/lynglib/src/commonMain/kotlin/net/sergeych/lyng/obj/Obj.kt index dffb0d7..c0bb6dc 100644 --- a/lynglib/src/commonMain/kotlin/net/sergeych/lyng/obj/Obj.kt +++ b/lynglib/src/commonMain/kotlin/net/sergeych/lyng/obj/Obj.kt @@ -124,7 +124,7 @@ open class Obj { * @param calledFromLyng true if called from Lyng's `toString`. Normally this parameter should be ignored, * but it is used to avoid endless recursion in [Obj.toString] base implementation */ - suspend open fun toString(scope: Scope,calledFromLyng: Boolean=false): ObjString { + open suspend fun toString(scope: Scope,calledFromLyng: Boolean=false): ObjString { return if (this is ObjString) this else if( !calledFromLyng ) { invokeInstanceMethod(scope, "toString") { @@ -265,7 +265,7 @@ open class Obj { } suspend fun invoke(scope: Scope, thisObj: Obj, args: Arguments): Obj = - if (net.sergeych.lyng.PerfFlags.SCOPE_POOL) + if (PerfFlags.SCOPE_POOL) scope.withChildFrame(args, newThisObj = thisObj) { child -> callOn(child) } @@ -300,7 +300,7 @@ open class Obj { open suspend fun lynonType(): LynonType = LynonType.Other open suspend fun serialize(scope: Scope, encoder: LynonEncoder, lynonType: LynonType?) { - scope.raiseNotImplemented() + scope.raiseNotImplemented("lynon: can't serialize ${this.objClass}:${this.toString(scope)}") } fun autoInstanceScope(parent: Scope): Scope {