As for a performance, both are identical in Tcl 8.6, but as for a style, *return...* seems to be better.
Also, *return* makes a code a bit more self-documented, as if saying:
look, this procedure can be used in expressions.
And *return* (as well as *proc* and *method*) command is highlighted by
some editors, so that a code with *proc* + *return* is framed with them, which make the code more viewable.
At last, if a procedure returns values in several places, the last
command must be *return*. It's an insurance against possible mistakes
and a matter of good taste.
| Sysop: | Keyop |
|---|---|
| Location: | Huddersfield, West Yorkshire, UK |
| Users: | 715 |
| Nodes: | 16 (0 / 16) |
| Uptime: | 165:46:04 |
| Calls: | 12,096 |
| Calls today: | 4 |
| Files: | 15,001 |
| Messages: | 6,517,807 |