Posted to tcl by aspect at Tue Apr 05 06:50:43 GMT 2016view raw
- set it [interp create]
- $it eval {
- namespace eval ToUpper {
- proc initialize {x mode} { info procs }
- proc finalize {x} { }
- proc write {x data} { string toupper $data }
- proc flush {x} { }
- namespace export *
- namespace ensemble create
- }
- chan push stdout ToUpper
- puts "hello from interp" ;# HELLO FROM INTERP - as expected
- }
- puts "hello from main" ;# HELLO FROM MAIN - hmm .. insufficiently documented?
- interp cancel $it
- puts "hello at end" ;# eval canceled while executing "ToUpper write rt0 {hello at end\n}"
- ;# missing [chan pop] - or other bugs in slave interps' transchans - can affect master interp :-(