----boundary-LibPST-iamunique-632581116_-_-
Content-type: text/plain
A function that returns a value that is allowed to be ignored is a "bad" function.
So there is little advantage in optimizing a program or a compiler towards that.
And if you were to optimize such a thing, take into consideration that an additional condition (to check whether or not the value is used) could cost as much as or more than what you intend to save.
Regards
Marco
Oleg N. Cher wrote:
Hello, Wojtek,
Thank you for your answer.
I'm an old programmer. And I know that we cannot assign
a result to a constant :-) But will be good
if there was a method to call procedures returning a result,
without the use of superfluous variables.
For example, in the system programming, for the increase
of efficiency. And such method of calling:
NIL := WinApi.SetConsoleOutputCP(cp)
or
SYSTEM.NIL := WinApi.SetConsoleOutputCP(cp)
or
SYSTEM.VOID(WinApi.SetConsoleOutputCP(cp))
can be a variant of realization of such possibility.
And I asked: is there such method in BlackBox?
P.S. Cordially I thank you for your book
"BlackBox Component Builder For Scientists and Engineers",
Very good book.
You need to assign a return value to a variable, even if you
do not use the result.
Oleg N. Cher,
Colossoft Research.
allot{([at]})nowhere.xy
2007-08-14
--- BlackBox
--- send subject HELP or UNSUBSCRIBE to blackbox{([at]})nowhere.xy
----boundary-LibPST-iamunique-632581116_-_-
Content-type: application/rtf
Content-transfer-encoding: base64
Content-Disposition: attachment; filename="rtf-body.rtf"
e1xydGYxXGFuc2lcYW5zaWNwZzEyNTFcZnJvbWh0bWwxIFxkZWZmMHtcZm9udHRibA0Ke1xmMFxm
c3dpc3MgQXJpYWw7fQ0Ke1xmMVxmbW9kZXJuIENvdXJpZXIgTmV3O30NCntcZjJcZm5pbFxmY2hh
cnNldDIgU3ltYm9sO30NCntcZjNcZm1vZGVyblxmY2hhcnNldDAgQ291cmllciBOZXc7fX0NCntc
Y29sb3J0YmxccmVkMFxncmVlbjBcYmx1ZTA7XHJlZDBcZ3JlZW4wXGJsdWUyNTU7fQ0KXHVjMVxw
YXJkXHBsYWluXGRlZnRhYjM2MCBcZjBcZnMyNCANCntcKlxodG1sdGFnMjQzIDwhRE9DVFlQRSBo
dG1sIFBVQkxJQyAiLS8vVzNDLy9EV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