Migration level (⎕ML
, )EvLevel
, ⎕CS
), Evolution level, or Compatibility setting is a number that, in Dyalog APL, APL+Win, and APLX respectively, specifies exact behaviour relative to APL2. In Dyalog APL and APL+Win, a lower value represents a behaviour closer to the original NARS specification, while a higher the value represents a behaviour closer to APL2. In APLX, a lower value matches APL2 while a higher value indicates higher backwards compatibility with APL.68000.
APL+Win settings
Work-arounds
APL+Win provides system function alternatives to the functions that are affected by moving to evolution level 2:
Dyalog settings
Dyalog APL currently offers the following settings:
⎕ML=0
|
Z←∊R
|
Monadic ∊ is interpreted as Type rather than Enlist.
|
⎕ML=1
|
|
Default behaviour
|
⎕ML≥2
|
Z←↑R
|
Monadic ↑ is interpreted as First rather than Mix.
|
Z←⊃R
|
Monadic ⊃ is interpreted as Mix rather than First.
|
Z←≡R
|
Monadic ≡ returns a positive rather than a negative value, if its argument has non-uniform depth.
|
⎕ML=3
|
R←X⊂[K]Y
|
Dyadic ⊂ is interpreted as Partition (⊆ ) rather than Partitioned Enclose.
|
⎕TC
|
The order of the elements of ⎕TC is the same as in APL2.
|
Work-arounds
When migrating to Dyalog APL, the below drop-ins for the affected built-ins allow setting ⎕ML←1
while preserving code behaviour. It is then safe to programmatically (as shown in the rightmost column) change all occurrences of the affected built-ins with their respective covers.
Migrating from |
Define |
Then run this on all code
|
⎕ML=0
|
Epsilon←{×⎕NC'⍺':⍺∊⍵ ⋄ ⊃0⍴⊂⍵}
|
'''[^'']+''' '∊'⎕R'&' 'Epsilon'
|
⎕ML=2
|
UpArrow←{×⎕NC'⍺':⍺↑⍵ ⋄ ⊃⍵}
RightShoe←{×⎕NC'⍺':⍺↑⍵ ⋄ ↑⍵}
EqualUnderbar←|≡
|
'''[^'']+''' '↑' '⊃' '≡'⎕R'&' 'UpArrow' 'RightShoe' 'EqualUnderbar'
|
⎕ML=3
|
UpArrow←{×⎕NC'⍺':⍺↑⍵ ⋄ ⊃⍵}
RightShoe←{×⎕NC'⍺':⍺↑⍵ ⋄ ↑⍵}
EqualUnderbar←(|≡)
LeftShoe←{×⎕NC'⍺':⍺⊆⍵ ⋄ ⊂⍵}
quadTC←(⎕UCS 8 13 10)
|
'''[^'']+''' '↑' '⊃' '≡' '⊂' '⎕TC'⎕R'&' 'UpArrow' 'RightShoe' 'EqualUnderbar' 'LeftShoe' ' quadTC'
|
Alternatively, the definitions can be used directly inside the text substitutions, whereby one avoids polluting existing code with these cover names.
APLX settings
APLX treats the value as a collection of individual bits, thus allowing the combination of an exact set of behaviours:
⎕CS←1 |
Stranding is done before bracket indexing
|
⎕CS←2 |
The name class of an invalid name is 4 rather than ¯1.
|
⎕CS←4 |
Format (⍕ ) and default output uses the same width for all columns, rather than determining the width separately for each column.
|
External links
Documentation
APL built-ins [edit]
|
Primitives (Timeline) |
Functions
|
Scalar
|
Monadic
|
Conjugate ∙ Negate ∙ Signum ∙ Reciprocal ∙ Magnitude ∙ Exponential ∙ Natural Logarithm ∙ Floor ∙ Ceiling ∙ Factorial ∙ Not ∙ Pi Times ∙ Roll ∙ Type ∙ Imaginary ∙ Square Root ∙ Round
|
Dyadic
|
Add ∙ Subtract ∙ Times ∙ Divide ∙ Residue ∙ Power ∙ Logarithm ∙ Minimum ∙ Maximum ∙ Binomial ∙ Comparison functions ∙ Boolean functions (And, Or, Nand, Nor) ∙ GCD ∙ LCM ∙ Circular ∙ Complex ∙ Root
|
Non-Scalar
|
Structural
|
Shape ∙ Reshape ∙ Tally ∙ Depth ∙ Ravel ∙ Enlist ∙ Table ∙ Catenate ∙ Reverse ∙ Rotate ∙ Transpose ∙ Raze ∙ Mix ∙ Split ∙ Enclose ∙ Nest ∙ Cut (K) ∙ Pair ∙ Link ∙ Partitioned Enclose ∙ Partition
|
Selection
|
First ∙ Pick ∙ Take ∙ Drop ∙ Unique ∙ Identity ∙ Stop ∙ Select ∙ Replicate ∙ Expand ∙ Set functions (Intersection ∙ Union ∙ Without) ∙ Bracket indexing ∙ Index ∙ Cartesian Product ∙ Sort
|
Selector
|
Index generator ∙ Grade ∙ Index Of ∙ Interval Index ∙ Indices ∙ Deal ∙ Prefix and suffix vectors
|
Computational
|
Match ∙ Not Match ∙ Membership ∙ Find ∙ Nub Sieve ∙ Encode ∙ Decode ∙ Matrix Inverse ∙ Matrix Divide ∙ Format ∙ Execute ∙ Materialise ∙ Range
|
Operators |
Monadic
|
Each ∙ Commute ∙ Constant ∙ Replicate ∙ Expand ∙ Reduce ∙ Windowed Reduce ∙ Scan ∙ Outer Product ∙ Key ∙ I-Beam ∙ Spawn ∙ Function axis ∙ Identity (Null, Ident)
|
Dyadic
|
Bind ∙ Compositions (Compose, Reverse Compose, Beside, Withe, Atop, Over) ∙ Inner Product ∙ Determinant ∙ Power ∙ At ∙ Under ∙ Rank ∙ Depth ∙ Variant ∙ Stencil ∙ Cut ∙ Direct definition (operator) ∙ Identity (Lev, Dex)
|
Quad names
|
Index origin ∙ Comparison tolerance ∙ Migration level ∙ Atomic vector
|