Summary

Bare hashes cause confusing error message in scripts

Metadata

Description

As pointed out by erkin on IRC, when you run a script with `-ss` which contains something like `#`, the error message you get is confusing, especially if you don't know about csi's history references (especially given that this is a script, not manual input).

The error is:

 Error: history entry index out of range: 0

If this is the result of running a long script that somewhere contains `#` (or just `#0`), this doesn't point to the location of the issue either.

Proposed possible improvements:

- Add the `#` to the error message so it's clear that this syntax is causing it, even if you don't know what a "history index" is. But note that just adding it is not going to be enough, since just `#` also triggers this error. - Give a better/different error when reading a bare `#` - Include the line number (part of a larger issue in evaluated script code, and the hardest to implement) - Disable history syntax when running with `-s` or `-ss`.

Changes and comments

[2018-05-30 21:41:55 UTC] sjamaan changed priority from major to minor

[2018-05-30 21:41:55 UTC] sjamaan changed description

[2018-05-30 21:41:55 UTC] sjamaan changed summary

[2018-05-30 21:44:43 UTC] sjamaan wrote:

For reference, Chibi gives a better error: `ERROR on line 57 of file op.scm: invalid char following '#': #\space`

Some other Schemes have shitty error messages too, but that shouldn't stop us from improving ours ;)

erkin actually had `(# . foo)` in a quoted alist, not remembering that `#` is special syntax.

[2018-07-16 21:59:59 UTC] kooda changed status from new to closed

[2018-07-16 21:59:59 UTC] kooda set resolution to fixed

[2018-07-16 21:59:59 UTC] kooda wrote:

Fixed in 42f3ff1bd63f563d3fd9c3329f0c5f9fc4f5b749