Skip to main content

evaluation - What are the cool kids talking about when they use ##&[]?



All the cool kids are apparently using


##&[]

for



Unevaluated @ Sequence[]

but I have no idea what either means.


Please explain what these things are so I can be a cool kid!



Answer



Try this:


Map[If[#==1,Unevaluated@Sequence[],#]&,{1,2,3}]

Note the output. The 1 is gone. That's because Unevaluated@Sequence[] puts the empty sequence there, that is, "nothing".


##&[] is a shorthand that can be used in most places for same - ## is the sequence of arguments, & makes it a function to apply to something, [] is that something - an empty argument list, so the result is... a sequence that is empty.



Comments