﻿``` S := ["x", "xy", null, "xyz", "hi", "adios", "hola", "guten morgen" ];
``` TA := Zip(s:S, i:Range(10), { A: s, X: i + 1d });
``` TB := Zip(s:S, i:Range(10), { A: null if Mod(i, 3) = 1 else s, B: null if Mod(i, 3) = 2 else s, X: i + 1d });
``` TC := Zip(s:S, i:Range(10), { A: s, C: Range(i*2)->{ D: s, E: s }})

S
TA
TB

// Simple, no mapping or merging.
TA->Chain([null])->MultiDSMA() // Error.
TA->MultiDS_A()
TA->MultiDS_A()->Map(B->Text.Concat(", "))
TB->MultiDS_A()->Map(B->Text.Concat(", "))
TB->MultiDS_B()->Map(B->Text.Concat(", "))

// Mapping but non-merging.
S->MultiDSMA(    it)->Map(B->Text.Concat(", "))
S->MultiDSMA(A:  it)->Map(B->Text.Concat(", "))
S->MultiDSMAM(   it)->Map(B->Text.Concat(", "))
S->MultiDSMAm(   it)->Map(B->Text.Concat(", "))
S->MultiDSMA(    it & "-extra")->Map(B->Text.Concat(", "))
S->MultiDSMA(A:  it & "-extra")->Map(B->Text.Concat(", "))
(S ++ ["final"])->MultiDSMAM(   it)->Map(B->Text.Concat(", "))
(S ++ ["final"])->MultiDSMAm(   it)->Map(B->Text.Concat(", "))

S->MultiDSMB(   it)->Map(B->Text.Concat(", "))
S->MultiDSMB(B: it)->Map(B->Text.Concat(", "))
S->MultiDSMB(A: it)->Map(B->Text.Concat(", "))
S->MultiDSMB(   it & "-1st",    it & "-2nd")->Map(B->Text.Concat(", "))
S->MultiDSMB(   it & "-1st", A: it & "-2nd")->Map(B->Text.Concat(", "))
S->MultiDSMB(   it & "-1st", B: it & "-2nd")->Map(B->Text.Concat(", ")) // Error.
S->MultiDSMB(B: it & "-1st",    it & "-2nd")->Map(B->Text.Concat(", "))
S->MultiDSMB(B: it & "-1st", A: it & "-2nd")->Map(B->Text.Concat(", "))
S->MultiDSMB(A: it & "-1st",    it & "-2nd")->Map(B->Text.Concat(", ")) // Error.
S->MultiDSMB(A: it & "-1st", B: it & "-2nd")->Map(B->Text.Concat(", "))

S->MultiDsMB(it) // Error.
S->MultiDsMB({ A: "a-" & it, B: "b-" & it })->Map(B->Text.Concat(", "))

// Mapping and merging.
TA->MultiDSMA()
TA->MultiDSMA(A)
TA->MultiDSMA()->Map(it+>{ B: "[" & B->Text.Concat(", ") & "]" })
TA->MultiDSMA(A)->Map(it+>{ B: "[" & B->Text.Concat(", ") & "]" })
TA->MultiDSMAM()->Map(it+>{ B: "<null>" if IsNull(B) else "[" & B->Text.Concat(", ") & "]" })
TA->MultiDSMAM(A)->Map(it+>{ B: "<null>" if IsNull(B) else "[" & B->Text.Concat(", ") & "]" })
TA->MultiDSMAm()->Map(it+>{ B: "<null>" if IsNull(B) else "[" & B->Text.Concat(", ") & "]" })
TA->MultiDSMAm(A)->Map(it+>{ B: "<null>" if IsNull(B) else "[" & B->Text.Concat(", ") & "]" })
TA->MultiDSMB(   A)->Map(it+>{ B: "[" & B->Text.Concat(", ") & "]" })
TA->MultiDSMB(A: A)->Map(it+>{ B: "[" & B->Text.Concat(", ") & "]" })
TA->MultiDSMB(B: A)->Map(it+>{ B: "[" & B->Text.Concat(", ") & "]" })
(TA ++ [{A: "final", X: Count(S)+0d}])->MultiDSMAM(A)->Map(it+>{ B: "<null>" if IsNull(B) else "[" & B->Text.Concat(", ") & "]" })
(TA ++ [{A: "final", X: Count(S)+0d}])->MultiDSMAm(A)->Map(it+>{ B: "<null>" if IsNull(B) else "[" & B->Text.Concat(", ") & "]" })

TA->MultiDsMB({ A, B: "b-" & A })->Map(it+>{ B: "[" & B->Text.Concat(", ") & "]" })

