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>2014-03-12 19:23:12 +0400
committerRonan Collobert <ronan@collobert.com>2014-03-12 19:23:12 +0400
commit5881261e4454ece74dfbaf10ff81a8dce90c0d76 (patch)
treeb537b53f8902d32a407243aac2e077a8ace4f85f /README.md
parentfdd669391c7a8d41a728522f82e11f66494e3894 (diff)
fix doc
Diffstat (limited to 'README.md')
-rw-r--r--README.md11
1 files changed, 9 insertions, 2 deletions
diff --git a/README.md b/README.md
index 18adfbc..bde7d97 100644
--- a/README.md
+++ b/README.md
@@ -34,7 +34,7 @@ luarocks install luabitop
```
* * *
-Introduction
+Documentation
------------
To use `argcheck`, you have to first `require` it:
@@ -46,6 +46,11 @@ Note that `argcheck` does not import anything globally, to avoid cluttering
the global namespace. The value returned by the require is a function: for
most usages, it will be the only thing you need.
+_Note that in the following examples we do not use local variables for
+check functions or example functions. This is bad practive, but helpful if
+you want to cut-and-paste the code in your interactive lua to see how
+this is running_
+
The `argcheck()` function creates a fast pre-compiled function for checking
arguments, according to rules provided by the user. Assume you have a
function which requires a unique number argument:
@@ -339,7 +344,7 @@ hello world
In some very special (rare) cases, one might want to disable named calls
like `addfive{x=1, msg='blah'}`, and stick to only ordered arguments like
-`addfive(1, 'blah'), or vice-versa. That might be to handle some ambiguous
+`addfive(1, 'blah')`, or vice-versa. That might be to handle some ambiguous
calls, e.g. when one has to deal with table arguments. The options
`nonamed` and `noordered` can be used for that purpose:
@@ -513,8 +518,10 @@ argcheck{
th> addfive(5)
5.000000 + 5 = 10.000000
+
th> addfive('hi')
hi .. 5 = hi5
+
th> addfive()
stdin:1: arguments:
{