contrary to expectations. The cure is to make revstring a void function, or a procedure in Pascal. Moral: discarding function results should be awkward.
I don' mind it being a bit awkward, but I dont see the need to further complicate the issue by adding dummy variables.
Adding a dummy variable in the variables section does not make the code:
dummy := revstring(thestring)) any clearer than nil := revstring(thestring)) or ThrowAwayResult( revstring(thestring)) )
Personally, I think the middle one is the clearest - it is clear that revstring is a function returning a value and clear that it is being discarded.
The first one is unclear in that the value might possibly be used later (and indeed some crazy graduate programmer might come along later and modify the code to use it without changing the name of the variable).
The last one is also unclear as to what, if anything, ThrowAwayResult actually does, whether a procedure really gets called or whatever - only reading documentation and looking at the assembly code would explain this.
Regardless, we live in a world with C programmers who return pointless errors because they can throw them away easily (and indeed clearly when using the (void) syntax), and it is a world we need to deal with. For example, what exactly are you to do if disposing an object returns an error? Or closing a readonly file returns an error. The most you could do would be put up an alert or an assertion, but even as mad keen on assertions as I am I can't image putting an assertion from every single case whether an almost useless function (eg one where the user would hardly or never detect whether it was called at all) might return an error. Peter.