User Tools

Site Tools


expando_substitution

Expando substitutions

Before a string can be used, it must be “expanded” whereby the expandos (things that start with $) in the string are removed and replaced with their values, and backslashes (\\) are dequoted. However, stuff inside of parenthesis “(…)” or curly braces “{…}” is considered literal text and is not expanded. The stuff inside parenthesis and curly braces is usually expanded later by someone else.

Places where expandos are substituted

The following strings are expanded each time they are used:

  1. Command statements before they are executed, as in “echo $ooga
  2. The argument list to any function call, as in $foo($ooga)
  3. Any expression lvalue, as in “@$ooga += 3”
  4. The contents of a […] or “…” expression operand, as in “@foo = [$ooga]”
  5. The default value of an arglist variable, as in “alias off (var1 default ”$ooga“)
  6. The width modifier in an expando (see below), as in “$[$ooga]foo”
  7. The inside of the $(…) expando, as in $($ooga)
  8. The BX compatable form of $cparse(), as in $cparse(“one two” buckle my $1 shoes $ooga)
  9. The wildcard pattern of a flexible hook, as in /on msg '$ooga *' {…}
  10. The word list to fe or fec, as in /fe ($ooga) {…}
  11. The word list to for var in, as in /for i in ($ooga) {…}
  12. The control value in switch, as in /switch ($ooga) {…}
  13. The matching pattern in switch, as in /switch ($*) {($ooga) {…}}
  14. Ach, there are so many more…

Modifiers applicable to any expando

All forms

Protection from expansion

Expandos and expression mode

Special expandos

expando_substitution.txt · Last modified: 2007/08/06 21:25 (external edit)