Talk:Scalar function: Difference between revisions
Jump to navigation
Jump to search
m (Text replacement - "</source>" to "</syntaxhighlight>") |
|||
(One intermediate revision by the same user not shown) | |||
Line 2: | Line 2: | ||
Several issues with this section: | 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 < | * 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 <syntaxhighlight lang=apl inline>perv</syntaxhighlight>. | ||
::Branfart or Freudian slip. | ::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. | * 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. | ||
Line 8: | Line 8: | ||
:::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 [https://code.jsoftware.com/wiki/Vocabulary/lcapco 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. --[[User:Marshall|Marshall]] ([[User talk:Marshall|talk]]) 08:05, 1 April 2020 (UTC) | :::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 [https://code.jsoftware.com/wiki/Vocabulary/lcapco 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. --[[User:Marshall|Marshall]] ([[User talk: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): | ::::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): | ||
::::< | ::::<syntaxhighlight lang=apl>> NonScalarFn←{⍵:'t' ⋄ 'f'} | ||
{⍵ : 't' ⋄ 'f'} | {⍵ : 't' ⋄ 'f'} | ||
> (NonScalarFn⍥0) (0 1) 1 (⊂1 0) | > (NonScalarFn⍥0) (0 1) 1 (⊂1 0) | ||
┌──┬─┬───┐ | ┌──┬─┬───┐ | ||
│ff│f│⊂ff│ | │ff│f│⊂ff│ | ||
└──┴─┴───┘</ | └──┴─┴───┘</syntaxhighlight>Ah, so J needs <syntaxhighlight lang=j inline>"0 L:0</syntaxhighlight> to behave like <syntaxhighlight lang=apl inline>⍥0</syntaxhighlight> in APL. | ||
:::::Looks like dzaima only has monadic Depth. I was trying it with a dyadic function. I've added a note. --[[User:Marshall|Marshall]] ([[User talk:Marshall|talk]]) 09:03, 1 April 2020 (UTC) | :::::Looks like dzaima only has monadic Depth. I was trying it with a dyadic function. I've added a note. --[[User:Marshall|Marshall]] ([[User talk: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. | * 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. |
Latest revision as of 10:57, 11 September 2022
"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.
- 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've added "works in". If I understand correctly, J's L: was recently redefined to work like this.
- 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.