to make them more flexible you might add a number to skip butfirst: func [series length] [copy skip series length] butlast: func [series length] [copy/part series (length? series) - length]
>> s: [1 2 3 4 5 6 7] == [1 2 3 4 5 6 7] >> butlast butfirst s 2 2 == [3 4 5] On 11/22/05, Graham Chiu <[EMAIL PROTECTED]> wrote: > > > butfirst: func [ series ][ > copy next > ] > > is shorter .. so short, one wonders if it needs to be a function :) > > > On 11/23/05, Jean-Francois Allie <[EMAIL PROTECTED]> wrote: > > > > > > Thanks Volker, > > > > It's proof I can't see straight anymore and that I should go home. > > > > Seems to work now. > > > > butlast: func [series] [ > > copy/part series (length? series) - 1] > > > > butfirst: func [series] [ > > copy/part next series (length? series) - 1] > > > > >>num: [1 2 3 4] > > =3D=3D [1 2 3 4] > > >>butlast num > > =3D=3D [1 2 3] > > >> butfirst num > > =3D=3D [2 3 4] > > >>butfirst butlast num > > =3D=3D [2 3] > > >> butlast butfirst num > > =3D=3D [2 3] > > > > > > By the way, are there more Rebolish, efficient or elegant way's to do > it? > > -- > > To unsubscribe from the list, just send an email to > > lists at rebol.com with unsubscribe as the subject. > > > > > > > -- > Graham Chiu > -- > To unsubscribe from the list, just send an email to > lists at rebol.com with unsubscribe as the subject. > > -- ... nice weather eh -- To unsubscribe from the list, just send an email to lists at rebol.com with unsubscribe as the subject.
