From octave-maintainers-request at bevo dot che dot wisc dot edu Fri Jan 10 16:15:36 2003 Subject: Re: variable(s) for signal numbers? From: Andy Adler To: "John W. Eaton" cc: octave-maintainers mailing list Date: Fri, 10 Jan 2003 17:15:32 -0500 (EST) I think that the second form would be fine. Everyone who wants to use kill should be doing "help kill" first anyway. Additionally, you then would have the semantics to pull some 'perl'ish tricks and define virtual signals. I'm refering to $SIG{__WARN__} and $SIG{__DIE__}, which refer to code doing the corresponding things. Andy On Fri, 10 Jan 2003, John W. Eaton wrote: > I just implemented a kill function for Octave so you can send signals > to other processes (for example, those you started asynchronously with > system, or a fork/exec). Now I see that it would be useful to have a > way to access signals by name instead of number, so that you could > write > > kill (pid, SIGHUP); > > instead of > > kill (pid, 1); > > for example. The problem with using names like SIGHUP, SIGINT, > etc. is that it adds a lot of built-in variables. Perhaps it would be > better to have a structure, say __siglist__ (or something, suggestions > for a better name are welcome), that has members like HUP, INT, etc, > so you would write > > kill (pid, __siglist__.HUP); > > Then we only add one name to the list of built-in variables instead of > many. > > OTOH, to someone used to programming Unixy systems, this doesn't look > as familiar as using SIGHUP. > > Comments? > > Thanks, > > jwe > >