Atomic vector: Difference between revisions

Jump to navigation Jump to search
2,262 bytes added ,  15:39, 7 July 2020
No edit summary
(8 intermediate revisions by the same user not shown)
Line 1: Line 1:
'''Atomic vector''' (<source lang=apl inline>⎕AV</source>) contains 256 characters. This was the entire character set in some of the older interpreters that did not support [[Unicode]].
{{Built-in|Atomic vector|⎕AV}} is the name of a 256-[[character]] [[vector]] which containes the entire character set of older APL implementations that did not support [[Unicode]], but instead used a single byte to store each character. Its value varies wildly between dialects, and can even differ between editions of the same dialect.


In [[Dyalog APL]]:
== Value ==
<source lang=apl>
In the following, display of the the character sets are obtained using <source lang=apl inline>16 16⍴mask\(mask←32≤⎕UCS ⎕AV)/⎕AV</source> to replace control characters with spaces.
      6 41⍴10↓⎕AV
=== APL2 ===
⌶ɫ%'⍺⍵_abcdefghijklmnopqrstuvwxyz��¯.⍬012
[[APL2]] uses two primary values of <source lang=apl inline>⎕AV</source>, an [[wikipedia:ASCII|ASCII]]-based value on [[wikipedia:|personal computer]]s, and an [[wikipedia:EBCDIC|EBCDIC]]-based value on [[wikipedia:mainframe|mainframe]]s. The ASCII-based value is:
3456789�⊢¥$£¢∆ABCDEFGHIJKLMNOPQRSTUVWXYZ�
<pre>
�ý·⍙ÁÂÃÇÈÊËÌÍÎÏÐÒÓÔÕÙÚÛÝþãìðòõ{€}⊣⌷¨ÀÄÅÆ
               
⍨ÉÑÖØÜßàáâäåæçèéêëíîïñ[/⌿\⍀<=>≠∨∧-+÷×?
               
⍴~↑↓⍳○*⌈⌊∇∘(⊂⊃∩∪⊥⊤|;,⍱⍲⍒⍋⍉⌽⊖⍟⌹!⍕⍎⍫⍪≡≢óôöø
!"#$%&'()*+,-./
"#�&´┘┐┌└┼─├┤┴┬│@ùúû^ü`∣¶:⍷¿¡⋄←→⍝)]� §⎕⍞⍣
0123456789:;<=>?
</source>
@ABCDEFGHIJKLMNO
PQRSTUVWXYZ[\]^_
`abcdefghijklmno
pqrstuvwxyz{|}~
ÇüéâäàåçêëèïîìÄÅ
⎕⍞⌹ôöòûù⊤ÖÜø£⊥₧⌶
áíóúñѪº¿⌈¬½∪¡⍕⍎
░▒▓│┤⍟∆∇→╣║╗╝←⌊┐
└┴┬├─┼↑↓╚╔╩╦╠═╬≡
⍸⍷∵⌷⍂⌻⊢⊣⋄┘┌█▄¦Ì▀
⍺ß⊂⊃⍝⍲⍴⍱⌽⊖○∨⍳⍉∊∩
⌿⍀≥≤≠×÷⍙∘⍵⍫⍋⍒¯¨ 
</pre>


In [[GNU APL]]:
=== APLX ===
<source lang=apl>
In order to maximise the probability of being able to represent the text when converting from Unicode to internal representation, [[APLX]] accepts as input a number of alternative Unicode values for certain characters. However, these are automatically mapped to normalised character, and any unmappable characters are replaced with a question mark.
       5 45⍴31↓⎕AV
<pre>
  !"#$%&'()*+,-./0123456789:;<=>?@ABCDEFGHIJK
       ⍐ ⍗ ⍇⍈ ⍱⍲
LMNOPQRSTUVWXYZ[\]^_`abcdefghijklmnopqrstuvwx
⍒⍋⌽⍉⊖⍟⌶⍫⍎⍕⍀⌿⍝⍞!⌹
yz{|}~¥€⇄∧∼≬⋆⋸⌸⌺⌼μ⍁¡⍣⍅⎕⍞⌹⍆⍤⍇⍈⍊⊤λ⍍⍏£⊥⍶⌶⍐⍑χ≢⍖⍗
  ¨)<≤=>]∨^≠÷,+./
