std/text

Phrases

text.From [v: value]

Text form: numbers without trailing zeros, durations canonical, nodes by name, true/false

Gives
text
Contexts
node, main, check, look
Kind
phrase, native
Source
text/text.synod:3
Examples
text/words

text.Join [l: list of text]

Concatenate a list of texts

Gives
text
Contexts
node, main, check, look
Kind
phrase, native
Source
text/text.synod:6
Examples
text/words

text.Size [t: text]

Number of characters

Gives
number
Contexts
node, main, check, look
Kind
phrase, native
Source
text/text.synod:9
Examples
text/words

Examples

words

Shows text.From, text.Join and text.Size: turn values into text, join pieces, count characters

# package main
# Shows text.From, text.Join and text.Size: turn values into text, join pieces, count characters
use std/lesson
use std/sim
use std/text

define main
  set line to (text.Join {"seven is ", (text.From 7), ", and ", (text.From true)})
  lesson.Note line
  lesson.Note (text.Join {"that line has ", (text.From (text.Size line)), " characters"})
  sim.StopAt 1s