Repository navigation
Visualizer: indexing a named list is one step; long values abbreviated (P39) - #47
Merged
Merged
Conversation
…d (P39) dauer[1] steps straight to the element instead of first replacing the name by the whole list. Long values read "[1, 2, 3, 4, 5, …, 100]" in the step and in the variables panel, open in full on click, and wrap within the code instead of running on below the panel. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
P39: two visualizer changes for lists.
1. Indexing a named list is one step
name[index]steps straight to the element whennameis a variable. The name gets no step of its own, and the list stays in the variables panel. This works in Ersetzung and in Kasten, and in the → chain, which takes the same steps.w[1:3]). Inm[i][0]the step ism[1]→[3, 4][0]→3, andikeeps its step, since an index variable is a value like any other.notenschnitt(noten)→notenschnitt([5, 4.5, 6]).[1, 2, 30][1]keeps its own step.dauer[3]stops at the error step withIndexError: list index out of range.# dauer[0] > 0 is True.2. Long values: abbreviated, never overflowing
l = list(range(1, 101))now shows[1, 2, 3, 4, 5, …, 100], the same text in the step and in the variables panel. The panel adds «100 Werte» below the value («Einträge» for a dict, «Zeichen» for a string).Threshold:
['+', ['*', 2, ['-', 7, 3]], ['/', ['+', 1, 2], 3]].reprlibdoes but with the last element kept.'Es war einmal…Ende.').The full value on request:
=…annotation and in a box's parameter.No overflow: a long value in a line now wraps within the code instead of running on under the panel, which was the screenshot's problem.
Texts (optional
CoreStrings, de/en):visualizerShowFullValue(«Ganzen Wert zeigen»),visualizerValueLength(«100 Werte», «1 Wert», «20 Einträge», «200 Zeichen»),visualizerFullValueTitle,visualizerFullValueCut(«Nur der Anfang dieses Werts wird gezeigt: Er ist zu lang.»),visualizerCloseFullValue(«Schliessen»).Checks
scripts/check-runtime-lists.py(new, intest:runtime), each case under CPython:dauer[1]is one step, anddauer[0] + dauer[1]takes 3;notenschnitt(noten)and[1, 2, 30][1]are unchanged;dauer[3]ends at theIndexErrorstep;list(range(1, 101))is abbreviated in the step and in the panel, with the full value and its length in the trace;check-console-browser.mjs, in Chrome with Pyodide:cursorwarning.Follow-ups (not done)
parse("1 + 2 + 3 + 4 + 5")) need it.zweites(dauer)withreturn liste[1]readszweites([1, 2, 30])→[1, 2, 30][1]→2in Ersetzung. In Kasten,liste[1]is one step. Please say if you want this changed.…).w[slice(1, 3, None)](unchanged).How it goes live
maindeploys it to GitHub Pages, so LiaScript courses get it right away. The macro doesn't change.v0.1.23on the merge commit, then bump the IDE. I'll open that PR when you tell me the tag is set.Manual tests
On the desktop (Chrome/Safari) and on the iPad with the external keyboard, in the IDE after the bump and in a LiaScript course after the merge:
dauer = [1, 2, 30]andx = dauer[0] + dauer[1], then Visualize in Ersetzung: four states of line 2,dauer[0] + dauer[1]→1 + dauer[1]→1 + 2→3. Then the same in Kasten.l = list(range(1, 101)), then the last step:l = [1, 2, 3, 4, 5, …, 100], with no overflow under the panel. The panel shows the same text and «100 Werte».baum = ["+", ["*", 2, ["-", 7, 3]], ["/", ["+", 1, 2], 3]]: complete, not underlined.🤖 Generated with Claude Code