summaryrefslogtreecommitdiff
path: root/test.sh
diff options
context:
space:
mode:
authorGianni Ceccarelli <gianni.ceccarelli@broadbean.com>2023-07-14 11:56:20 +0100
committerGianni Ceccarelli <gianni.ceccarelli@broadbean.com>2023-07-14 11:56:20 +0100
commitdc627de951cb666b123b5b23c1e040dc9f77e696 (patch)
tree8cc4e0b93b497b9cf28fc61a3a8dc036f178ed95 /test.sh
parentflailing about with MOPs (diff)
downloadbash-object-system-dc627de951cb666b123b5b23c1e040dc9f77e696.tar.gz
bash-object-system-dc627de951cb666b123b5b23c1e040dc9f77e696.tar.bz2
bash-object-system-dc627de951cb666b123b5b23c1e040dc9f77e696.zip
method dispatch seems to work
Diffstat (limited to 'test.sh')
-rw-r--r--test.sh28
1 files changed, 28 insertions, 0 deletions
diff --git a/test.sh b/test.sh
new file mode 100644
index 0000000..6e7e49c
--- /dev/null
+++ b/test.sh
@@ -0,0 +1,28 @@
+#!/bin/bash
+
+. bos-namespaces.sh
+. bos-object-id.sh
+. bos-mop.sh
+. bos-dispatch.sh
+
+bos_namespaces__A__meta="bos-dispatch/invoke bos/mop/base 0"
+bos_namespaces__A__mro=( "A" )
+
+function A/thing() {
+ echo "<$self> A/thing ($*)"
+}
+
+bos_namespaces__B__meta="bos-dispatch/invoke bos/mop/base 0"
+bos_namespaces__B__mro=( "B" "A" )
+
+function B/other() {
+ echo "<$self> B/other ($*)"
+}
+
+bos-object-id/pack-self-into A 0 objA
+bos-object-id/pack-self-into B 0 objB
+
+$objA thing 1 2 3
+$objB thing 4 5 6
+$objB other 7 8 9
+