aboutsummaryrefslogtreecommitdiff
path: root/examples/working-loaded/error.test
blob: bce6b693ca6003040dddb2d5ac43a691afee6376 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
{ ==file
  "trying to frobnicate file" dump file dump
  file "conf" eq
  1 or
  { ??io.read } rep # oops, this failed
  "continuing frobnication..." dump
} /frobnicateFile deffst

{
  { ==doItManually
    "conf" ==file !!? ==restartFrobnication
    {
      file frobnicateFile
    } {
      -- <
        { "conf.bak" =file restartFrobnication 0 ! } =*useBackup
        { "Enter config by hand" dump doItManually 0 ! } =*manualEntry
      > ??!io
    } ?!io
  } {
    "manual entry starting (and grabbing stack)" dump
  } !!'
} /frobnicateConfig deffst


{
  {
    frobnicateConfig
  } {
    -- "fail :(" die
  } ?!io
} /frobnicateUI deffst

{
  {
    frobnicateConfig
  } {
    {
      "using backup config" dump .useBackup
    } {
      "last resort" dump .manualEntry
    } ?!io
  } ?!io
} /frobnicateUIBetter deffst

{
  {
    frobnicateConfig
  } [
    { "using backup config" dump .useBackup }
    { "last resort" dump .manualEntry }
  ] ?!!io
} /frobnicateUIBest deffst

frobnicateUIBest

# vim: syntax=elymas