diff options
author | Gianni Ceccarelli <gianni.ceccarelli@broadbean.com> | 2023-07-14 16:15:00 +0100 |
---|---|---|
committer | Gianni Ceccarelli <gianni.ceccarelli@broadbean.com> | 2023-07-14 16:15:00 +0100 |
commit | 9fe99a59594a83ae2c0960ed8c2ee6959eab062e (patch) | |
tree | 06af594d07c1dd1cb46ba6fc57a38cc387cb7f3f /test.sh | |
parent | inheritance via MOP (diff) | |
download | bash-object-system-9fe99a59594a83ae2c0960ed8c2ee6959eab062e.tar.gz bash-object-system-9fe99a59594a83ae2c0960ed8c2ee6959eab062e.tar.bz2 bash-object-system-9fe99a59594a83ae2c0960ed8c2ee6959eab062e.zip |
some sugaring
Diffstat (limited to 'test.sh')
-rw-r--r-- | test.sh | 23 |
1 files changed, 13 insertions, 10 deletions
@@ -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 |