From: Donald G P. <don...@ni...> - 2013-08-08 12:27:39
|
>> Requiring the command to exist means raising an error when passed a >> value that is not an existing command name. An alternative to consider >> (that I think I would like better) is to return the value "unknown" in >> that case. Have this be a command that never raises an error, but >> always returns a value describing what it knows (or doesn't) about the >> argument. > That is technically possible, but distasteful to me. If a thing is not a > command, it's not a command and we can give a clear indication that it > is not. I submit that returning "unknown" when the command name does not resolve to an existing command is equally clear, and easier to use. The usability issue is similar to that for [package present]. Surely you would not make that mistake again? -- | Don Porter Applied and Computational Mathematics Division | | don...@ni... Information Technology Laboratory | | http://math.nist.gov/~DPorter/ NIST | |______________________________________________________________________| |