bug-bash
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: execute_cmd.h is not included in installed headers


From: Robert E. Griffith
Subject: Re: execute_cmd.h is not included in installed headers
Date: Mon, 2 May 2022 21:25:48 -0400
User-agent: Mozilla/5.0 (X11; Linux x86_64; rv:91.0) Gecko/20100101 Thunderbird/91.7.0

>> That seems reasonable. I'll add it.

Cool, thanks.

--BobG

On 5/2/22 16:47, Chet Ramey wrote:
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.




reply via email to

[Prev in Thread] Current Thread [Next in Thread]