Latest LQ Deal: Linux Power User Bundle
Go Back > Forums > Non-*NIX Forums > Programming
User Name
Programming This forum is for all programming questions.
The question does not have to be directly related to Linux and any language is fair game.


  Search this Thread
Old 04-01-2018, 09:06 AM   #1
LQ Guru
Registered: Oct 2003
Location: Bonaire, Leeuwarden
Distribution: Debian /Jessie/Stretch/Sid, Linux Mint DE
Posts: 5,187

Rep: Reputation: 1037Reputation: 1037Reputation: 1037Reputation: 1037Reputation: 1037Reputation: 1037Reputation: 1037Reputation: 1037
TCL - signal command overloaded by Tclx, namespace clash?

In some code I have used the signal command. This is from the package Signal. Which works very well, but I believe it is difficult to find and hardly used.

Anyway, I have some code using this signal command. While reusing old code and having the need of including Tclx the signal command cannot be used anymore.

I believe it is overloaded by the signal command from the Tclx package, which has a different syntax:
% package require Signal
% signal add SIGHUP {exit}
% package require Tclx
% signal add SIGHUP {exit}
command may not be specified for "add" action
The problem is of course that the old code is tested and for the Tclx signal function I'd have to rewrite parts.

This looks like a namespace clash. Unfortunately the signal function from Signal does not seem to have its own namespace.
% package require Signal
% signal add SIGHUP {exit}
% namespace origin signal
I would have expected to be able to use Signal::signal to call the right function.

Is this a limitation in Tcl? As in Tcl does not support namespaces like Python does?

Is there a solution?



Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off

Similar Threads
Thread Thread Starter Forum Replies Last Post
Problem with executing a hell command from tcl Jykke Programming 1 04-25-2014 10:56 AM
ping command not working in tcl/tk? Passions Programming 2 02-17-2010 06:24 PM
tcl 'signal' or 'event' help (not sure what its called) zidane_tribal Programming 0 03-30-2006 01:30 PM
Tcl/Tk Bracket Problems in Command Kenji Miyamoto Programming 0 06-27-2005 12:29 AM
Tcl/Tk - command < entry > question. liguorir Linux - Software 0 05-06-2004 11:36 PM > Forums > Non-*NIX Forums > Programming

All times are GMT -5. The time now is 01:15 AM.

Main Menu
Write for LQ is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Facebook: linuxquestions Google+: linuxquestions
Open Source Consulting | Domain Registration