On 10/10/2020 23:21, William Michels via perl6-users wrote:
> So I guess the first question I have is whether the 'auto-joining' of
> array elements is specc'ed or not.
>
> What you seem to be saying is that when calling a function on an
> array, the first response is for Raku to call something similar to
> 'cat' on the array, then proceed to process the function call. As it
> is my understanding that Raku incorporates a lot of different
> programming paradigms (imperative, object-oriented, functional, etc.),
> I'm not sure where this behavior falls on the 'paradigm ladder'.

Hi Bill,

the auto-joining of an array is a property of the split method, or more
precisely, a result of split coming from Str.

Cool has many methods and is in many things.

You can call .split on Num or Rat, so 0.123451234512345.split("5") would
give you strings, because split stringifies first.

Conversely, .join is "a listy cool method" (i just made that up) so what
you call it on will be treated as if it were an array. "hello".join("X")
will pretend you passed ["hello"] and just result in "hello" again.

Trigonometric methods like sin, cos, tan, are all "numerical cool
methods" so the first thing they do is coerce to Numeric, that's why
"99".tan.say gives you roughly -25.1.

Please check out the table near the beginning of this documentation page:

    https://docs.raku.org/type/Cool

hope that makes things more clear
  - Timo

Reply via email to