Group Abstract Group Abstract

Message Boards Message Boards

0
|
3.8K Views
|
2 Replies
|
0 Total Likes
View groups...
Share
Share this post:
GROUPS:

Question on evalution

POSTED BY: Henrik Schachner
2 Replies

Many thanks for this quick and profound answer, Ilian!

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

Henrik

POSTED BY: Henrik Schachner

If has the HoldRest attribute, which prevents the evaluation of Apply (@@). It does not have the SequenceHold attribute which would prevent the Sequence[] splicing.

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

Out[2]= {1.5}
POSTED BY: Ilian Gachevski
Reply to this discussion
Community posts can be styled and formatted using the Markdown syntax.
Reply Preview
Attachments
Remove
or Discard