From 9fe99a59594a83ae2c0960ed8c2ee6959eab062e Mon Sep 17 00:00:00 2001 From: Gianni Ceccarelli Date: Fri, 14 Jul 2023 16:15:00 +0100 Subject: some sugaring --- test.sh | 23 +++++++++++++---------- 1 file changed, 13 insertions(+), 10 deletions(-) (limited to 'test.sh') diff --git a/test.sh b/test.sh index 4a3e02c..058fe07 100644 --- a/test.sh +++ b/test.sh @@ -7,21 +7,24 @@ PS4='[${#FUNCNAME[*]}] ${BASH_SOURCE[0]}:${LINENO} (${FUNCNAME[0]}) +' . bos-mop.sh . bos-dispatch.sh . bos-mop-inheritance.sh +. bos-sugar.sh -bos_5fA_5fmeta="bos-dispatch/invoke bos/mop/inheritance 0" +class A; do -function A/thing() { - echo "<$self> A/thing ($*)" -} + function thing() { + echo "<$self> A/thing ($*)" + } +done -bos_5fB_5fmeta="bos-dispatch/invoke bos/mop/inheritance 0" -$bos_5fB_5fmeta set-superclasses-for B A -$bos_5fB_5fmeta make-mro-for B +class B; do + extends A -function B/other() { - echo "<$self> B/other ($*)" -} + function other() { + echo "<$self> B/other ($*)" + } + +done bos-object-id/pack-self-into A 0 objA bos-object-id/pack-self-into B 0 objB -- cgit v1.2.3