aboutsummaryrefslogtreecommitdiff
path: root/lib/object.nom
diff options
context:
space:
mode:
authorBruce Hill <bruce@bruce-hill.com>2019-01-01 17:15:51 -0800
committerBruce Hill <bruce@bruce-hill.com>2019-01-01 17:17:23 -0800
commit3e89092833a6d407e711fe4ae5f44474ff34cf64 (patch)
tree5ffe2df86f648b604347b59999992d74f71a796c /lib/object.nom
parente68eb04d690454428216a0f0f1b11399feeb7dc1 (diff)
Some changes to the error API, a fix for statement block parsing, and
replacing ((foo 1 baz)'s meaning) with $(foo 1 baz).
Diffstat (limited to 'lib/object.nom')
-rw-r--r--lib/object.nom14
1 files changed, 10 insertions, 4 deletions
diff --git a/lib/object.nom b/lib/object.nom
index fa746b6..13a9ec5 100644
--- a/lib/object.nom
+++ b/lib/object.nom
@@ -1,4 +1,4 @@
-#!/usr/bin/env nomsu -V6.13.12.8
+#!/usr/bin/env nomsu -V6.14
#
This file contains the implementation of an Object-Oriented programming system.
@@ -37,7 +37,9 @@ test:
assume ($d.genus == "Canus")
assume ($d.barks == 3)
$d2 = (Dog {})
- assume ($d2.barks == 0) or barf "Default initializer failed"
+ unless ($d2.barks == 0):
+ fail "Default initializer failed"
+
with [$d = (Dog {.barks = 1})]:
assume (($d, bark) == "Bark!")
@@ -50,8 +52,12 @@ test:
$corg = (Corgi {})
assume ($corg.barks == 0)
with [$d = (Corgi {.barks = 1})]:
- assume (($d, sploot) == "splooted") or barf "subclass method failed"
- assume (($d, bark) == "Yip!") or barf "inheritance failed"
+ unless (($d, sploot) == "splooted"):
+ fail "subclass method failed"
+
+ unless (($d, bark) == "Yip!"):
+ fail "inheritance failed"
+
assume (($d, woof) == "Yip!")
with [$d = (Dog {.barks = 2})]: