Welcome to mirror list, hosted at ThFree Co, Russian Federation.

github.com/torch/argcheck.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorRonan Collobert <ronan@collobert.com>2013-02-25 17:56:08 +0400
committerRonan Collobert <ronan@collobert.com>2013-02-25 17:56:08 +0400
commit327fed44afddcf80bbcd4525a3b6f8b563c21e53 (patch)
tree44d7554790a7836737b3d0eb0f0b88ab78acc5ff /README.md
parent95f2969d1ea9289dc3fb988068d1df6b6b1c78f6 (diff)
more doc
Diffstat (limited to 'README.md')
-rw-r--r--README.md24
1 files changed, 24 insertions, 0 deletions
diff --git a/README.md b/README.md
index 4433a6b..2bb60fd 100644
--- a/README.md
+++ b/README.md
@@ -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
+```