obfuscated way to get "0" in a tcl function, cross platform?

178 views Asked by At

I haven't used tcl before and just need to do one trick, I can do it trivially in something like bash but I need it to work cross-platform (e.g. tcl in cygwin on windows).

Can someone suggest a short (5-10) obfuscated function that just returns 0 after taking two string args? It just can't do something like run shell commands that won't work under Mac/Cygwin.

fwiw, why do this: buying some time in writing a test- the thing generating one of the files is broken but I can't change it, making a hack in the TCL test script until I make extensive changes to use a different 'test core' that isn't broken. For now just declare the first file as 'good' if it exists.

1

There are 1 answers

3
Donal Fellows On BEST ANSWER

I don't understand the requirement for obfuscation, but the simplest way to create a command that takes two arguments and returns 0 is this:

proc theCommandName {firstArgument secondArgument} {
    return 0
}

There are all sorts of ways of making things obscure (e.g., a regular expression that doesn't actually match anything, a complicated expression) but as I said before, I don't understand the requirement in that area; I always try to make my code be the simplest thing that could possibly work…