 ToString - Maple Help

YAML

 ToString
 format expression as YAML string Calling Sequence ToString(data,opts) Parameters

 data - expression; data to be encoded as YAML opts - (optional) options as specified below Options

 • style = one of block or inline.
 Specifies whether structured objects in Maple should be to multi-line (block) or single-line (inline) output in YAML.
 For example, if style=block a Maple list of three integers will produce a four-line YAML expression, while style=inline will produce a comma-delimited list on a single line. Description

 • The ToString(data) command formats the expression data as YAML (stored as a Maple string).
 • The input data must be a structured expression made only using the base types string, truefalse, realcons, and extended_numeric and the container types list, rtable, table, record, set(equation), DataSeries, and DataFrame. Examples

 > $\mathrm{with}\left(\mathrm{YAML}\right):$
 > $\mathrm{ToString}\left(\left[\mathrm{table}\left(\left["fruit"="orange","count"=23\right]\right)\right]\right)$
 ${"--- - count: 23 fruit: orange"}$ (1)
 > $\mathrm{ToString}\left(\left\{"a"="b","c"=6.283185308\right\}\right)$
 ${"--- a: b c: 6.283185308"}$ (2)
 > $\mathrm{ToString}\left(\left\{"a"="b","c"=6.283185308\right\},\mathrm{style}=\mathrm{inline}\right)$
 ${"\left\{a: b, c: 6.283185308\right\}"}$ (3) Compatibility

 • The YAML[ToString] command was introduced in Maple 2017.