REPL Autocorrection

Migrated from GitHub.

One thing that’s great on macOS is the terminal utility fu&k, which looks at what you just typed (and other context, like where your terminal is), and pre-loads a series of corrections. For example, a top-level command cd Dekstop might be corrected to cd Desktop.

I think something like this might be good for the Julia REPL. For example, if you type something that’s a char off from a variable in Main, or if your parantheticals are mismatched, or… We already have some support for this kind of thing, like the did you mean... feature in help mode, so it seems like this is a logical next step.

1 Like

Something like that might be nice as an optional feature, but I can well imagine it wreaking havoc if you are not very careful.

For example, suppose I declare some variable x1 and intend to declare x2 but forget. Then, if I’m typing x2 somewhere, perhaps I absentmindedly tab through some suggestions (perhaps because I’m already using tab for auto-complete) and wind up inadvertently putting in x1 when I meant x2. Further suppose that x1 and the intended x2 are of the same type. Now I have a silent bug in my code. This might be kind of scary depending on what it is.

4 Likes