On Wed, Apr 16, 2003 at 04:15:01PM +0200, Martin Stjernholm, Roxen IS @ Pike developers forum wrote:
I used pointer(foo) only because it was the closest analogy to the current syntax.
which is why i like it too, though i'd suggest ref(foo) to avoid the negative stigma of "pointer".
if (sscanf (str, "%d %d %s", int a, int b, string rest) == 3) {
how is this more convenient than: int a, b; string rest; if (sscanf (str, "%d %d %s", a, b, rest) ...
it doesn't save much (if any) typing. it makes the code harder to read, because it is not abvious in which scope the variables are declared.
(side note: the same is true for declarations in for and foreach, but there it would at least theoretically possible to restrict the scope of the declaration to the inside of the blocks that for and foreach execute.)
greetings, martin.