OpenMusic Reference
first-n

first-n
(lists module) -- returns the first n elements of a list
Syntax
first-n list n
Inputs
| name | data type(s) | comments | 
|---|---|---|
| list | a tree | |
| n | a non-negative integer | 
Output
| output | data type(s) | comments | 
|---|---|---|
| first | a tree | 
Description
Returns the first n elements of the list . If n is longer than the length of list , the entire list is returned.
![]()  | 
    
This function is not identical to the LISP function first . first-n always returns a list even if asked to return just one element.
—|—
| Prev | Home | Next | 
|---|---|---|
| first | Up | flat | 
