0

Is there any way to rename itcl::ensemble? If not can be replace itcl::ensemble with some other ensemble without any side effect?

Thanks

SaurabhS
  • 633
  • 1
  • 7
  • 18
  • Do you mean rename the itcl::ensemble command itself of rename an ensemble that has been created using it? It might help someone answer if you could give some idea as to what you are actually trying to acheive and why you think you need to rename something. – Jackson Jul 16 '15 at 09:25
  • Ok. I have created an itcl::ensemble check { part me {} { puts "check me called" } } So it will create a command check me Now i want to rename this command to newCheck me like i can do with proc. – SaurabhS Jul 16 '15 at 09:33

2 Answers2

1

It looks to me as if rename just works for ensembles:

% package require Itcl
4.0.3
% itcl::ensemble check { part me {} { puts "check me called" } }
% check me
check me called
% rename check myCheck
% myCheck me
check me called
% check me
invalid command name "check"
%
Jackson
  • 5,627
  • 2
  • 29
  • 48
1

They should work just fine if renamed (the implementation of the ensemble will only be using the name for error reporting) but there might be code that expects a command with the original name to be present. Exactly as normal when using rename in Tcl, in fact.

Donal Fellows
  • 133,037
  • 18
  • 149
  • 215