[Date Prev][Date Next][Thread Prev][Thread Next]
[Date Index]
[Thread Index]
- Subject: Re: os.time() modifies the argument
- From: Francisco Olarte <folarte@...>
- Date: Sun, 29 Jan 2017 19:00:15 +0100
Hello all..
On Sun, Jan 29, 2017 at 2:44 PM, Roberto Ierusalimschy
<roberto@inf.puc-rio.br> wrote:
> The parameter to 'os.time' is what is called an "in-out" parameter. It
> follows the behavior of the corresponding C function, 'mktime':
>
> The mktime() function modifies the fields of the tm structure as fol‐
> lows: tm_wday and tm_yday are set to values determined from the con‐
...
> The normalization property seems specially useful.
I refrained from answering when first seeing this. Bu I would like to
state that although I fully agree on the usefulness of the
normalization property I normally expect that functions modifying
parameters which seem to be input only, like mktime() or os.time(),
should state it clearly, and after re-reading twice the 3 paragraphs I
haven't find any hint of it. This could easily lead to hard to trace
bugs and I think deserves a fourth paragraph stating it.
Francisco Olarte.