Splice

Splice[{e1,e2,}]

represents an expression that will automatically be spliced into any list in which it appears as the sequence of elements ei.

Details

  • Splice[{}] is equivalent to Nothing.
  • Splice[{e1,e2,}] is equivalent to Sequence[e1,e2,] when the outer wrapping head is List.
  • Splice is resolved as part of the standard evaluation process. It is not resolved in expressions that are held or inactive.

Examples

open allclose all

Basic Examples  (2)

Give a list of elements to be spliced into a surrounding list:

Splice expressions do not automatically flatten inside other heads:

Flatten a list of lists inside another list:

Applications  (1)

Splice a list into another list:

Properties & Relations  (3)

Splice[{e1,e2,}] behaves like Sequence[e1,e2,] inside a list:

Sequence objects also splice inside other heads, but not Splice objects:

Splice[{}] is equivalent to Nothing:

FlattenAt[list,pos] is equivalent to MapAt[Splice,list,pos]:

Wolfram Research (2020), Splice, Wolfram Language function, https://reference.wolfram.com/language/ref/Splice.html.

Text

Wolfram Research (2020), Splice, Wolfram Language function, https://reference.wolfram.com/language/ref/Splice.html.

BibTeX

@misc{reference.wolfram_2021_splice, author="Wolfram Research", title="{Splice}", year="2020", howpublished="\url{https://reference.wolfram.com/language/ref/Splice.html}", note=[Accessed: 03-August-2021 ]}

BibLaTeX

@online{reference.wolfram_2021_splice, organization={Wolfram Research}, title={Splice}, year={2020}, url={https://reference.wolfram.com/language/ref/Splice.html}, note=[Accessed: 03-August-2021 ]}

CMS

Wolfram Language. 2020. "Splice." Wolfram Language & System Documentation Center. Wolfram Research. https://reference.wolfram.com/language/ref/Splice.html.

APA

Wolfram Language. (2020). Splice. Wolfram Language & System Documentation Center. Retrieved from https://reference.wolfram.com/language/ref/Splice.html