Re: Repeated *parameters*?

From
Richard Quadling <>
Date
2008-07-18T13:16:02+00:00
ID
Thread
Re: Repeated *parameters*?
2008/7/18 Norman Walsh <>:

/ "Richard Quadling" <> was heard to say:

| 2008/7/18 Norman Walsh <>:

|

|> I just noticed that methodparam has @rep. Does this make any sense, or

|> is it an editorial accident? I can't think of any languages for which

|> it makes sense.

|

| req (required) or rep (repeat).

|

| Many languages allow a variable number of arguments. If the argument type is

| generic, then rep="repeat" would be a valid way to represent that.

I suppose. Funcsynopsis has varargs for this though. I guess

methodsynopsis doesn't have anything similar. Maybe it's ok, it just

struck me as weird. What would it mean to say

 <methodsynopsis>

   <methodname>foo</>

   <methodparam>

      <parameter>param1</>

   </methodparam>

   <methodparam rep="repeat">

      <parameter>param2</>

   </methodparam>

   <methodparam>

      <parameter>param3</>

   </methodparam>

  ...

                                        Be seeing you,

                                          norm

--

Norman Walsh <> | In the life of saints, technically so

http://nwalsh.com/            | called, the spiritual facilities are

                              | strong, but what gives the impression

                              | of extravagance proves usually on

                              | examination to be a relative deficiency

                              | of intellect.--William James

There are several PHP functions dealing with processing arrays.

A few of them take at least 1 array and a callback. The callback is the last parameter, so...

array array_uintersect(array array1, array array2 [, array ...], callback data_compare_func)

is the expected output.

I'm not too sure if the second param is repeatable (to me repeatable implies optional otherwise how many times must it be repeated) or is the third parameter optional but also repeatable?

I'm sure there's a difference!

-- 
-----
Richard Quadling
Zend Certified Engineer : http://zend.com/zce.php?c=ZEND002498&r=213474731

"Standing on the shoulders of some very clever giants!"