On 5/2/22 4:03 PM, Robert E. Griffith wrote:
>> What's your use case?
I have a bash script library that supports Objects and Classes in
bash script. I am now writing a loadable builtin to speed up the
object call and other mechanisms.
echo "'$obj'"
'_bgclassCall heap_A_XXXXX MyClass 0 |'
$obj.doSomething p1 p2
_bgclassCall is a function that sets up the method context (e.g.
local -n this=heap_A_XXXXX), and then calls the shell function that
corresponds to 'doSomething' (e.g. MyClass::soSomething)
_bgclassCall has a bash implementation but when the new builtin is
loaded I suppress the bash version so the builtin is used.
It also comes up for example if I want to implement the
ConstructObject function as a builtin, it identifies and runs the
__constructor shell functions while building up the object instance.
That seems reasonable. I'll add it.