Skip to content
Tcl Source Code Ticket Change Details
Login

Ticket Change Details

Overview

Artifact ID: 987135153f38cd81a2ce0cd9f58147154b6f0f1d0087e72887a8fe55e2d59f6b
Ticket: c9ca7bca7e22925cddf02d74e39dd043a28bd167
import proc from namespace with other name
User & Date: pooryorick on 2021-05-04 12:59:01
Changes

  1. icomment:
    In the meantime, this can be trivially implemented as a script:
    
    <code><verbatim>
    proc import {link ns target} {
        set tmpns [info cmdcount]
        try {
            namespace eval $tmpns [list namespace import ${ns}::*]
            namespace eval $tmpns [list ::rename $target [
                uplevel 1 {namespace current}]::$link]
        } finally {
            namespace delete $tmpns
        }
        return
    }
    </verbatim></code>
    
    
    Granted, importing all exported names is not so efficient, but it skirts
    pattern-matching issues.
    
  2. login: "pooryorick"
  3. mimetype: "text/x-fossil-wiki"