Go to the first, previous, next, last section, table of contents.


last

Function: last { list n -> list }
file: 10-C-lists.muf
package: muf
status: alpha

The last function returns the last n cons cells in the given list.

If n is greater than the list length, the list is returned.

If n is zero, the cdr of the final cell is returned.

It is an error to supply a negative n.

Stack:
'a' 'b' cons 0 last
Stack: 'b'
pop [ 'a' 'b' ]l 1 last car
Stack: 'b'
pop [ 'a' 'b' ]l 2 last car
Stack: 'a'


Go to the first, previous, next, last section, table of contents.