Closed krader1961 closed 3 years ago
Replacing var local:...
with set local:...
in my module revealed a similar error in a third-party module by @zzamboni:
Exception: compilation error: variable declared in var must be unqualified
/Users/krader/.config/elvish/lib/github.com/zzamboni/elvish-modules/util.elv, line 38: var local:line = (if $prompt {
/Users/krader/.config/elvish/rc.elv, line 61: use github.com/zzamboni/elvish-modules/util zutil
Fixing the error in my previous comment reveals another instance of the same problem:
Exception: compilation error: variable declared in var must be unqualified
/Users/krader/.config/elvish/lib/github.com/zzamboni/elvish-modules/tty.elv, line 5: var local:stty = (stty -g </dev/tty)
Traceback:
/Users/krader/.config/elvish/lib/github.com/zzamboni/elvish-modules/spinners.elv, line 3:
use github.com/zzamboni/elvish-modules/tty
/Users/krader/.config/elvish/lib/github.com/zzamboni/elvish-themes/chain.elv, line 14:
use github.com/zzamboni/elvish-modules/spinners
/Users/krader/.config/elvish/lib/prompt.elv, line 3:
use github.com/zzamboni/elvish-themes/chain
/Users/krader/.config/elvish/rc.elv, line 91:
use prompt
It seems you're not running with the latest HEAD; https://github.com/elves/elvish/commit/6a7d99041d1e1f27c0df79d8ce947e5279244b0e updated var
to accept forms like var local:a
as valid.
Hmm, this should probably be fixed nonetheless in order for the converted script to be compatible with 0.16.x.
I currently have 0.17.0-dev.9076934395344d308180dd36ba289285dd7af779+macpro.skepticism.us installed. So reasonably current (less than two months old) but as you noted the upgrade program really needs to work with the 0.16.0 version of elvish.
Long ago, when I first started using Elvish, I wrote a
nx
function. Its purpose is to run an external command and ignore specific non-zero exit status exceptions. The function employs thelocal:
namespace prefix. This statement:Was mutated to this:
Which results in this error when starting a new Elvish shell: