Skip to content

Command vs Expression Mode

andychu edited this page Feb 5, 2017 · 7 revisions

oil: Lexical State. RHS of = is expression mode. TODO: Fill out the the rule: = ( ) [ ], vs [ first.

elvish: prefix syntax for arithmetic. So there's only one mode? Code can get lispy because () is command substitution.

Oh Syntax Comparison

The shell language for single commands is almost identical, but the rest is homoiconic syntax? There is a math command for infix, e.g. math '1.2 + 3.4'.

NGS Manual

Switching between syntaxes

In command syntax it is possible to switch to code syntax in one of the following ways:

  • Simple switching (for a lack of better name)
  • Single argument substitution switch
  • Multiple arguments substitution switch

In code syntax it is possible to switch to command syntax in one of the following ways:

  • Capture switch
  • Capture and parse switch
  • Command switch

Mash Shell Quick Reference

Mish is a sublanguage within Mash for launching processes, with a similar syntax to a traditional shell.

By default, Mash is in "regular Mash" mode. If a command line starts or ends with !, the entire line is interpreted as a Mish command. If ! is issued by itself as a command, then Mash toggles into Mish by default, and the prompt changes from a $ to a !.

Clone this wiki locally