diff options
author | dakkar <dakkar@thenautilus.net> | 2023-07-22 16:38:33 +0100 |
---|---|---|
committer | dakkar <dakkar@thenautilus.net> | 2023-07-22 16:38:33 +0100 |
commit | 02eec4498027352e87826929d015f5b47bad93f8 (patch) | |
tree | f59e8d639aabdd6899cb3d570d57468d7e85833a /bos-meta.sh | |
parent | move constructor to global base class (diff) | |
download | bash-object-system-02eec4498027352e87826929d015f5b47bad93f8.tar.gz bash-object-system-02eec4498027352e87826929d015f5b47bad93f8.tar.bz2 bash-object-system-02eec4498027352e87826929d015f5b47bad93f8.zip |
metaclass instances
Diffstat (limited to 'bos-meta.sh')
-rw-r--r-- | bos-meta.sh | 17 |
1 files changed, 17 insertions, 0 deletions
diff --git a/bos-meta.sh b/bos-meta.sh new file mode 100644 index 0000000..6932095 --- /dev/null +++ b/bos-meta.sh @@ -0,0 +1,17 @@ +#!bash + +declare -A bos_meta_metaclass_instance_for_class + +function bos-meta/set-metaclass-instance-for() { + bos_meta_metaclass_instance_for_class["$1"]="$2" + + return 0 +} + +function bos-meta/metaclass-instance-for-class-into() { + local -n bos_meta_metaclass_instance_result="$1" + + bos_meta_metaclass_instance_result="${bos_meta_metaclass_instance_for_class[$2]}" + + return 0 +} |