Jot Operator

Learning APL or new to Dyalog? Ask "silly" questions here, without fear...

Jot Operator

Postby KamakaniKing on Sat Apr 10, 2021 6:32 pm

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?
KamakaniKing
 
Posts: 14
Joined: Thu Mar 25, 2021 8:06 pm

Re: Jot Operator

Postby petermsiegel on Sat Apr 10, 2021 10:33 pm

Not AFAIK. You can even leave out the parens:
      f←32∘+×∘1.8
petermsiegel
 
Posts: 141
Joined: Thu Nov 11, 2010 11:04 pm

Re: Jot Operator

Postby Adam|Dyalog on Sun Apr 11, 2021 6:57 am

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
User avatar
Adam|Dyalog
 
Posts: 135
Joined: Thu Jun 25, 2015 1:13 pm

Re: Jot Operator

Postby petermsiegel on Sun Apr 11, 2021 5:13 pm

Of course, this is the most fun:
      f←(1.8÷⍨¯32∘+)⍣¯1  ⍝ inverse of c←1.8÷⍨¯32∘+
f 20 30
68 86
petermsiegel
 
Posts: 141
Joined: Thu Nov 11, 2010 11:04 pm

Re: Jot Operator

Postby KamakaniKing on Sun Apr 11, 2021 5:38 pm

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.
KamakaniKing
 
Posts: 14
Joined: Thu Mar 25, 2021 8:06 pm

Re: Jot Operator

Postby Adam|Dyalog on Sun Apr 11, 2021 7:03 pm

The third use is Beside (formerly Compose): f∘g where both f and g are functions. Documentation.
User avatar
Adam|Dyalog
 
Posts: 135
Joined: Thu Jun 25, 2015 1:13 pm


Return to New to Dyalog?

Who is online

Users browsing this forum: No registered users and 1 guest