System Variable FEATURE
⎕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.