2 ms·
I think I'll take another look at it. Maybe I'll prefer two stacks! When I last implemented it, it was for an ambitious project, where I just got it working an
by benatkin 2y ago
I think I'll take another look at it. Maybe I'll prefer two stacks!
When I last implemented it, it was for an ambitious project, where I just got it working and then moved onto something else. The single stack seemed to work pretty well. https://codeberg.org/macchiato/ristretto/src/branch/window-worker-wasm/client-server-simulator.md https://codeberg.org/macchiato/ristretto/src/branch/window-w...
I used .at(), I'm not sure why, with a check to make sure it isn't under 0 at the right place, so the -1 behavior wasn't an issue. To see it working go to https://ristretto.codeberg.page/ https://ristretto.codeberg.page/ on desktop and click client-server-simulator.md
Edit: I think it feels better to use at because it seems an accident of history that using an index doesn't error in JavaScript, while with at() it seems to be on purpose, like how .get() in python dicts doesn't error on a missing key.