2016-09-13 04:02:38 +00:00
|
|
|
# A couple of variants of `to-text` that we'll use implicitly in stashes (see
|
|
|
|
# later layers).
|
|
|
|
#
|
|
|
|
# Mu code might specialize them to be smarter, but I don't anticipate any need
|
|
|
|
# beyond specializing `to-text` itself.
|
|
|
|
|
|
|
|
# 'shorter' variant of to-text, when you want to enable some sort of trimming
|
|
|
|
# define it to be identical to 'to-text' by default
|
2016-09-13 07:07:38 +00:00
|
|
|
def to-text-line x:_elem -> y:text [
|
2016-09-13 04:02:38 +00:00
|
|
|
local-scope
|
|
|
|
load-ingredients
|
|
|
|
y <- to-text x
|
|
|
|
]
|
|
|
|
|
|
|
|
# variant for arrays (since we can't pass them around otherwise)
|
2016-09-13 07:07:38 +00:00
|
|
|
def array-to-text-line x:address:array:_elem -> y:text [
|
2016-09-13 04:02:38 +00:00
|
|
|
local-scope
|
|
|
|
load-ingredients
|
|
|
|
y <- to-text *x
|
|
|
|
]
|
|
|
|
|
|
|
|
scenario to-text-line-early-warning-for-static-dispatch [
|
2016-09-13 07:07:38 +00:00
|
|
|
x:text <- to-text-line 34
|
2016-09-13 04:02:38 +00:00
|
|
|
# just ensure there were no errors
|
|
|
|
]
|
|
|
|
|
|
|
|
scenario array-to-text-line-early-warning-for-static-dispatch [
|
|
|
|
n:address:array:number <- new number:type, 3
|
2016-09-13 07:07:38 +00:00
|
|
|
x:text <- array-to-text-line n
|
2016-09-13 04:02:38 +00:00
|
|
|
# just ensure there were no errors
|
|
|
|
]
|