Open Ambrevar opened 2 years ago
The reason I made an empty data-repl-id
for the last input is that its behavior is special—it does not evaluate anything, it's merely adding new cells. This duality is the reason for most clumsy parts in the lisp-repl
. If you have an idea for how to get rid or this clumsiness, I'm all for it :)
Can you highlight the clumsy parts you are thinking about? I haven't touched the repl code in a while... :p
I mean exactly what you highlight—the speciality of the last cell, mainly.
So what reverting the logic to make all cells the same?
That should cut it, no?
Doesn't feel exactly right, but let us go with this design—it feels much simpler.
Another suggestion?
Nope :P
Related to #2113.
Since the lisp-repl "notebook" overhaul we've been having a bunch of javascript errors like:
The message is clear:
input-buffer[data-repl-id=\"0\"]'
returns null because there is nothing there. So I tried to fix it, but I found it surprisingly hard.I may be missing something, or the maybe the design should be better documented. But I'm also wondering if the design could not be greatly simplified.
Let's start with some questions:
""
, instead of a number. Why not number it to(length evaluations)
? That would be more consistent and surely simplify the logic.reload-buffers
, is it really necessary?evaluate-cell
seems to tangle the model and the view. Should the ID be inferred from the position in the list? In particular, this seems to be the source of the aforementioned JS error:What I understand but is not made apparent in the above is that if an evaluation already exists for a given cell ID, it is replaced, otherwise it's appended. This could be simplified, for instance by storing the evaluations in a hash-table and by always having and ID.
Thoughts @aartaka ?