EXCEPTION::CURRENT_FUNC 1g 2025-09-11 laplante@plcb.ca GOWEB/EXCEPTION


title: “EXCEPTION::CURRENT_FUNC Function” date: 2025-09-11 author: “laplante@plcb.ca” version: “1.0.1”

module: “GOWEB/EXCEPTION”

Name

*exception::current_func — return the current function or a specific function from the call stack

Synopsis

Description

The exception::current_function function returns the current executing function. If an integer is specified, it returns the corresponding function in the call stack, starting at index 0 for the current function.

Examples

res={{
    func f2() {
        current_func();
        "In f2";
        current_func();
    }
    func f1() {
        current_func();
        f2();
        current_func();
    }

    func f4() {
        current_func();
        "In f4";
        current_func();
        return null;
    }

    func f3() {
        current_func();
        f4();
        current_func();
    }

    f1();
    f3();
}}.

return

res=f1f2In f2f2f1f3f4In f4f4f3.

res={{
    func f2() {
        f3();
    }
    func f1() {
        f2();
    }

    func f4() {
        current_func();
        current_func(0);
        current_func(1);
        current_func(2);
        current_func(3);
    }

    func f3() {
        f4();
    }

    f1();
}}.

return

res=f4f4f3f2f1.

Author

See also

Version History

Description

The exception::current_function function returns the current executing function. If an integer is specified, it returns the corresponding function in the call stack, starting at index 0 for the current function.

Examples

res={{
    func f2() {
        current_func();
        "In f2";
        current_func();
    }
    func f1() {
        current_func();
        f2();
        current_func();
    }

    func f4() {
        current_func();
        "In f4";
        current_func();
        return null;
    }

    func f3() {
        current_func();
        f4();
        current_func();
    }

    f1();
    f3();
}}.

return

res=f1f2In f2f2f1f3f4In f4f4f3.

res={{
    func f2() {
        f3();
    }
    func f1() {
        f2();
    }

    func f4() {
        current_func();
        current_func(0);
        current_func(1);
        current_func(2);
        current_func(3);
    }

    func f3() {
        f4();
    }

    f1();
}}.

return

res=f4f4f3f2f1.

Author

See also

Version History