How was Nothing
implemented in Wolfram language at the language level? For example, {a, b, Nothing, c, d, Nothing}
will return {a, b, c, d}
. How does Nothing
here affect the List
? I can't see what mechanism can achieve this effect.
Answer
Ok, I failed to find a duplicate so here is my comment:
I don't know how Nothing
is internally implemented but you can do something like this with UpValues
:
nothing /: {a___, nothing, b___} := {a, b}
Comments
Post a Comment