## j.

APL-related discussions - a stream of APL consciousness.
Not sure where to start a discussion ? Here's the place to be
Forum rules
This forum is for discussing APL-related issues. If you think that the subject is off-topic, then the Chat forum is probably a better place for your thoughts !

### j.

From [Hui and Kromberg 2020]:
For example, the dialect J has the scalar function j. defined by {⍺←0 ⋄ ⍺+⍵×0j1}¨; that is, a scalar function whose monadic definition is ⍵×0j1 and whose dyadic definition is ⍺+⍵×0j1. (The APL numeric constant ajb is a+b×√−1 or a+ib in conventional mathematical notation.) If complex numbers are in the language, would you specify this as a primitive? A possible answer [Hui 2016c, §8]:
Complex numbers can be constructed as ordered pairs of real numbers, similar to how integers can be constructed as ordered pairs of natural numbers and rational numbers as ordered pairs of integers. For complex numbers, j. plays the same role as - for integers and ÷ for rational numbers.

We don’t know that this is the answer; Iverson designed the primitive and it was implemented without further discussion. We should have asked him about it.

It's not everyday you come across a function whose peers are - and ÷. An example of using this function:

`      j←{⍺←0 ⋄ ⍺+⍵×0j1}¨      sin←1∘○      cos←2∘○      (*∘j = cos j sin) j⌿?2 3 5⍴0    ⍝ Euler's formula1 1 1 1 11 1 1 1 11 1 1 1 1`

Exercise: If you were to design a Unicode symbol for j., what would you use? Unicode has 2*21 codepoints, and if you are going to use a new glyph the number of possibilities is virtually unlimited. So how hard can it be?
Roger|Dyalog

Posts: 238
Joined: Thu Jul 28, 2011 10:53 am

### Re: j.

I would not introduce a new symbol but use an existing code point:

U+0248
Ɉ
Latin Capital Letter J with stroke

I feel this would be in the original spirit of APL glyphs, and could be achieved with an APL Typeball. A simple J overstocked with minus sign.
Ray Cannon
Please excuse any smelling pisstakes.

ray

Posts: 192
Joined: Wed Feb 24, 2010 12:24 am
Location: Blackwater, Camberley. UK

### Re: j.

Getting symbols added to Unicode is difficult, so I would also go for an existing symbol. However, I would not go for a letter that mighte be used in someones alphabet, but look out for little-used mathematical symbols, like:

https://codepoints.net/U+2214 ("dotplus", or + overstruck with i?)

Morten|Dyalog

Posts: 426
Joined: Tue Sep 09, 2008 3:52 pm

### Re: j.

U+2214 looks not bad, and does come from the right pages (U+22xx and U+23xx) for APL.

I have also looked at U+27C0, officially labelled as "3 dimensional angle". Its use for 0j1×⍵ and ⍺+0j1×⍵ is motivated by geometric considerations; see the Wikipedia pages for complex numbers (esp. this diagram) and for Argand diagram. I am of course totally ignoring the practical difficulties (if any :-) of adding the symbol to fonts, entering it on keyboards, etc.

A symbol for the function doesn't need to emphasize the "imaginary" aspect (either i or j), perhaps even to avoid it. From [Hui and Kromberg 2020], quoting C.F. Gauss from 1831:
If one formerly contemplated [imaginary numbers] from a false point of view and therefore found a mysterious darkness, this is in large part attributable to clumsy terminology. Had one not called +1, −1, √−1 positive, negative, or imaginary (or even impossible) units, but instead, say, direct, inverse, or lateral units, then there could scarcely have been talk of such darkness.
—— C.F. Gauss [Gauss 1831, p.638], translated in [Ewald 1996, p.313]
Roger|Dyalog

Posts: 238
Joined: Thu Jul 28, 2011 10:53 am

### Re: j.

I was looking for a suitable angle symbol (rectangular angle, arrowhead pointing to the left), but found none, perhaps https://codepoints.net/U+2BA2 or https://codepoints.net/U+27F2 (anticlockwise gapped circle arrow)?
(the name itself is hilarious)

What about https://codepoints.net/U+2A02 (n-ary circled times) or https://codepoints.net/U+2A30 (multiplication sign with dot above)?

-Veli-Matti
Veli-Matti

Posts: 80
Joined: Sat Nov 28, 2009 3:12 pm

### Re: j.

When new APL symbols are contemplated, there are various considerations.

• Is the functionality to be denoted worth having a symbol?
• Do you want to use an existing glyph, or create a new one?
• Can you easily write/draw the glyph on paper, on a white (black) board, etc.? Can you easily distinguish it from other scrawls?
• Entering the symbol on a keyboard.
• Adding the glyph to various fonts.
• Creating a <strike>catchy</strike> mnemonic name for it.
• In mathematics, symbols like + and × are heavily overloaded with the meaning disambiguated from context. I am not sure that it would be a good idea to use up + (×) overstruck with . for the function {⍺←0 ⋄ ⍺+0j1×⍵}, because why is this function more worthwhile than other kinds of plus or times?
• etc.
Roger|Dyalog

Posts: 238
Joined: Thu Jul 28, 2011 10:53 am

### Re: j.

My experimental Extended Dyalog APL uses ⌾ U+233E APL FUNCTIONAL SYMBOL CIRCLE JOT because I see it as a type of composition (∘) of numbers in the circular (○) domain. Try it online!