Thanks for the lively discussion, much of which I could not follow, though,
owing to my ignorance about rank integration.

However, I understand that some sort of efficiency issue is involved.

BTW, I can answer one question that even Henry could not answer (for a
change): why beginners write things like +"0 and sin"0.

They (read "we") are confused by ranks, and the closest concept familiar to
them is that of dimension of domain. For instance, scalar addition is
different from vector addition. So +"0 is scalar addition, and +"1 is
vector addition. This habit is further encouraged by the apparently
inconsistent rank system of J, like *: having rank 0 while sin has rank
infinity. But both are functions from IR to IR. Not sure what is happening
internally, they prefer to explicitly "specify the domain."

Indeed, before this email thread, it never occurred to me that rank is
somehow linked with efficiency. I just considered a function's rank to be a
property  that is competely dictated by the math of the function.



On Sun, 17 Jan 2021, 06:46 Henry Rich, <[email protected]> wrote:

> I can't answer that, but I can assure you that they do.
>
> Henry Rich
>
> On 1/16/2021 7:38 PM, bill lam wrote:
> > I didn't mean to change stdlib sooner or later, but if we do it again,
> rank
> > 0 should be a better option.
> >
> > Why users (beginner or not) would write a+"0 b or sin"0 ?
> >
> >
> >
> > On Sun, Jan 17, 2021, 8:20 AM Henry Rich <[email protected]> wrote:
> >
> >> I would be happy for a user to do that, but changing stdlib might not be
> >> a good idea.  Beginning users often write
> >>
> >> a +"0 b
> >>
> >> and it doesn't cost them dearly.  If you make the change, sin"0 will be
> >> expensive.
> >>
> >> Henry Rich
> >>
> >> On 1/16/2021 7:17 PM, bill lam wrote:
> >>> Thanks. then defining sine as 1&o."0 should be fine.
> >>>
> >>> On Sun, Jan 17, 2021, 8:07 AM Henry Rich <[email protected]> wrote:
> >>>
> >>>> What makes them efficient is IRS.  1&o. supports IRS; 1&o."0 does not.
> >>>> Is you define sin as 1&o."0, sin will run fast, but sin"0 will not.
> >>>>
> >>>> Henry Rich
> >>>>
> >>>> On 1/16/2021 6:24 PM, bill lam wrote:
> >>>>> IIUC All atomic math functions are rank 0 but support IRS so that
> they
> >>>> are
> >>>>> as efficient as rank infinity on long array arguments.
> >>>>>
> >>>>> The question should be that
> >>>>> is 1&o."0 as efficient as 1&o. on long arrays.
> >>>>>
> >>>>> On Sun, Jan 17, 2021, 12:32 AM Henry Rich <[email protected]>
> >> wrote:
> >>>>>> Terminology.  If verb v has IRS, it can handle v"n internally
> without
> >> a
> >>>>>> rank loop.
> >>>>>>
> >>>>>> + has IRS.  +"n does not need a rank loop.
> >>>>>>
> >>>>>> +"n does not have IRS.  +"n"n2 does need a rank loop.
> >>>>>>
> >>>>>> +/@:*"1 has IRS, but +/@:* does not - that's how they're coded.
> >>>>>>
> >>>>>> 1&o."0 does not have IRS.
> >>>>>>
> >>>>>> Henry Rich
> >>>>>>
> >>>>>> On 1/16/2021 11:27 AM, bill lam wrote:
> >>>>>>> but the verb in this question is
> >>>>>>> (1&o.)"0
> >>>>>>>
> >>>>>>> even if 1&o. has IRS, does (1&o.)"0 also has IRS ?
> >>>>>>>
> >>>>>>>
> >>>>>>> On Sun, Jan 17, 2021, 12:02 AM Henry Rich <[email protected]>
> >>>> wrote:
> >>>>>>>> m&v does have IRS if v does.  I didn't know that until I just
> >> checked.
> >>>>>>>> Henry Rich
> >>>>>>>>
> >>>>>>>> On 1/16/2021 7:10 AM, bill lam wrote:
> >>>>>>>>> I'm not sure if 1&o."0 has IRS (integrated rank support) or not.
> If
> >>>> it
> >>>>>>>>> doesn't then I think the phase with infinity rank is fine.
> >>>>>>>>>
> >>>>>>>>>
> >>>>>>>>> On Sat, Jan 16, 2021, 7:02 PM Arnab Chakraborty <
> >> [email protected]>
> >>>>>>>> wrote:
> >>>>>>>>>> Dear all,
> >>>>>>>>>>
> >>>>>>>>>>         Just wondering if the correct defn of sin shouldn't be
> >>>>>>>>>>
> >>>>>>>>>> sin=:1&o."0
> >>>>>>>>>>
> >>>>>>>>>> instead of
> >>>>>>>>>>
> >>>>>>>>>> sin=:1&o.
> >>>>>>>>>>       which has rank infinity.
> >>>>>>>>>>
> >>>>>>>>>> With the rank infinity definition +/@sin behaves just like
> +/@:sin
> >>>>>>>>>>
> >>>>>>>>>> But, ideally, +/@sin 4 5 should be a list of two numbers, while
> >>>>>> +/@:sin
> >>>>>>>>>> should be their sum.
> >>>>>>>>>>
> >>>>>>>>>> Just like, +/@*: and +/@:*:
> >>>>>>>>>>
> >>>>>>>>>>
> >>>>>>>>>> Thanks and regards,
> >>>>>>>>>>
> >>>>>>>>>> Arnab
> >>>>>>>>>>
> >>>> ----------------------------------------------------------------------
> >>>>>>>>>> For information about J forums see
> >>>>>> http://www.jsoftware.com/forums.htm
> >>>> ----------------------------------------------------------------------
> >>>>>>>>> For information about J forums see
> >>>> http://www.jsoftware.com/forums.htm
> >>>>>>>> --
> >>>>>>>> This email has been checked for viruses by AVG.
> >>>>>>>> https://www.avg.com
> >>>>>>>>
> >>>>>>>>
> >> ----------------------------------------------------------------------
> >>>>>>>> For information about J forums see
> >>>> http://www.jsoftware.com/forums.htm
> >> ----------------------------------------------------------------------
> >>>>>>> For information about J forums see
> >> http://www.jsoftware.com/forums.htm
> >>>>>> --
> >>>>>> This email has been checked for viruses by AVG.
> >>>>>> https://www.avg.com
> >>>>>>
> >>>>>>
> ----------------------------------------------------------------------
> >>>>>> For information about J forums see
> >> http://www.jsoftware.com/forums.htm
> >>>>>
> ----------------------------------------------------------------------
> >>>>> For information about J forums see
> http://www.jsoftware.com/forums.htm
> >>>> --
> >>>> This email has been checked for viruses by AVG.
> >>>> https://www.avg.com
> >>>>
> >>>> ----------------------------------------------------------------------
> >>>> For information about J forums see
> http://www.jsoftware.com/forums.htm
> >>>>
> >>> ----------------------------------------------------------------------
> >>> For information about J forums see http://www.jsoftware.com/forums.htm
> >>
> >> --
> >> This email has been checked for viruses by AVG.
> >> https://www.avg.com
> >>
> >> ----------------------------------------------------------------------
> >> For information about J forums see http://www.jsoftware.com/forums.htm
> >>
> > ----------------------------------------------------------------------
> > For information about J forums see http://www.jsoftware.com/forums.htm
>
>
> --
> This email has been checked for viruses by AVG.
> https://www.avg.com
>
> ----------------------------------------------------------------------
> For information about J forums see http://www.jsoftware.com/forums.htm
>
----------------------------------------------------------------------
For information about J forums see http://www.jsoftware.com/forums.htm

Reply via email to