From 3e89092833a6d407e711fe4ae5f44474ff34cf64 Mon Sep 17 00:00:00 2001 From: Bruce Hill Date: Tue, 1 Jan 2019 17:15:51 -0800 Subject: Some changes to the error API, a fix for statement block parsing, and replacing ((foo 1 baz)'s meaning) with $(foo 1 baz). --- lib/object.nom | 14 ++++++++++---- 1 file changed, 10 insertions(+), 4 deletions(-) (limited to 'lib/object.nom') 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})]: -- cgit v1.2.3