# Question on evalution

**URL:** <https://community.wolfram.com/t/question-on-evalution/4111>\
**Category:** Questions\
**Tags:** mathematica\
**Created:** [November 24, 2014, 10:25pm UTC](https://community.wolfram.com/t/question-on-evalution/4111 "2014-11-24T22:25:21Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![henrikschachner](https://yyz1.discourse-cdn.com/wolfram/user_avatar/community.wolfram.com/henrikschachner/32/32119_2.png) [@henrikschachner](https://community.wolfram.com/u/henrikschachner)\
**Post date:** [November 24, 2014, 10:25pm UTC](https://community.wolfram.com/t/question-on-evalution/4111/1 "2014-11-24T22:25:21Z")

</div>

Hi all,

analysing some code for learning the WL properly I came across the following “feature”:

```
{a, Sequence @@ {}, b}

```

and

```
{a, Sequence[], b}

```

both give the identical result (namely {a,b}).

But e.g. inside an “If”-statement this makes obviously a big difference:

```
If[# < 1, Sequence @@ {}, #] & /@ {0.5, 1.5}

```

gives {1.5}, which is the expected result. But the use of

```
If[# < 1, Sequence[], #] & /@ {0.5, 1.5}

```

results in {0.5, Null}, which is kind of the opposite of what was wanted.

In trying to understand this “Trace[]” might be helpful: It seems to me that in

the “Sequence@@{}”-case the If-statement is evalutated first (?) and in the

“Sequence[]”-case the arguments of the If-statement - as a sequence - are evalutated first (?).

In general my feeling is that in WL there is nothing which is not clever in some way!

But where is here  
the underlaying concept?

Many thanks for any comment!

Henrik

---

<div class="post-metadata">

**Author:** ![iliang](https://yyz1.discourse-cdn.com/wolfram/user_avatar/community.wolfram.com/iliang/32/11263_2.png) [@iliang](https://community.wolfram.com/u/iliang)\
**Post date:** [November 24, 2014, 10:42pm UTC](https://community.wolfram.com/t/question-on-evalution/4111/2 "2014-11-24T22:42:28Z")

</div>

If has the [HoldRest](http://reference.wolfram.com/language/ref/HoldRest.html) attribute, which prevents the evaluation of Apply (@@). It does not have the [SequenceHold](http://reference.wolfram.com/language/ref/SequenceHold.html) attribute which would prevent the Sequence[] splicing.

```
In[1]:= SetAttributes[If, SequenceHold];
         If[# < 1, Sequence[], #] & /@ {0.5, 1.5}

Out[2]= {1.5}

```

---

<div class="post-metadata">

**Author:** ![henrikschachner](https://yyz1.discourse-cdn.com/wolfram/user_avatar/community.wolfram.com/henrikschachner/32/32119_2.png) [@henrikschachner](https://community.wolfram.com/u/henrikschachner)\
**Post date:** [November 24, 2014, 11:37pm UTC](https://community.wolfram.com/t/question-on-evalution/4111/3 "2014-11-24T23:37:34Z")

</div>

Many thanks for this quick and profound answer, Ilian!

I was wrongly looking at the attributes of Sequence[] and Apply[] …

Henrik
