1
2
3
4
5
6
7
8
9 def to-text-line x:_elem -> y:text [
10 local-scope
11 load-inputs
12 y <- to-text x
13 ]
14
15
16 def array-to-text-line x:&:@:_elem -> y:text [
17 local-scope
18 load-inputs
19 y <- to-text *x
20 ]
21
22 scenario to-text-line-early-warning-for-static-dispatch [
23 x:text <- to-text-line 34
24
25 ]
26
27 scenario array-to-text-line-early-warning-for-static-dispatch [
28 n:&:@:num <- new number:type, 3
29 x:text <- array-to-text-line n
30
31 ]
32
33
34 def to-text c:char -> y:text [
35 local-scope
36 load-inputs
37 y <- new character:type, 1/capacity
38 *y <- put-index *y, 0, c
39 ]
40
41 scenario character-to-text [
42 1:char <- copy 111/o
43 2:text <- to-text 1:char
44 3:@:char <- copy *2:text
45 memory-should-contain [
46 3:array:character <- [o]
47 ]
48 ]