Migration level

From APL Wiki
(Redirected from Compatibility setting)
Jump to navigation Jump to search

Migration level (⎕ML, ⎕EL, ⎕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


Dyalog settings

Dyalog APL currently offers the following settings:

⎕ML=0 ZR Monadic is interpreted as Type rather than Enlist.
⎕ML=1 Default behaviour
⎕ML2 ZR Monadic is interpreted as First rather than Mix.
ZR Monadic is interpreted as Mix rather than First.
ZR Monadic returns a positive rather than a negative value, if its argument has non-uniform depth.
⎕ML=3 RX[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.


When migrating to Dyalog APL, the below drop-ins for the affected built-ins allow setting ⎕ML1 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
Epsilon{×⎕NC'⍺':⍺  0⍴⊂}
'''[^'']+''' '∊'⎕R'&' 'Epsilon'
UpArrow{×⎕NC'⍺':⍺  }
RightShoe{×⎕NC'⍺':⍺  }
'''[^'']+''' '↑' '⊃' '≡'⎕R'&' 'UpArrow' 'RightShoe' 'EqualUnderbar'
UpArrow{×⎕NC'⍺':⍺  }
RightShoe{×⎕NC'⍺':⍺  }
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:

⎕CS1 Stranding is done before bracket indexing
⎕CS2 The name class of an invalid name is 4 rather than ¯1.
⎕CS4 Format () and default output uses the same width for all columns, rather than determining the width separately for each column.

External links


APL built-ins [edit]
Primitive functions
Monadic ConjugateNegateSignumReciprocalMagnitudeExponentialNatural LogarithmFloorCeilingFactorialNotPi TimesRollTypeImaginarySquare Root
Dyadic AddSubtractTimesDivideResiduePowerLogarithmMinimumMaximumBinomialComparison functionsBoolean functions (And, Or, Nand, Nor) ∙ GCDLCMCircularComplexRoot
Structural ShapeReshapeTallyDepthRavelEnlistTableCatenateReverseRotateTransposeRazeMixSplitEncloseNestCut (K)PairLinkPartitioned EnclosePartition
Selection FirstPickTakeDropUniqueIdentitySelectReplicateExpandSet functions (IntersectionUnionWithout) ∙ Bracket indexingIndex
Selector Index generatorGradeIndex OfInterval IndexIndicesDeal
Computational MatchNot MatchMembershipFindNub SieveEncodeDecodeMatrix InverseMatrix DivideFormatExecuteMaterialiseRange
Primitive operators Monadic EachCommuteConstantReplicateExpandReduceWindowed ReduceScanOuter ProductKeyI-BeamSpawnFunction axis
Dyadic BindCompositions (Compose, Reverse Compose, Beside, Withe, Atop, Over) ∙ Inner ProductPowerAtUnderRankDepthVariantStencilCut (J)
Quad names
Arrays Index originMigration levelAtomic vector
Functions Name classCase convertUnicode convert
Operators SearchReplace
APL glyphs [edit]
Information GlyphTyping glyphs (on Linux) ∙ UnicodeFontsMnemonicsOverstrikesMigration level
Individual glyphs Jot () ∙ Right Shoe () ∙ Up Arrow () ∙ Zilde () ∙ High minus (¯) ∙ Dot (.) ∙ Del ()