langur

auto-stringification

Some functions, for certain arguments/values, will convert basic types (number, duration, date-time, regex) to strings. This does not include lists, hashes, or Booleans.

Regex functions (for the string to match), such as match() and replace(), as well as regex used with the forward operator, use auto-stringification, and it is used to compare against a regex by functions such as any().

The functions that write to standard out or standard error (write(), writeln(), writeErr(), writelnErr()) use full auto-stringification (convert any value to a string).

Auto-stringification does not apply to return values. It only applies to arguments.

The join() function uses auto-stringification on each value of the list passed. This allows you to write something like the following without explicitly mapping the values to strings first.

join "|", series 1..7 # result: "1|2|3|4|5|6|7"