Skip to content
Tcl Source Code Ticket Change Details
Login

Ticket Change Details

Overview

Artifact ID: 2b9746e8d48ee3f9fb4eaac882b385ca33af42e7
Ticket: d87cb182053fd79b3fc16054526620f2dfb25d96
inconsisency in behaviour of tailcall from (builtin) namespace ensembles
User & Date: anonymous on 2015-03-19 01:56:51
Changes

  1. assignee changed to: "nobody"
  2. closer changed to: "nobody"
  3. cmimetype changed to: "text/plain"
  4. comment changed to:
    Using [tailcall] from a proc in a namespace ensemble's -map used to work as expected on 8.6.0.  On 8.6.1 and later, something changed:
    
    
    # tailcall and uplevel identity:
    proc it {} {
        tailcall try {
            puts it:[::incr x]
        }
    }
    proc iu {} {
        uplevel 1 {
            puts iu:[::incr x]
        }
    }
    
    proc aa {} {
        it
        iu
        return $x
    }
    
    puts aa:[aa]        ;# it:1 iu:2 aa:2 - as expected
    
    
    # now try in an ensemble:
    namespace eval ens {
        namespace ensemble create
    }
    namespace ensemble configure ens -map {threet threet threeu threeu}
    
    proc ab {} {
        it
        iu
        return $x
    }
    
    puts ab:[ab]        ;# it:1 iu:2 ab:2 - as expected
    
    
    # now try with an existing ensemble:
    set map [namespace ensemble configure dict -map]
    dict set map it ::it
    dict set map iu ::iu
    namespace ensemble configure dict -map $map
    
    proc ac {} {
        dict it
        dict iu
        return $x
    }
    
    puts ac:[ac]        ;# iu:1 it:2 ac:  - not at all as expected!
    
  5. foundin changed to: "8.6.1 and later"
  6. is_private changed to: "0"
  7. login: "anonymous"
  8. priority changed to: "5 Medium"
  9. private_contact changed to: "cb02a4a25e8da92f2790bc307bf01ef24ce6053e"
  10. resolution changed to: "None"
  11. severity changed to: "Minor"
  12. status changed to: "Open"
  13. submitter changed to: "anonymous"
  14. subsystem changed to: "21. [namespace]"
  15. title changed to:
    inconsisency in behaviour of tailcall from (builtin) namespace ensembles
    
  16. type changed to: "Bug"