// Mapping and merging with rename.
TB->MultiDSMA(A)
TB->MultiDSMA(A)->Map(it+>{ B2: "[" & B2->Text.Concat(", ") & "]" })
TB->MultiDSMA(B)
TB->MultiDSMA(B)->Map(it+>{ B2: "[" & B2->Text.Concat(", ") & "]" })
TB->MultiDSMB()
TB->MultiDSMB(          )->Map(it+>{ B2: "[" & B2->Text.Concat(", ") & "]" })
TB->MultiDSMB(   A,    B)->Map(it+>{ B2: "[" & B2->Text.Concat(", ") & "]" })
TB->MultiDSMB(A: A, B: B)->Map(it+>{ B2: "[" & B2->Text.Concat(", ") & "]" })
TB->MultiDSMB(A: A,    B)->Map(it+>{ B2: "[" & B2->Text.Concat(", ") & "]" }) // Error.
TB->MultiDSMB(B: A, A: B)->Map(it+>{ B2: "[" & B2->Text.Concat(", ") & "]" })
TB->MultiDSMB(B: A,    A)->Map(it+>{ B2: "[" & B2->Text.Concat(", ") & "]" })

TB->Multi_SMB() // Error.
TB->Multi_SMB(A: A, B: B)->Map(it+>{ B2: "[" & B2->Text.Concat(", ") & "]" })

// Required fields.
TB->MultiDS_Bab()->Map(B->Text.Concat(", "))
S->MultiDSMBab(   it) //->Map(B->Text.Concat(", ")) // Error.
S->MultiDSMBab(   it & "-1st",    it & "-2nd")->Map(B->Text.Concat(", "))
S->MultiDSMBb(   it)->Map(B->Text.Concat(", "))
S->MultiDSMBb(A: it) //->Map(B->Text.Concat(", ")) // Error.

// Default arguments.
S->MultiDSMC(A: it)->Map(B->Text.Concat(", "))
TC->MultiDSMCc(A: A, C: C)->Map(B->Text.Concat(", "))

// Record at the top level.
S->MultiDSMB(   it & "-1st",    it & "-2nd")->Map(B->Text.Concat(", ")) // For comparison.
S->MultiDRMB(   it & "-1st",    it & "-2nd")->Map(B->Text.Concat(", "))
S->MultiDRMB(   it & "-1st",    it & "-2nd",     "/suf")->Map(B->Text.Concat(", "))
S->MultiDRMB(   it & "-1st",    it & "-2nd", S1: "/suf")->Map(B->Text.Concat(", "))
S->MultiDRMB(   it & "-1st",    it & "-2nd", S2: 7     )->Map(B->Text.Concat(", "))
S->MultiDRMB(   it & "-1st",    it & "-2nd",     "/suf",     7)->Map(B->Text.Concat(", "))
S->MultiDRMB(   it & "-1st",    it & "-2nd",     "/suf", S2: 7)->Map(B->Text.Concat(", "))
S->MultiDRMB(   it & "-1st",    it & "-2nd", S1: "/suf",     7)->Map(B->Text.Concat(", "))
S->MultiDRMB(   it & "-1st",    it & "-2nd", S1: "/suf", S2: 7)->Map(B->Text.Concat(", "))
S->MultiDRMB(   it & "-1st",    it & "-2nd", S2: 7,     "/suf")->Map(B->Text.Concat(", ")) // Error.
S->MultiDRMB(   it & "-1st",    it & "-2nd", S2: 7, S1: "/suf")->Map(B->Text.Concat(", "))
S->MultiDrMB({ B: "b-" & it, A: "a-" & it }, S2: 7, S1: "/suf")->Map(B->Text.Concat(", "))
MultiDfMB(S->Map({ B: "b-" & it, A: "a-" & it }), S2: 7, S1: "/suf")->Map(B->Text.Concat(", "))
MultiDRMB({ Mis: TB, S1: "/pre", S2: 5 })->Map(B->Text.Concat(", "))
MultiDfMB(  Mis: TB, S1: "/pre", S2: 5  )->Map(B->Text.Concat(", "))

// Record at the top level with merging.
TA->MultiDRMB(A)->Map(it+>{ B: "[" & B->Text.Concat(", ") & "]" })
TB->MultiDRMB(B, A)->Map(it+>{ B2: "[" & B2->Text.Concat(", ") & "]" })
TB->MultiDRMB(B, A, "/suf")->Map(it+>{ B2: "[" & B2->Text.Concat(", ") & "]" })
TB->MultiDRMB(B, A, "/suf", 5)->Map(it+>{ B2: "[" & B2->Text.Concat(", ") & "]" })
TB->MultiDrMB({ B, A }, "/suf", 5)->Map(it+>{ B2: "[" & B2->Text.Concat(", ") & "]" })
TB->MultiDrMB({ A, B }, "/suf", 5)->Map(it+>{ B2: "[" & B2->Text.Concat(", ") & "]" })

