summaryrefslogtreecommitdiff
path: root/README.EXT
diff options
context:
space:
mode:
Diffstat (limited to 'README.EXT')
-rw-r--r--README.EXT27
1 files changed, 18 insertions, 9 deletions
diff --git a/README.EXT b/README.EXT
index 6364ab7a80..f1504021ba 100644
--- a/README.EXT
+++ b/README.EXT
@@ -690,18 +690,27 @@ pre-arg-spec := num-of-leading-mandatory-args [num-of-optional-args]
post-arg-spec := sym-for-variable-length-args [num-of-trailing-mandatory-args]
block-arg-spec := sym-for-block-arg
-num-of-leading-mandatory-args := DIGIT ; -- the number of the leading mandatory arguments
-num-of-optional-args := DIGIT ; -- the number of the following optional arguments
-sym-for-variable-length-args := "*" ; -- indicates that the following variable length
- ; arguments are captured as a Ruby array
-num-of-trailing-mandatory-args := DIGIT ; -- the number of the trailing mandatory arguments
-sym-for-block-arg := "&" ; -- indicates that the iterator block should be
- ; captured if given
+num-of-leading-mandatory-args := DIGIT ; The number of leading
+ ; mandatory arguments
+num-of-optional-args := DIGIT ; The number of optional
+ ; arguments
+sym-for-variable-length-args := "*" ; Indicates that variable
+ ; length arguments are
+ ; captured as a ruby array
+num-of-trailing-mandatory-args := DIGIT ; The number of trailing
+ ; mandatory arguments
+sym-for-block-arg := "&" ; Indicates that an iterator
+ ; block should be captured if
+ ; given
--
For example, "11" means that the method requires at least one
-argument, and at most receives two arguments. For omitted arguments,
-variables are set to Qnil.
+argument, and at most receives two (1+1) arguments. So, the format
+string must be followed by two variable references, which are to be
+set to captured arguments. For omitted arguments, variables are set
+to Qnil. NULL can be put in place of a variable reference, which
+means the corresponding captured argument(s) does not need to be set.
+
Methods with an arbitrary number of arguments can receive arguments
by Ruby's array, like this: