Menu

#2305 bad mode default in switch compiled version

obsolete: 8.5a0
closed-fixed
9
2003-04-28
2003-04-25
No

Compiled switch uses -glob mode by default, whereas
doc and Tcl_SwitchObjCmd use -exact mode.

---

proc test {} {
# this one is compiled
switch -- aa {
a* {puts "glob"}
aa {puts "exact"}
}
# not this
switch aa {
a* {puts "glob"}
aa {puts "exact"}
}
}

---

tclsh85 % test
glob
exact
tclsh85 %

See tclCompCmds.c 1.46, TclCompileSwitchCmd(), line
2905.

Discussion

  • Eric Boudaillier

    • priority: 5 --> 9
     
  • miguel sofer

    miguel sofer - 2003-04-25
    • assigned_to: msofer --> dkf
     
  • miguel sofer

    miguel sofer - 2003-04-25

    Logged In: YES
    user_id=148712

    assigning to Donal - I have not yet looked at this, and he
    probably still has it cached in short-term memory

     
  • Donal K. Fellows

    • milestone: --> obsolete: 8.5a0
     
  • Donal K. Fellows

    Logged In: YES
    user_id=79902

    Rats.

     
  • Donal K. Fellows

    • status: open --> closed-fixed