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.
The
esdebugscript is a cool and useful bit of es, but it has been broken for a while.This PR makes changes imposed by language drift over time so that
esdebugcan again be run like before.#! /bin/eswith#!/usr/local/bin/es, reflecting the standard install location todaylinecall with%readreturnwithresultwhere the exception behavior isn't necessary$&whilewith a lexically-capturedwhiledispatchparam to%interactive-loopwith dynamically-definedfn-%dispatchexit's change to an exceptionThe script is still pretty old and crufty, though, and there's quite a bit more that could be done as a follow-up to clean this up and make it more useful if we wanted to actually, say, distribute it with the shell.
%seqandifto get rid of the primitive madnesstrap/trace/watchBecause I can't leave well enough alone, here are also some fancier things that could be done if runtime support were added:
$&readlineprimitive (see Up for discussion: User-provided commands for reading shell input #178) could make it nicer to use the debugger's prompt%sethook (see Another bad idea: $&whatis, settor variables, and a new primitive #92) would make more robust tracing possible, especially with variables that already have settors. -D script.es, or to even just drop into the debugger in the middle of a running shell session with something likerunflags = $runflags debug