System Variable FEATURE: Difference between revisions
(new stub) |
No edit summary |
||
Line 1: | Line 1: | ||
<h1> | <h1><aplxx>⎕FEATURE</aplxx> - Feature Control</h1> | ||
{{BoxStart| | {{BoxStart|<apll>Z←⎕FEATURE</apll> | ||
| | | returns the current value of the Feature Control vector}} | ||
{{BoxEnd| | {{BoxEnd|<apll>Z</apll> is an integer vector whose elements each control a separate experimental Feature of the system.}} | ||
<br /> | |||
{| border="1" cellpadding="5" cellspacing="0" rules="none" summary="" | |||
|| <apll>⎕FEATURE←R</apll> || sets all of the values of the Feature Control Vector to <apll>R</apll>. | |||
|- | |||
| valign="top" |<apll>⎕FEAURE←⍬</apll> || sets all of the values of the Feature Control vector to their system default state. | |||
|- | |||
|| <apll>⎕FEATURE[L]←R</apll> || sets the value(s) of the Feature Control vector indexed by <apll>L</apll> to <apll>R</apll> — set <apll>R</apll> to <apll>1</apll> to enable the feature, <apll>0</apll> to disable it. | |||
|- | |||
|} | |||
This system variable allows the user to enable or disable certain experimental features — the initial setting is for all such features to be disabled. The features controlled are as follows: | |||
{| border="1" cellpadding="5" cellspacing="0" rules="all" summary="" | |||
||<apll>[1]</apll> || Allow negative indices | |||
|- | |||
||<apll>[2]</apll> || Allow <apll>¯0</apll> | |||
|- | |||
||<apll>[3]</apll> || User Hurwitz's Floor function instead of McDonnell's | |||
|- | |||
||<apll>[4]</apll> || Allow NaNs (NaN = Not-a-Number) | |||
|- | |||
|} | |||
For example, | |||
<ul> | |||
<li>With the first feature enabled, in origin-1, the index <apll>1</apll> refers to the first element in a vector and <apll>0</apll> refers to the last element: | |||
<apll><pre> | |||
⎕FEATURE[1]←1 | |||
a←'abcdef' | |||
a[0 1 2] | |||
fab | |||
a[¯2 ¯1 0 1 2] | |||
defab | |||
⍳¯3 | |||
¯2 ¯1 0 | |||
</pre></apll> | |||
When enabled, the first feature affects all contexts sensitive to the Index Origin.<br /><br /></li> | |||
<li>With the second feature disabled and then enabled: | |||
<apll><pre> | |||
⎕FEATURE[2]←0 | |||
÷∞ ¯∞ | |||
0 0 | |||
÷÷∞ ¯∞ | |||
∞ ∞ | |||
⎕FEATURE[2]←1 | |||
÷∞ ¯∞ | |||
0 ¯0 | |||
÷÷∞ ¯∞ | |||
∞ ¯∞ | |||
</pre></apll><br /></li> | |||
<li>With the third feature disabled and then enabled: | |||
<apll><pre> | |||
a←0.5<hc>J</hc>¯0.5 | |||
⎕FEATURE[3]←0 ⋄ ⌊a | |||
1<hc>J</hc>¯1 | |||
⎕FEATURE[3]←1 ⋄ ⌊a | |||
0<hc>J</hc>0 | |||
</pre></apll> | |||
On the other hand, McDonnell's Floor function isn't defined on Quaternions, but Hurwitz's is: | |||
<apll><pre> | |||
a←<⍳4 | |||
⎕FEATURE[3]←0 ⋄ ⌊a | |||
DOMAIN ERROR | |||
⎕FEATURE[3]←0 ⋄ ⌊a | |||
∧ | |||
⎕FEATURE[3]←1 ⋄ ⌊a | |||
1<hc>i</hc>2<hc>j</hc>3<hc>k</hc>4</pre></apll> | |||
The setting of this feature affects not only the result of the Floor function but also all other primitive functions directly or | |||
indirectly sensitive to the Floor function including Ceiling, Residue, Greatest Common Divisor, and Least Common Multiple. | |||
For more details on this topic, see [http://www.sudleyplace.com/APL/Hypercomplex%20GCD%20in%20APL.pdf Hypercomplex GCD in APL].<br /><br /></li> | |||
<li>With the fourth feature disabled and then enabled: | |||
<apll><pre> | |||
⎕FEATURE[4]←0 | |||
0*0<hc>J</hc>1 | |||
DOMAIN ERROR | |||
0*0<hc>J</hc>1 | |||
∧ | |||
⎕FEATURE[4]←1 | |||
0*0<hc>J</hc>1 | |||
∅<hc>J</hc>∅</pre></apll> | |||
A NaN is a special value supported by Fixed- and Multiple-precision arithmetic "representing an undefined or unrepresentable value, especially in floating-point calculations. Systematic use of NaNs was introduced by the [https://en.wikipedia.org/wiki/IEEE_floating_point IEEE 754] floating-point standard in 1985, along with the representation of other non-finite quantities like infinities"<sup>1</sup>. | |||
<br /></li> | |||
</ul> | |||
<h2>References</h2> | |||
<sup>1</sup> [https://en.wikipedia.org/wiki/NaN Wikipedia NaN] | |||
{{System Variables}} | {{System Variables}} | ||
{{Article footer}} | {{Article footer}} | ||
{{stub}} | {{stub}} |
Revision as of 15:59, 16 April 2018
⎕FEATURE - Feature Control
|
||||
Z is an integer vector whose elements each control a separate experimental Feature of the system. |
⎕FEATURE←R | sets all of the values of the Feature Control Vector to R. |
⎕FEAURE←⍬ | sets all of the values of the Feature Control vector to their system default state. |
⎕FEATURE[L]←R | sets the value(s) of the Feature Control vector indexed by L to R — set R to 1 to enable the feature, 0 to disable it. |
This system variable allows the user to enable or disable certain experimental features — the initial setting is for all such features to be disabled. The features controlled are as follows:
[1] | Allow negative indices |
[2] | Allow ¯0 |
[3] | User Hurwitz's Floor function instead of McDonnell's |
[4] | Allow NaNs (NaN = Not-a-Number) |
For example,
- With the first feature enabled, in origin-1, the index 1 refers to the first element in a vector and 0 refers to the last element:
⎕FEATURE[1]←1 a←'abcdef' a[0 1 2] fab a[¯2 ¯1 0 1 2] defab ⍳¯3 ¯2 ¯1 0
When enabled, the first feature affects all contexts sensitive to the Index Origin. - With the second feature disabled and then enabled:
⎕FEATURE[2]←0 ÷∞ ¯∞ 0 0 ÷÷∞ ¯∞ ∞ ∞ ⎕FEATURE[2]←1 ÷∞ ¯∞ 0 ¯0 ÷÷∞ ¯∞ ∞ ¯∞
- With the third feature disabled and then enabled:
a←0.5J¯0.5 ⎕FEATURE[3]←0 ⋄ ⌊a 1J¯1 ⎕FEATURE[3]←1 ⋄ ⌊a 0J0
On the other hand, McDonnell's Floor function isn't defined on Quaternions, but Hurwitz's is:
a←<⍳4 ⎕FEATURE[3]←0 ⋄ ⌊a DOMAIN ERROR ⎕FEATURE[3]←0 ⋄ ⌊a ∧ ⎕FEATURE[3]←1 ⋄ ⌊a 1i2j3k4
The setting of this feature affects not only the result of the Floor function but also all other primitive functions directly or indirectly sensitive to the Floor function including Ceiling, Residue, Greatest Common Divisor, and Least Common Multiple.
For more details on this topic, see Hypercomplex GCD in APL. - With the fourth feature disabled and then enabled:
⎕FEATURE[4]←0 0*0J1 DOMAIN ERROR 0*0J1 ∧ ⎕FEATURE[4]←1 0*0J1 ∅J∅
A NaN is a special value supported by Fixed- and Multiple-precision arithmetic "representing an undefined or unrepresentable value, especially in floating-point calculations. Systematic use of NaNs was introduced by the IEEE 754 floating-point standard in 1985, along with the representation of other non-finite quantities like infinities"1.
References
System Variables (A value may be assigned to these except for ⎕DM) | |||||||||
---|---|---|---|---|---|---|---|---|---|
⎕ALX | ⎕CT | ⎕DM | ⎕DT | ⎕ELX | ⎕FC | ⎕FEATURE | ⎕FPC | ⎕IC | ⎕IO |
⎕LR | ⎕LX | ⎕PP | ⎕PR | ⎕PW | ⎕RL | ⎕SA | ⎕WSID | ||
Niladic System Functions (a value cannot be assigned to these) | |||||||||
⎕A | ⎕AV | ⎕EM | ⎕ET | ⎕LC | ⎕NNAMES | ⎕NNUMS | ⎕SI | ⎕SYSID | ⎕SYSVER |
⎕T | ⎕TC | ⎕TCBEL | ⎕TCBS | ⎕TCESC | ⎕TCFF | ⎕TCHT | ⎕TCLF | ⎕TCNL | ⎕TCNUL |
⎕TS | ⎕WA | ||||||||
Monadic or dyadic system functions (a value cannot be assigned to these) | |||||||||
⎕AT | ⎕CR | ⎕DC | ⎕DFT | ⎕DL | ⎕DR | ⎕EA | ⎕EC | ⎕ERROR | ⎕ES |
⎕EX | ⎕FMT | ⎕FX | ⎕MF | ⎕NAPPEND | ⎕NC | ⎕NCREATE | ⎕NERASE | ⎕NINFO | ⎕NL |
⎕NLOCK | ⎕NREAD | ⎕NRENAME | ⎕NREPLACE | ⎕NRESIZE | ⎕NSIZE | ⎕NTIE | ⎕NUNTIE | ⎕STOP | ⎕TF |
⎕TRACE | ⎕UCS | ⎕VR | |||||||
Note that quad functions and variables (except for the ⎕A family of functions) are case insensitive |
See Also | ||
System Commands | System Variables and Functions | Operators |
Keyboard | ||||||||||||||
Alt+Shift | ⍪ | ≡ | ≢ | ⍒ | ⍋ | ⌽ | ⍉ | ⊖ | ⍟ | ⍱ | ⍲ | ⍠ | ⌹ | |
Alt | ⋄ | ¨ | ¯ | < | ≤ | ∅ | ≥ | > | ≠ | ∨ | ∧ | × | ÷ | |
Shift | ~ | ! | @ | # | $ | % | ^ | & | * | ( | ) | _ | + | |
Key | ` | 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 0 | - | = | |
Alt+Shift | ⍷ | √ | ⍨ | ⍸ | ⍥ | ⍣ | ⍞ | ⍬ | ⊣ | |||||
Alt | ? | ⍵ | ∊ | ⍴ | § | ↑ | ↓ | ⍳ | ○ | π | ← | → | ⊢ | |
Shift | Q | W | E | R | T | Y | U | I | O | P | { | } | | | |
Key | q | w | e | r | t | y | u | i | o | p | [ | ] | \ | |
Alt+Shift | ∫ | ∂ | ⌻ | ⍢ | ⍙ | ⍤ | ⍫ | ⌷ | ||||||
Alt | ⍺ | ⌈ | ⌊ | ∞ | ∇ | ∆ | ∘ | ‼ | ⎕ | ⍎ | ⍕ | |||
Shift | A | S | D | F | G | H | J | K | L | : | " | |||
Key | a | s | d | f | g | h | j | k | l | ; | ' | |||
Alt+Shift | ⊆ | ⊇ | χ | ⍡ | ⍭ | ⊙ | ||||||||
Alt | ⊂ | ⊃ | ∩ | ∪ | ⊥ | ⊤ | ⍦ | ⍝ | ⍀ | ⌿ | ||||
Shift | Z | X | C | V | B | N | M | < | > | ? | ||||
Key | z | x | c | v | b | n | m | , | . | / |
NARS 2000 Lang Tool Bar |
← | → | + | - | × | ÷ | * | ⍟ | ⌹ | ○ | ! | ? | √ | | | ⌈ | ⌊ | ⊥ | ⊤ | ⊣ | ⊢ | |||
≡ | ≢ | < | ≤ | = | ≥ | > | ≠ | ∨ | ∧ | ⍱ | ⍲ | ↑ | ↓ | ⊂ | ⊃ | ⌷ | ⍋ | ⍒ | |||||
⍳ | ∊ | ⍸ | ⍷ | ∪ | ∩ | ⊆ | ⊇ | ~ | § | π | .. | , | ⍪ | ⍴ | ⌽ | ⊖ | ⍉ | ||||||
/ | \ | ⌿ | ⍀ | ⊙ | ¨ | ⍨ | ⍤ | ⍣ | ⍡ | ⍥ | ⍦ | . | ∘ | ⍠ | ‼ | ⌻ | ∂ | ∫ | ⍞ | ⎕ | ⍎ | ⍕ | |
⋄ | ⍝ | ∇ | ∆ | ⍙ | _ | ⍺ | ⍵ | ¯ | ⍬ | ∞ | ∅ | ||||||||||||
Second Row | i j k | i j k l | g | p | r | v | x |
[[Category:Mouse Group {{{1}}}|{{{2}}}]]
- This NARS2000 article is a stub and needs further work.