diff options
author | dakkar <dakkar@thenautilus.net> | 2023-07-22 16:05:29 +0100 |
---|---|---|
committer | dakkar <dakkar@thenautilus.net> | 2023-07-22 16:05:29 +0100 |
commit | 4b1b923e1426904b556349c8fe4b1b0453a7223f (patch) | |
tree | 85f1f7b70ad66b5199501d148a9fc7d27b6c099e /bos-base.sh | |
parent | single meta class (diff) | |
download | bash-object-system-4b1b923e1426904b556349c8fe4b1b0453a7223f.tar.gz bash-object-system-4b1b923e1426904b556349c8fe4b1b0453a7223f.tar.bz2 bash-object-system-4b1b923e1426904b556349c8fe4b1b0453a7223f.zip |
move constructor to global base class
Diffstat (limited to 'bos-base.sh')
-rw-r--r-- | bos-base.sh | 13 |
1 files changed, 13 insertions, 0 deletions
diff --git a/bos-base.sh b/bos-base.sh new file mode 100644 index 0000000..d964177 --- /dev/null +++ b/bos-base.sh @@ -0,0 +1,13 @@ +#!bash + +function bos/base/new-into() { + 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 metaclass_ref meta "$class" + local -n metaclass_object="$metaclass_ref" + + local new_object + $metaclass_object create-object-into new_object "$class" "$@" + + new_into_result="$new_object" +} |