diff options
Diffstat (limited to 'bos-mop.sh')
-rw-r--r-- | bos-mop.sh | 19 |
1 files changed, 17 insertions, 2 deletions
@@ -19,7 +19,7 @@ function bos/mop/base/find-method-into() { local start_from_class="$2" # the method to look for local method="$3" - local -n result="$4" + local -n bos_mop_base_find_method_result="$4" local mro_store; $self mro-for-into "$class" mro_store local -n mro="$mro_store" @@ -45,7 +45,7 @@ function bos/mop/base/find-method-into() { for (( ; idx < "${#mro[@]}" ; ++idx )); do local full_name="${mro[$idx]}/${method}" if declare -F "$full_name" >/dev/null; then - result="${full_name}" + bos_mop_base_find_method_result="${full_name}" return 0 fi done @@ -88,3 +88,18 @@ function bos/mop/base/invoke() { eval "\"\$$ffsname\" \"\$@\"" return $? } + +function bos/mop/base/create-object-into() { + local -n bos_mop_base_create_object_result="$1";shift + local class="$1";shift + + local object_id_store; bos-namespaces/store-scalar-for-into object_id "$class" object_id_store + local -n object_id="$object_id_store" + (( ++object_id )) + + bos-object-id/pack-self-into "$class" "$object_id" bos_mop_base_create_object_result + + # TODO invoke BUILD/BUILDALL? probably in a different metaclass, though + + return 0 +} |