On 2020-06-08 02:45, Richard Hainsworth wrote:
Ok Todd, let me have a go at this issue.

From what I understand, you see 'multi' and think 'there are more than one', which leads to the question 'where are they?'

My understanding of 'multi' is 'there COULD be more than one', which leads to the question 'are there any?'

This is actually a very powerful aspect of Raku.

There are (as has been stated in this thread) four types of which  multi = 'could be more than one' and only = 'only one' .

If the developer wrote 'only sub' then, no one else could write a sub with that name. For a developer of a program or a module, that might be OK, because it's unlikely anyone else would need/want to use that name. But for a compiler, the probability is reversed. Someone will want to use it. That is why in many other languages there are 'reserved words' which you are not allowed to use.

In Raku, if you develop a new type, for example say a quodion, and you want to 'add' quodions, then you CAN use + because it can be overloaded. It is defined as a multi.

Or in your most overused example 'needle' can be rewritten to take a quodion, which may yield a spectrum of results because that's what quodions are for.

Since needle is defined as a 'multi', if you write a 'needle' method for quodions, the needle for strings STILL exists, and Raku will correctly call the method you wrote for quodions if a quodion is implied, but call the default needle if a string (or any other type) is used.

Since you have developed the quodion method entirely for your paid subscribers, the module is NOT available to the public, so you wont tell anyone about it. So it doesn't have to be in the documentation.

Is this making any sense to you?

Richard


Hi Richard,

You are perfectly clear and beautifully well written.
You did make me look up "quodion".

:-)

And I am feeling guilty because I did already know all
this and it looks like you spent a considerable amount of
time getting into my head to formulate an answer that
was perfect for me.

Here is the thing.  I have no objecting to the developer
calling something a "multi" or an "only" depending on his
needs.  That is entirely "HIS" call, "NOT" mine.

And I hope the above statement ends all the well meaning,
helpful folks who are trying the re-explain the concept
to me.  I got it a LONG time ago.

My objection is when there actually exists more than
one and they are not experimental or otherwise hidden
for some reason and are truly, actually part of the
distribution, then they also should be documented.
Updates to the documentation should be part of
the code check in process, and in all probability, are.

So, basically what I am saying is when multiples are
there and are open to the public, than it should be
documented.  In this situation, why would the
developer want his hard work hidden?

I am still marveling at the skill and thoughtfulness
you put into your letter.  Wow!

Feeling guilty,
-T

Reply via email to