Page 1 of 1

Jot Operator

Posted: Sat Apr 10, 2021 6:32 pm
by KamakaniKing
I see the following in the tutorials: f←(32∘+)∘(×∘1.8) for Fahrenheit to Celsius conversion. It seems that f←(32∘+)(×∘1.8) [i.e., no Jot in the center] fits the documentation description for Jot. Any reason for the center Jot?

Re: Jot Operator

Posted: Sat Apr 10, 2021 10:33 pm
by petermsiegel
Not AFAIK. You can even leave out the parens:
      f←32∘+×∘1.8

Re: Jot Operator

Posted: Sun Apr 11, 2021 6:57 am
by Adam|Dyalog
Not sure which tutorial is being referred to. It may well be that it predates version 14.0 when trains were added to the language, and (32∘+)(×∘1.8) thus became valid.

Another reason could be that the example wants to show all three uses of ∘ as a dyadic operator.

You can even leave out the lefmost Jot:
      f←32+×∘1.8

Re: Jot Operator

Posted: Sun Apr 11, 2021 5:13 pm
by petermsiegel
Of course, this is the most fun:
      f←(1.8÷⍨¯32∘+)⍣¯1  ⍝ inverse of c←1.8÷⍨¯32∘+
f 20 30
68 86

Re: Jot Operator

Posted: Sun Apr 11, 2021 5:38 pm
by KamakaniKing
Thx Peter & Adam. The tutorial I was referring to was Mastering Dyalog APL by Bernard Legrand from 2009 - I know this is quite dated. That same function f←(32∘+)∘(×∘1.8) also shows up in the Dyalog Help version 18.0 as an example in several places, I think, such as for the Power Operator.

Adam - What is the 'third' use of dyadic jot exactly? I understand Bind {R}←A∘fY &
{R}←(f∘B)Y uses.

Re: Jot Operator

Posted: Sun Apr 11, 2021 7:03 pm
by Adam|Dyalog
The third use is Beside (formerly Compose): f∘g where both f and g are functions. Documentation.