https://kotlinlang.org logo
Title
a

Alexandre Brown

12/22/2021, 2:41 PM
Is there any reason why we cannot print the shape directly ? From what I see it is represented as an IntArray in MultiK code base.
h

Hampus Londögård

12/22/2021, 2:44 PM
IntArray
is directly a
int[]
, which cannot be printed (java). I guess it’d make sense for the notebook to wrap such calls with
.toList()
to make it prettyprint.
i

Ilya Muradyan

12/22/2021, 2:49 PM
Yes, we can add renderers for primitive arrays, thanks for mentioning
👍 6
s

smallshen

12/23/2021, 1:52 PM
there should be something called .contentToString
🤔 1
i

Ilya Muradyan

12/24/2021, 7:37 AM
You can just call
array.toList().toString()
. Regarding renderer, I've added it.
a

Alexandre Brown

12/24/2021, 2:44 PM
@smallshen Thanks for the proposal. Yes it works but I think we shouldn't have to worry about a toList here. The first thing people coming from a Python Notebook experience will do is try to print the way I did. I think it's important to support these simple use cases to make a transition to kotlin notebook as easy as possible. Thanks for the responsiveness @Ilya Muradyan