File: Test13

package info (click to toggle)
omake 0.10.7-1
  • links: PTS, VCS
  • area: main
  • in suites: forky, sid, trixie
  • size: 14,076 kB
  • sloc: ml: 49,729; ansic: 5,163; makefile: 688; sh: 110
file content (24 lines) | stat: -rw-r--r-- 461 bytes parent folder | download
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
# private variables

list-add(vals) =
    private.p[] =
    foreach(x => ..., $(vals))
        p += $(add $(x), 1)
        export p
    value $(p)

v1 = 45 89 322
p1 = $(list-add $(v1))

if $(equal $(length $(p1)), 3)
    println($"length of p1 is 3")
else
    eprintln($"Error: length of p1 is not 3")
    exit 1

if $(equal $(nth 2, $(p1)), 323)
    println($"last element of p1 is 323")
else
    eprintln($"Error: last element of p1 is not 323")
    exit 1