Skip to content

Rest

Status: Stable

documented, exercised by the test suite and/or worked examples, with no known limitations recorded.

Description

Rest[expr] gives all but the first element of expr.

Examples

All examples below are verified against the current Mathilda build.

In[1]:= First[<|"a" -> 10, "b" -> 20|>]
Out[1]= 10

In[2]:= Rest[<|"a" -> 10, "b" -> 20, "c" -> 30|>]
Out[2]= <|"b" -> 20, "c" -> 30|>

In[3]:= Take[<|"a" -> 1, "b" -> 2, "c" -> 3|>, 2]
Out[3]= <|"a" -> 1, "b" -> 2|>

Implementation notes

Algorithm. builtin_rest returns a copy of the input with its first element dropped: it copies args 1 .. nāˆ’1 into a new function node with the same head. Returns NULL (unevaluated) for atoms or empty expressions.

Attributes: none registered.

Implementation status

Stable — documented, exercised by the test suite and/or worked examples, with no known limitations recorded.

References

Notes & additional examples

Worked examples

In[1]:= Rest[{a,b,c,d}]
Out[1]= {b, c, d}

Notes

Rest[expr] drops the first element; it is the complement of First.