summaryrefslogtreecommitdiff
path: root/bos-meta-class.sh
diff options
context:
space:
mode:
authorGianni Ceccarelli <gianni.ceccarelli@broadbean.com>2023-07-27 16:05:41 +0100
committerGianni Ceccarelli <gianni.ceccarelli@broadbean.com>2023-07-27 16:11:10 +0100
commit8e235105c5d98c4daa431c12f2136f89eaeb128d (patch)
tree744db4c3201035db243d5cf957ef6c24d643bc50 /bos-meta-class.sh
parentmore flexible namespaced stores (diff)
downloadbash-object-system-8e235105c5d98c4daa431c12f2136f89eaeb128d.tar.gz
bash-object-system-8e235105c5d98c4daa431c12f2136f89eaeb128d.tar.bz2
bash-object-system-8e235105c5d98c4daa431c12f2136f89eaeb128d.zip
vaguely bootstrap things?
Diffstat (limited to 'bos-meta-class.sh')
-rw-r--r--bos-meta-class.sh39
1 files changed, 28 insertions, 11 deletions
diff --git a/bos-meta-class.sh b/bos-meta-class.sh
index 4884d40..ec3c03e 100644
--- a/bos-meta-class.sh
+++ b/bos-meta-class.sh
@@ -103,17 +103,42 @@ function bos/meta/class/find-method-into() {
# that the class that this metaclass describe, actuall has that
# attribute
function bos/meta/class/get-attribute-by-name-into() {
- local -A bos_meta_class_attrs
+ local -n bos_meta_class_get_attribute_result="$1"
+ local bos_meta_class_attrs_name
# very manual method call, because I'm not sure I can make this
# work otherwise
+ local attribute_type='assoc'
local attribute_name='class-attributes'
local associated_class='bos/meta/class'
- bos/meta/attribute/store-for-into bos_meta_class_attrs "$self"
+ bos/meta/attribute/store-for-into bos_meta_class_attrs_name "$self"
- return "${bos_meta_class_attrs[$1]}"
+ local -n bos_meta_class_attrs="$bos_meta_class_attrs_name"
+
+ bos_meta_class_get_attribute_result="${bos_meta_class_attrs[$1]}"
+
+ return 0
+}
+
+function bos/meta/class/set-attribute-by-name() {
+ local bos_meta_class_attrs_name
+
+ # very manual method call, because I'm not sure I can make this
+ # work otherwise
+
+ local attribute_type='assoc'
+ local attribute_name='class-attributes'
+ local associated_class='bos/meta/class'
+
+ bos/meta/attribute/store-for-into bos_meta_class_attrs_name "$self"
+
+ local -n bos_meta_class_attrs="$bos_meta_class_attrs_name"
+
+ bos_meta_class_attrs["$1"]="$2"
+
+ return 0
}
@@ -201,11 +226,3 @@ function bos/meta/class/create-object-into() {
function bos/meta/class() {
bos-dispatch/invoke bos/meta/class 0 "$@"
}
-
-declare bos_meta_class_meta_class_instance
-bos/meta/class/create-object-into bos_meta_class_meta_class_instance bos/meta/class
-bos-meta/set-metaclass-instance-for bos/meta/class "$bos_meta_class_meta_class_instance"
-
-$bos_meta_class_meta_class_instance make-mro-for bos/meta/class
-
-unset bos_meta_class_meta_class_instance