Talk:Scalar function

From APL Wiki
Revision as of 10:57, 11 September 2022 by Adám Brudzewsky (talk | contribs) (Text replacement - "</source>" to "</syntaxhighlight>")
(diff) ← Older revision | Latest revision (diff) | Newer revision → (diff)
Jump to navigation Jump to search

"Over" operator and pervasion

Several issues with this section:

  • Depth is the name used for the operator in documents I've seen, so it should link to Depth (operator) or Depth operator. It's definitely different from Over (like Reduce and Windowed Reduce are different), and the two would be difficult to disambiguate. The text is currently misleading, since it implies Dyalog 18.0, which has Over, would support this definition of perv.
Branfart or Freudian slip.
  • As far as I'm aware, no dialect implements Depth as used (J has "Level At", which has some similarities but doesn't work this way). It's okay to have speculative notes but this should be indicated.
I've added "works in". If I understand correctly, J's L: was recently redefined to work like this.
It doesn't work in dzaima/APL, either on tio or my local copy (a newer version). dzaima doesn't have Depth or right operand binding. J's Level At can make a function apply to simple arrays but not simple scalars, and I can't find any evidence of it being recently redefined (please don't put hearsay on the wiki!). Also J doesn't have pervasive scalar functions. The way to make a function act like a scalar function in J is just to apply it with rank 0. That's one reason it would make sense to move this to a different article on pervasion. --Marshall (talk) 08:05, 1 April 2020 (UTC)
I just tried the latest version of dzaima/APL, and while you're right that it doesn't support right operand binding, Depth works fine (it was added a month ago):
> NonScalarFn←{⍵:'t' ⋄ 'f'}
{⍵ : 't' ⋄ 'f'}
> (NonScalarFn⍥0) (0 1) 1 (⊂1 0)
┌──┬─┬───┐
│ff│f│⊂ff│
└──┴─┴───┘
Ah, so J needs "0 L:0 to behave like ⍥0 in APL.
Looks like dzaima only has monadic Depth. I was trying it with a dyadic function. I've added a note. --Marshall (talk) 09:03, 1 April 2020 (UTC)
  • The section is placed right at the top, before the very useful list of scalar functions. It's a more advanced topic, and less often used than the rest of the information (true, experienced APLers know which functions are scalar, but the APL wiki shouldn't assume that level of experience), in addition to being only tangentially related to the topic. It should be placed at the end of the article, and would probably make more sense in a dedicated page on pervasive application.
Moved down.
  • It only applies to nested APLs, and this isn't noted.
Added.