From APL Wiki
Jump to navigation Jump to search

Materialise () is a monadic primitive function which tries to cast the argument (which can be any object) into an APL array. If the argument is already an array, it is returned unmodified. It is only available in Dyalog APL, which supports classes and .NET objects. Materialise shares its glyph with Index.


Dyalog APL allows the user to define a class, which looks like the following:

:Class cl
    :Property Default thing
    :Access Public Shared
          r3 1 4 1 4
Works in: Dyalog APL

If one property is declared as default, Materialise returns the value of the default property.

      cl  ⍝ It is an object
      cl  ⍝ ⌷ casts cl to an array by getting the default property
3 1 4 1 4
      cl.thing  ⍝ Actual effect of the line above
3 1 4 1 4
Works in: Dyalog APL

Materialise can also be used on a .NET collection, which returns the underlying array of data.

      ba⎕NEW System.Collections.BitArray(1 0 1 1 0)
      ≡⍴ba  ⍝ ba itself is a scalar object
      ⍴⌷ba  ⍝ but it is actually a container of 5 values
Works in: Dyalog APL

Materialise is the same as Identity for APL arrays.

      (⌷≡⊢) 1 2 3 4 5
Works in: Dyalog APL

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, Atop, Over) ∙ Inner ProductPowerAtUnderRankDepthVariantStencilCut (J)
Quad names
Arrays Index originMigration levelAtomic vector
Functions Case convertUnicode convert
Operators SearchReplace