elves / elvish

Powerful scripting language & versatile interactive shell
https://elv.sh/
BSD 2-Clause "Simplified" License
5.52k stars 296 forks source link

language: mention that the tilde can also be a variable suffix #1781

Closed marco-m closed 3 months ago

marco-m commented 3 months ago

When somebody is learning Elvish, he/she will soon stumble on a variable with a tilde suffix, e.g.: $foo~.

If he then goes to the Language specification, and searches for the ~ character, he will find 290 matches, so impractical to follow all of them.

If he searches for the name tilde, he will find section https://elv.sh/ref/language.html#metacharacters, but that section mentions tilde only for the tilde-expansion case.

This PR adds the mention also for https://elv.sh/ref/language.html#variable-suffix, so that finally one can more easily find out that a variable ending with ~ refers to function (or callable).

Thanks for Elvish!

xiaq commented 3 months ago

Thanks. This use of ~ is not technically a metacharacter though, so the wording needs some change - I've done that b0abf3cb111df6d658db4551f0fbfde35509591c and credited this PR, so I'll close this.

Thanks again!