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 — a 1 in R enables the feature, 0 disables 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) |
[5] | Use APL2's definition of Inner Product |
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, such as the L in R[L], R[L]←A, R[L]f←A, L⌷R, L⍉R, and L⊃R. - With the second feature disabled and then enabled:
⎕FEATURE[2]←0 ÷∞ ¯∞ 0 0 ÷÷∞ ¯∞ ∞ ∞ ⎕FEATURE[2]←1 ÷∞ ¯∞ 0 ¯0 ÷÷∞ ¯∞ ∞ ¯∞
Because ¯0 can not stored as a 64-bit Integer, this feature has a drawback of occasionally forcing a type promotion from Integer to Floating Point. For example, if R is an Integer array with 0∊R, then an expression such as -R can no longer be stored as an Integer array, and must be promoted to Floating Point.
- With the third feature disabled and then enabled:
a←0.5J¯0.5 ⎕FEATURE[3]←0 ⋄ ⌊a 1J¯1 ⎕FEATURE[3]←1 ⋄ ⌊a 0J0
The industry standard definition of the Floor function on Complex numbers is McDonnell's. However, McDonnell's Floor function isn't defined on Quaternions, but Hurwitz's is:
a←<1 3 5 7÷2 ⎕FEATURE[3]←0 ⋄ ⌊a DOMAIN ERROR ⎕FEATURE[3]←0 ⋄ ⌊a ∧ ⎕FEATURE[3]←1 ⋄ ⌊a 0i1j2k3
The two Floor functions return the same result for all Real numbers; they differ only on certain Complex numbers.
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 (⌈R), Residue (L|R), Greatest Common Divisor (L∨R), and Least Common Multiple (L∧R).
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.
- With the fifth feature disabled and then enabled:
a←3 6⍴'Queue EschewAchoo ' a Queue Eschew Achoo ⎕FEATURE[5]←0 a+.∊'aeiou' LENGTH ERROR a+.∊'aeiou' ∧ ⎕FEATURE[5]←1 a+.∊'aeiou' 4 1 2
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.