// Record output, "multiple outputs".
TB->MultiDS_BW()+>{ Mos: Mos->Map(it+>{ B: "[" & B->Text.Concat(", ") & "]" }) }
TB->MultiDSMBW()+>{ Mos: Mos->Map(it+>{ B2: "[" & B2->Text.Concat(", ") & "]" }) }
S ->MultiDSMBW(B: it & "-1st", A: it & "-2nd")+>{ Mos: Mos->Map(it+>{ B: "[" & B->Text.Concat(", ") & "]" }) }
TB->MultiDSMBW(A, B)+>{ Mos: Mos->Map(it+>{ B2: "[" & B2->Text.Concat(", ") & "]" }) }

S ->MultiDRMBW(A: it & "-1st", B: it & "-2nd", S1: "/suf", S2: 7)+>{ Mos: Mos->Map(B->Text.Concat(", ")) }
TB->MultiDRMBW(B, A           )+>{ Mos: Mos->Map(it+>{ B2: "[" & B2->Text.Concat(", ") & "]" }) }
TB->MultiDRMBW(B, A, "/suf", 5)+>{ Mos: Mos->Map(it+>{ B2: "[" & B2->Text.Concat(", ") & "]" }) }

// Null source.
``` F := false;
(TA if F else null)->MultiDSMA()
(S  if F else null)->MultiDSMA(A: it & "-extra")
(S  if F else null)->MultiDSMB(A: it & "-1st", B: it & "-2nd")
(S  if F else null)->MultiDsMB({ A: "a-" & it, B: "b-" & it })
(TA if F else null)->MultiDSMA(A)
(TA if F else null)->MultiDSMB(A: A)
(TA if F else null)->MultiDSMB(B: A)
(TA if F else null)->MultiDsMB({ A, B: "b-" & A })
(TB if F else null)->MultiDSMA(A)
(TB if F else null)->MultiDSMA(B)
(TB if F else null)->MultiDSMB(A: A, B: B)
(TB if F else null)->Multi_SMB(A: A, B: B)
(TB if F else null)->MultiDSMBab()
(S  if F else null)->MultiDSMBab(   it & "-1st",    it & "-2nd")
(S  if F else null)->MultiDSMBb(   it)
(S  if F else null)->MultiDSMC(A: it)
(TC if F else null)->MultiDSMCc(A: A, C: C)
(S  if F else null)->MultiDSMB(   it & "-1st",    it & "-2nd") // For comparison.
(S  if F else null)->MultiDRMB(   it & "-1st",    it & "-2nd")
(S  if F else null)->MultiDRMB(   it & "-1st",    it & "-2nd",     "/suf")
(S  if F else null)->MultiDRMB(   it & "-1st",    it & "-2nd", S1: "/suf")
(S  if F else null)->MultiDRMB(   it & "-1st",    it & "-2nd", S2: 7     )
(S  if F else null)->MultiDRMB(   it & "-1st",    it & "-2nd",     "/suf",     7)
(S  if F else null)->MultiDRMB(   it & "-1st",    it & "-2nd",     "/suf", S2: 7)
(S  if F else null)->MultiDRMB(   it & "-1st",    it & "-2nd", S1: "/suf",     7)
(S  if F else null)->MultiDRMB(   it & "-1st",    it & "-2nd", S1: "/suf", S2: 7)
(S  if F else null)->MultiDRMB(   it & "-1st",    it & "-2nd", S2: 7, S1: "/suf")
(S  if F else null)->MultiDrMB({ B: "b-" & it, A: "a-" & it }, S2: 7, S1: "/suf")
(TA if F else null)->MultiDRMB(A)
(TB if F else null)->MultiDRMB(B, A)
(TB if F else null)->MultiDRMB(B, A, "/suf")
(TB if F else null)->MultiDRMB(B, A, "/suf", 5)
(TB if F else null)->MultiDrMB({ B, A }, "/suf", 5)
(TB if F else null)->MultiDrMB({ A, B }, "/suf", 5)
(TB if F else null)->MultiDSMBW()
(S  if F else null)->MultiDSMBW(B: it & "-1st", A: it & "-2nd")
(TB if F else null)->MultiDSMBW(A, B)
(S  if F else null)->MultiDRMBW(A: it & "-1st", B: it & "-2nd", S1: "/suf", S2: 7)
(TB if F else null)->MultiDRMBW(B, A           )
(TB if F else null)->MultiDRMBW(B, A, "/suf", 5)

// Empty source.
(TA->TakeIf(F))->MultiDSMA()
(S ->TakeIf(F))->MultiDSMA(A: it & "-extra")
(S ->TakeIf(F))->MultiDSMB(A: it & "-1st", B: it & "-2nd")
(S ->TakeIf(F))->MultiDsMB({ A: "a-" & it, B: "b-" & it })
(TA->TakeIf(F))->MultiDSMA(A)
(TA->TakeIf(F))->MultiDSMB(A: A)
(TA->TakeIf(F))->MultiDSMB(B: A)
(TA->TakeIf(F))->MultiDsMB({ A, B: "b-" & A })
(TB->TakeIf(F))->MultiDSMA(A)
(TB->TakeIf(F))->MultiDSMA(B)
(TB->TakeIf(F))->MultiDSMB(A: A, B: B)
(TB->TakeIf(F))->Multi_SMB(A: A, B: B)
(TB->TakeIf(F))->MultiDSMBab()
(S ->TakeIf(F))->MultiDSMBab(   it & "-1st",    it & "-2nd")
(S ->TakeIf(F))->MultiDSMBb(   it)
(S ->TakeIf(F))->MultiDSMC(A: it)
(TC->TakeIf(F))->MultiDSMCc(A: A, C: C)
(S ->TakeIf(F))->MultiDSMB(   it & "-1st",    it & "-2nd") // For comparison.
(S ->TakeIf(F))->MultiDRMB(   it & "-1st",    it & "-2nd")
(S ->TakeIf(F))->MultiDRMB(   it & "-1st",    it & "-2nd",     "/suf")
(S ->TakeIf(F))->MultiDRMB(   it & "-1st",    it & "-2nd", S1: "/suf")
(S ->TakeIf(F))->MultiDRMB(   it & "-1st",    it & "-2nd", S2: 7     )
(S ->TakeIf(F))->MultiDRMB(   it & "-1st",    it & "-2nd",     "/suf",     7)
(S ->TakeIf(F))->MultiDRMB(   it & "-1st",    it & "-2nd",     "/suf", S2: 7)
(S ->TakeIf(F))->MultiDRMB(   it & "-1st",    it & "-2nd", S1: "/suf",     7)
(S ->TakeIf(F))->MultiDRMB(   it & "-1st",    it & "-2nd", S1: "/suf", S2: 7)
(S ->TakeIf(F))->MultiDRMB(   it & "-1st",    it & "-2nd", S2: 7, S1: "/suf")
(S ->TakeIf(F))->MultiDrMB({ B: "b-" & it, A: "a-" & it }, S2: 7, S1: "/suf")
(TA->TakeIf(F))->MultiDRMB(A)
(TB->TakeIf(F))->MultiDRMB(B, A)
(TB->TakeIf(F))->MultiDRMB(B, A, "/suf")
(TB->TakeIf(F))->MultiDRMB(B, A, "/suf", 5)
(TB->TakeIf(F))->MultiDrMB({ B, A }, "/suf", 5)
(TB->TakeIf(F))->MultiDrMB({ A, B }, "/suf", 5)
(TB->TakeIf(F))->MultiDSMBW()
(S ->TakeIf(F))->MultiDSMBW(B: it & "-1st", A: it & "-2nd")
(TB->TakeIf(F))->MultiDSMBW(A, B)
(S ->TakeIf(F))->MultiDRMBW(A: it & "-1st", B: it & "-2nd", S1: "/suf", S2: 7)
(TB->TakeIf(F))->MultiDRMBW(B, A           )
(TB->TakeIf(F))->MultiDRMBW(B, A, "/suf", 5)

// Single to sequence transformations.
MultiS_DSMB_ABD({A:S, B:Range(10)->ToText()})
MultiS_DSMB_ABD(TB, B)
MultiS_DSMB_ABD(TB, B: [B], A: A)
MultiS_DRMB_ABD12(TB, A, B, "hello", [17])
MultiS_DRMB_ABD12(TB, B: [B], A: A, S1:["hello"], S2:17)
MultiS_DfMB_ABDM12({A:["sA"], B:["sB"]}, "hello", 17)
MultiS_DsMB_ABDM(TB, {A:["sA"], B:["sB"]})
MultiS_DrMB_ABDM12(TB, {A:["sA"], B:["sB"]}, S2:17, S1:"sA")

// Null handling.
MultiS_DSMA_AD(TA, null)
MultiS_DRMB_ABD12(TB, null, null, null, null)
MultiS_DfMB_ABDM12({A:null, B:null}, null, 17)
MultiS_DsMB_ABDM(TB, {A:null, B:null})
MultiS_DrMB_ABDM12(TB, {A:null, B:null}, S2:17, S1:null)