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