XLISP fourth

Nyquist / XLISP 2.0 - Contents | Tutorials | Examples | Reference

# fourth

Type: | - | function (subr)
Source: | - | xlinit.c

## Syntax

(fourth expr)
  expr - a list or list expression
  returns - the fourth element of the list

## Description

The 'fourth' function returns the fourth element of a list or list expression. If the list is NIL , NIL is returned.

## Examples

    (fourth '(1 2 3 4 5))                    ; returns 4
    (fourth NIL)                             ; returns NIL
    (setq kids '(junie vickie cindy chris))  ; set up variable KIDS
    (first kids)                             ; returns JUNIE
    (second kids)                            ; returns VICKIE
    (third kids)                             ; returns CINDY
    (fourth kids)                            ; returns CHRIS
    (rest kids)                              ; returns (VICKIE CINDY CHRIS)

Note: This function is set to the same code as cadddr.

See the fourth function in the XLISP 2.0 manual.

Back to Top

Nyquist / XLISP 2.0 - Contents | Tutorials | Examples | Reference