nsmcp::codeLocalComparable

 nsmcp::codeLocalComparable

Defined in

Partial Call Graph (max 5 caller/called nodes):
Class ::nsmcp::CodeUpstreamTool Class ::nsmcp::CodeUpstreamTool (public) nsmcp::codeLocalComparable nsmcp::codeLocalComparable Class ::nsmcp::CodeUpstreamTool->nsmcp::codeLocalComparable compare compare compare->nsmcp::codeLocalComparable instproc instproc instproc->nsmcp::codeLocalComparable nsmcp::CodeUpstreamTool nsmcp::CodeUpstreamTool nsmcp::CodeUpstreamTool->nsmcp::codeLocalComparable nsmcp::codeCanonicalArguments nsmcp::codeCanonicalArguments nsmcp::codeLocalComparable->nsmcp::codeCanonicalArguments nsmcp::codeQualified nsmcp::codeQualified nsmcp::codeLocalComparable->nsmcp::codeQualified nsmcp::codeResolve nsmcp::codeResolve nsmcp::codeLocalComparable->nsmcp::codeResolve

Testcases:
No testcase defined.
Source code:
    set resolved [codeResolve $name]
    set definition [dict get $resolved definition]
    set args [lindex $definition end-1]
    set body [lindex $definition end]
    if {[dict get $resolved kind] in {nx xotcl}} {
        lassign $name object tag member
        set scope [expr {$tag eq "instproc" ? "class" : "object"}]
        set api ::nsf::methods::${scope}::info::method
        if {[catch {
            set body [nsf::directdispatch $object $api body $member]
            set args [nsf::directdispatch $object $api parameter $member]
        }]} {
            error "local-definition-not-scripted"
        }
    }
    if {[dict exists $doc arg_list]} {
        set args [dict get $doc arg_list]
    }
    set comparisonBody $body
    set normalizations {}
    # NSF -ad procs with optional, unset arguments receive this exact preamble.
    # Compare raw bodies too, and only remove a single prefix when native NSF
    # introspection confirms the underlying body and original metadata has an
    # optional untyped switch. Ordinary Tcl bodies are never rewritten.
    set command [namespace which -command [codeQualified $name ::]]
    if {[dict get $resolved kind] eq "tcl" && $command ne {} && [catch {
        info args $command
    }]} {
        set optional false
        if {[dict exists $doc arg_list]} {
            foreach parameter [dict get $doc arg_list] {
                if {[llength $parameter]==1 && [regexp {^-[A-Za-z_][A-Za-z0-9_]*$} $parameter]} {
                    set optional true
                }
            }
        }
        if {$optional && ![catch {
            ::nx::Object info method body ::nsf::procs::$command
        } nativeBody]
            && $body eq "::nsf::__unset_unknown_args\n$nativeBody"} {
            set comparisonBody $nativeBody
            lappend normalizations nsf-unset-unknown-args-preamble
        }
    }
    return [dict create arguments [codeCanonicalArguments $args] body $body comparisonBody $comparisonBody normalizations $normalizations definitionSha256 [ns_crypto::md string -digest sha256 -- $definition]]
XQL Not present:
Generic, PostgreSQL, Oracle
[ hide source ] | [ make this the default ]
Show another procedure: