Skip to content
This repository was archived by the owner on Nov 20, 2020. It is now read-only.

Conversation

@cyisfor
Copy link

@cyisfor cyisfor commented Oct 26, 2014

afaik the only way you can be sure you have a function's arguments is to
use the {...} construct. They say "arg" works, but it sort of doesn't.
In this case, calling date() with any arguments, results in an arg
variable being created (for some reason) as a table with 0 arguments.
{...} of course has the proper arguments, so I guess arg is just left in
there to break everything.

For instance, date('2014-10-24 21:56:42.095-07') gives the same result
as calling date() and never actually produces a date on the 24th of
October (unless that's the current date). It might just be luajit, but
it's probably safer to use {...} in any case.

Easy enough to explicitly specify that arg should be {...}.

afaik the only way you can be sure you have a function's arguments is to
use the {...} construct. They say "arg" works, but it sort of doesn't.
In this case, calling date() with any arguments, results in an arg
variable being created (for some reason) as a table with 0 arguments.
{...} of course has the proper arguments, so I guess arg is just left in
there to break everything.

For instance, date('2014-10-24 21:56:42.095-07') gives the same result
as calling date() and never actually produces a date on the 24th of
October (unless that's the current date). It might just be luajit, but
it's probably safer to use {...} in any case.

Easy enough to explicitly specify that arg should be {...}.
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant