lispLists: Functions for Lisp-like list processing

Description Usage Arguments

Description

Simple wrapper functions that allow Lisp-like list processing in R: first to fifth return the first to fifth element of the list x. rest returns all but the first element of the list x. is.empty returns TRUE iff the list x is of length 0. is.atom returns TRUE iff the list x is of length 1. is.composite returns TRUE iff the list x is of length > 1. contains return TRUE iff the list x contains an element identical to elt.

Usage

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
18
19
first(x)

rest(x)

second(x)

third(x)

fourth(x)

fifth(x)

is.empty(x)

is.atom(x)

is.composite(x)

contains(x, elt)

Arguments

x

A list or vector.

elt

An element of a list or vector.


rgp documentation built on May 30, 2017, 12:45 a.m.