summaryrefslogtreecommitdiff
path: root/bos-meta-attribute.sh
diff options
context:
space:
mode:
authordakkar <dakkar@thenautilus.net>2023-07-28 12:09:50 +0100
committerdakkar <dakkar@thenautilus.net>2023-07-28 12:09:50 +0100
commit1587b16d91c69932470dc74284b2f615bda74032 (patch)
tree2dfc172853695fa7c6d63ae7bef4edd91affe243 /bos-meta-attribute.sh
parentless broken (diff)
downloadbash-object-system-1587b16d91c69932470dc74284b2f615bda74032.tar.gz
bash-object-system-1587b16d91c69932470dc74284b2f615bda74032.tar.bz2
bash-object-system-1587b16d91c69932470dc74284b2f615bda74032.zip
probably fix exposing attributes
now they're aliases… still completely untested, because: * we're not exposing attributes on direct dispatch (`bos-dispatch/invoke`) * we don't have a decent way to add attributes to classes (`bos-sugar/*`)
Diffstat (limited to 'bos-meta-attribute.sh')
-rw-r--r--bos-meta-attribute.sh14
1 files changed, 14 insertions, 0 deletions
diff --git a/bos-meta-attribute.sh b/bos-meta-attribute.sh
index 9d7a4dd..1153d3a 100644
--- a/bos-meta-attribute.sh
+++ b/bos-meta-attribute.sh
@@ -6,6 +6,20 @@ function bos/meta/attribute/store-for-into() {
local bos_meta_attribute_class bos_meta_attribute_objid
bos-object/unpack-self-into bos_meta_attribute_class bos_meta_attribute_objid "$2"
+ # meta-look! we can't depend on bos-dispatch/invoke or
+ # bos/meta/class/invoke to set these up
+
+ # the `if` is there because bos-meta-bootstrap.sh sets these manually
+ if [[ -z "$attribute_name" ]]; then
+ local bos_meta_attribute_get_name; $self get-attribute-name-into bos_meta_attribute_get_name
+ local bos_meta_attribute_get_type; $self get-attribute-type-into bos_meta_attribute_get_type
+ local bos_meta_attribute_get_class; $self get-associated-class-into bos_meta_attribute_get_class
+
+ local attribute_name="$bos_meta_attribute_get_name"
+ local attribute_type="$bos_meta_attribute_get_type"
+ local associated_class="$bos_meta_attribute_get_class"
+ fi
+
"bos-namespaces/store-${attribute_type}-for-into" "$1" attribute "$attribute_name" "$associated_class" "$bos_meta_attribute_class" "$bos_meta_attribute_objid"
}