⍘⍚⍛⌈⍜⍢∪⍨⍕⍎⍬⍪∣│┤⍟∆∇→╣║╗╝←⌊┐└┴┬├─┼↑↓╔╚╩╦╠═╬≡⍸⍷∵
0123456789([;×:\
⌷⍂⌻⊢⊣◊┘┌█▄▌▐▀⍺⍹⊂⊃⍝⍲⍴⍱⌽⊖○∨⍳⍉∈∩⌿⍀≥≤≠×÷⍙∘⍵⍫⍋⍒¯¨ 
¯⍺⊥∩⌊∊_∇{⍳∘'⎕|⊤○
</source>
*?⍴⌈~↓∪⍵⊃↑⊂←⊢→≥-
⋄ABCDEFGHIJKLMNO
PQRSTUVWXYZ∆⊣⍪$}


<source lang=apl inline>⎕AV</source> is obsolete in Dyalog APL since Unicode Edition was introduced. It no longer contains all the [[glyph]]s used for [[primitive function]]s and [[primitive operator|operators]] in Dyalog APL.
┌┐└┘─│┼├┤┴┬  Í
"#%&@£`≡≢⍷⍸  ⍤⍥⌷
ÄÅÇÉÑÖÜáàâäãåçéè
êëíìîïñóòô⍥õúùûü
ÀÃÕ  Ææ⍬Øø¿¡ßÿ
abcdefghijklmno
pqrstuvwxyz⍙È€
</pre>


The '''Unicode Atomic Vector''' (<source lang=apl inline>⎕AVU</source>) defines characters in <source lang=apl inline>⎕AV</source> as a list of Unicode code points.
=== Dyalog APL ===
<source lang=apl inline>⎕AV</source> is obsolete in [[Dyalog APL]] since the Unicode Edition was introduced and is only retained for backwards compatibility.<ref>Bernard Legrand. [https://www.dyalog.com/uploads/documents/MasteringDyalogAPL.pdf#page=525 Mastering Dyalog APL (page 525)]. [[Dyalog Ltd]]. November 2009.</ref> It no longer contains all the [[glyph]]s used for [[primitive function]]s and [[primitive operator|operators]]<ref>[[Adám Brudzewsky]] [https://github.com/abrudz/SBCS/blob/master/README.md#usage SBCS] (Single Byte Character Set) Usage</ref>, but can be adjusted by setting the [[Atomic Vector - Unicode]] (<source lang=apl inline>⎕AVU</source>) variable to a list of Unicode code points. The default value is:
<pre>
          ⌶ɫ%'⍺⍵
_abcdefghijklmno
pqrstuvwxyz  ¯.⍬
0123456789 ⊢¥$£¢
∆ABCDEFGHIJKLMNO
PQRSTUVWXYZ  ý·
⍙ÁÂÃÇÈÊËÌÍÎÏÐÒÓÔ
ÕÙÚÛÝþãìðòõ{€}⊣⌷
¨ÀÄÅÆ⍨ÉÑÖØÜßàáâä
åæçèéêëíîïñ[/⌿\⍀
<≤=≥>≠∨∧-+÷×?∊⍴~
↑↓⍳○*⌈⌊∇∘(⊂⊃∩∪⊥⊤
|;,⍱⍲⍒⍋⍉⌽⊖⍟⌹!⍕⍎⍫
⍪≡≢óôöø"# &´┘┐┌└
┼─├┤┴┬│@ùúû^ü`∣¶
:⍷¿¡⋄←→⍝)]  §⎕⍞⍣
</pre>


== Links ==
=== GNU APL ===
* [https://help.dyalog.com/18.0/index.htm#Language/System%20Functions/av.htm Dyalog version 18.0 – Atomic Vector]
[[GNU APL]] is fully Unicode-aware, and only includes the atomic vector for completeness:
* Mastering Dyalog APL: [https://www.dyalog.com/uploads/documents/MasteringDyalogAPL.pdf#page=525 page 525]
<pre>
* [[Adám Brudzewsky]]'s [https://github.com/abrudz/SBCS Single-byte character set (SBCS)]
               
               
!"#$%&'()*+,-./
0123456789:;<=>?
@ABCDEFGHIJKLMNO
PQRSTUVWXYZ[\]^_
`abcdefghijklmno
pqrstuvwxyz{|}~
¥€⇄∧∼≬⋆⋸⌸⌺⌼μ⍁¡⍣⍅
⎕⍞⌹⍆⍤⍇⍈⍊⊤λ⍍⍏£⊥⍶⌶
⍐⍑χ≢⍖⍗⍘⍚⍛⌈⍜⍢∪⍨⍕⍎
⍬⍪∣│┤⍟∆∇→╣║╗╝←⌊┐
└┴┬├─┼↑↓╔╚╩╦╠═╬≡
⍸⍷∵⌷⍂⌻⊢⊣◊┘┌█▄▌▐▀
⍺⍹⊂⊃⍝⍲⍴⍱⌽⊖○∨⍳⍉∈∩
⌿⍀≥≤≠×÷⍙∘⍵⍫⍋⍒¯¨ </pre>


== External links ==
=== Documentation ===
* [http://microapl.com/apl_help/ch_020_070_060.htm APLX]
* [https://help.dyalog.com/latest/index.htm#Language/System%20Functions/av.htm Dyalog]
=== References ===
<references/>
{{APL built-ins}}
[[Category:System constants]]
[[Category:System constants]]

Navigation menu