Kotlin / kotlin-jupyter

Kotlin kernel for Jupyter/IPython
Apache License 2.0
1.09k stars 106 forks source link

Add presentableVarsState for debug output with caching #374

Closed nikolay-egorov closed 2 years ago

nikolay-egorov commented 2 years ago

Actually I do worry about == performance, maybe it's really ok to recreate each time presentable map anew

ileasile commented 2 years ago

Not sure if we really need one more entity for almost the same thing...

nikolay-egorov commented 2 years ago

I suggest to leave plain realisation of map recreation in Notebook, without caching. Like

        val ans = mutableMapOf<String, Result<Any?>>()
        ans.putAll(
            varsState.mapValues {
                it.value.value
            }
        )
        return ans

It's way convinient to keet it here than to assamble this call in bytecode

nikolay-egorov commented 2 years ago

I changed api, introduced private object for debub purposes in repl