#1909·elvish

Confusing error when missing space between function name and body

Author: zzamboniCreated Oct 7, 2025Updated Oct 7, 2025

What happened, and what did you expect to happen?

Elvish produces a confusing error when a function definition is missing the space between the name and the body:

> fn foo{print "hi"}
compilation error: [interactive]:1:4-18: name must be string literal, found compound expression

I think it would be nice to produce a better explanation of what's wrong in this case, since it can be a common error to make.

Output of "elvish -version"

0.21.0

Code of Conduct