ela
Contents

ManualAgents

Printing a value

In the terminalela --spec printing-a-value

echo prints any value, and a call written bare after it prints the call's value: no $( ), no ${ } and no variable first.

echo len($hosts)                    # 3echo list.head($hosts, 2)           # ["web", "db"]echo "hosts:" len($hosts) "up"      # hosts: 3 upecho ${file.info("notes.md")}       # the map, as echo $info prints itecho map.keys($config) > keys.txt
  • echo $(len($hosts)) stops before line 1: a $( ) runs a command, and the message names echo len($hosts).
  • ela has no print: print(…) stops before line 1 naming echo, and print $x runs the system's print program, which --lint warns of.
  • Only echo reads a call bare. In any other command, warn too, a call is a word in ${ }: ls ${list.head($dirs, 1)}, warn "only ${len($hosts)} up".
  • A list prints in ela's form, ["ela", "amber-lib"]. For its items as words, write echo ${str.join($names, " ")}.

(ela --spec echo)