2 head - create a list of specified size from the head of a list
14 If 0 <= y <= size(x), head(x,y) returns a list of size y whose
15 elements in succession have values x[[0]]. x[[1]], ..., x[[y - 1]].
17 If y > size(x), head(x,y) is a copy of x.
19 If -size(x) < y < 0, head(x,y) returns a list of size (size(x) + y)
20 whose elements in succession have values x[[0]]. x[[1]], ...,
21 i.e. a copy of x from which the last -y members have been deleted.
23 If y <= -size(x), head(x,y) returns a list with no members.
25 For any integer y, x == join(head(x,y), tail(x,-y)).
28 ; A = list(2, 3, 5, 7, 11)
31 list (2 members, 2 nonzero):
37 list (3 members, 3 nonzero):
51 ## Copyright (C) 1999 Landon Curt Noll
53 ## Calc is open software; you can redistribute it and/or modify it under
54 ## the terms of the version 2.1 of the GNU Lesser General Public License
55 ## as published by the Free Software Foundation.
57 ## Calc is distributed in the hope that it will be useful, but WITHOUT
58 ## ANY WARRANTY; without even the implied warranty of MERCHANTABILITY
59 ## or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General
60 ## Public License for more details.
62 ## A copy of version 2.1 of the GNU Lesser General Public License is
63 ## distributed with calc under the filename COPYING-LGPL. You should have
64 ## received a copy with calc; if not, write to Free Software Foundation, Inc.
65 ## 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
67 ## @(#) $Revision: 30.1 $
68 ## @(#) $Id: head,v 30.1 2007/03/16 11:10:42 chongo Exp $
69 ## @(#) $Source: /usr/local/src/cmd/calc/help/RCS/head,v $
71 ## Under source code control: 1995/07/10 02:09:30
72 ## File existed as early as: 1995
74 ## chongo <was here> /\oo/\ http://www.isthe.com/chongo/
75 ## Share and enjoy! :-) http://www.isthe.com/chongo/tech/comp/calc/