Overview Module Function Class Tea 3.2.5 Reference Documentation
© 2009 PDM&FC

Function prepend

prepend anObject aList

Creates a new list obtained by inserting a new element at the head of an existing list.

Parameters:
anObject - The object to be inserted at the head of aList.
aList - A pair object that must be the head of a list.
Returns:
A reference to a new pair object that is the head of a list where anObject is the first element and aList is the rest of that list.

The prepend function could be defined as follows:
	define prepend ( anObject aList ) {
	    cons $anObject $aList
	}
	

Overview Module Function Class Tea 3.2.5 Reference Documentation
© 2009 PDM&FC
Report a bug or request new features
© 2009