>      multi method kv ...

Use of `multi` means there *may* be more than one *declaration* using the
same declared routine name (`kv` in this case). There usually *will* be
more than one. (Otherwise, why was it declared `multi`?)

The normal way to *use* a routine is to call it.

If you declare multiple multis, then when you use (call) it, then the
arguments you pass to it determine which one of of the multis gets chosen.

So 42.kv would pick the `Any:D` variant because `42` is a defined value.

Also, it there was only one way to use the method, would it be written:
>
>      method kv(Any:  -->List)
>

It could be written any way you want.

But if you don't write `multi` then there's only one declaration.

And that means that when you call it, the arguments had better match that
one declaration or you'll get an error.

Note that you can also be explicit that there's only one by using the
declarator keyword `only`:

only method kv ...

--
raiph

Reply via email to