diff options
author | Ronan Collobert <ronan@collobert.com> | 2013-02-25 17:56:08 +0400 |
---|---|---|
committer | Ronan Collobert <ronan@collobert.com> | 2013-02-25 17:56:08 +0400 |
commit | 327fed44afddcf80bbcd4525a3b6f8b563c21e53 (patch) | |
tree | 44d7554790a7836737b3d0eb0f0b88ab78acc5ff /README.md | |
parent | 95f2969d1ea9289dc3fb988068d1df6b6b1c78f6 (diff) |
more doc
Diffstat (limited to 'README.md')
-rw-r--r-- | README.md | 24 |
1 files changed, 24 insertions, 0 deletions
@@ -285,3 +285,27 @@ would raise an error if called with named arguments: ``` Note the subtile difference in the help display, where `{}` have been replaced by `()`. + +### Allowed types + +Argcheck "knows" the following types (specified with the `type` option of any argument): +* `number` +* `boolean` +* `string` +* `numbers` -- a vararg argument, which can take several numbers (see below) + +If no type is given, no type check will be done. E.g.: +```lua +> display = argcheck{debug=true, + {{name="value"}}, + function(value) + print(value) + end +} + +> display(5) +5 + +> display("hello world") +hello world +``` |