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 namesecho len($hosts).- ela has no
print:print(…)stops before line 1 namingecho, andprint $xruns the system'sprintprogram, which--lintwarns of. - Only
echoreads a call bare. In any other command,warntoo, 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, writeecho ${str.join($names, " ")}.
(ela --spec echo)