diff options
author | dakkar <dakkar@thenautilus.net> | 2023-07-22 12:35:39 +0100 |
---|---|---|
committer | dakkar <dakkar@thenautilus.net> | 2023-07-22 12:35:39 +0100 |
commit | 6b3f9cb909df162345d9f5a001abeb0d3df31ce9 (patch) | |
tree | 32d89ba43faaea0ebfe69f9aaa8f002c7b9e57bd /bos-sugar.sh | |
parent | move tests to actual test programs (diff) | |
download | bash-object-system-6b3f9cb909df162345d9f5a001abeb0d3df31ce9.tar.gz bash-object-system-6b3f9cb909df162345d9f5a001abeb0d3df31ce9.tar.bz2 bash-object-system-6b3f9cb909df162345d9f5a001abeb0d3df31ce9.zip |
`*-into` always takes the destination as `$1`
Diffstat (limited to 'bos-sugar.sh')
-rw-r--r-- | bos-sugar.sh | 12 |
1 files changed, 6 insertions, 6 deletions
diff --git a/bos-sugar.sh b/bos-sugar.sh index a199ed9..2da789a 100644 --- a/bos-sugar.sh +++ b/bos-sugar.sh @@ -25,7 +25,7 @@ function bos-sugar/current-class-into() { function bos-sugar/set-metaclass-for-current-class() { local class; bos-sugar/current-class-into class - local metaclass_ref; bos-namespaces/store-scalar-for-into meta "$class" metaclass_ref + local metaclass_ref; bos-namespaces/store-scalar-for-into metaclass_ref meta "$class" local -n metaclass_object="$metaclass_ref" metaclass_object='bos-dispatch/invoke bos/mop/inheritance 0' } @@ -42,7 +42,7 @@ function bos-sugar/class-open() { function extends() { local fq_class; bos-sugar/current-class-into fq_class - local metaclass_ref; bos-namespaces/store-scalar-for-into meta "$fq_class" metaclass_ref + local metaclass_ref; bos-namespaces/store-scalar-for-into metaclass_ref meta "$fq_class" local -n metaclass_object="$metaclass_ref" $metaclass_object set-superclasses-for "$fq_class" "$@" } @@ -53,9 +53,9 @@ function bos-sugar/class-open() { # this will get renamed into the class function new-into() { - local class _; bos-object/unpack-self-into "$self" class _ + local class _; bos-object/unpack-self-into class _ "$self" local -n new_into_result="$1"; shift - local metaclass_ref; bos-namespaces/store-scalar-for-into meta "$class" metaclass_ref + local metaclass_ref; bos-namespaces/store-scalar-for-into metaclass_ref meta "$class" local -n metaclass_object="$metaclass_ref" local new_object @@ -71,10 +71,10 @@ function bos-sugar/class-close() { local class="$1" local fq_class; bos-sugar/current-class-into fq_class - local metaclass_ref; bos-namespaces/store-scalar-for-into meta "$fq_class" metaclass_ref + local metaclass_ref; bos-namespaces/store-scalar-for-into metaclass_ref meta "$fq_class" local -n metaclass_object="$metaclass_ref" - local -a methods_list; bos-namespaces/list-new-funcs-into "$fq_class" methods_list + local -a methods_list; bos-namespaces/list-new-funcs-into methods_list "$fq_class" bos-namespaces/qualify-funcs "$fq_class" "${methods_list[@]}" $metaclass_object make-mro-for "$fq_class" |