Path: utzoo!news-server.csri.toronto.edu!cs.utexas.edu!usc!snorkelwacker.mit.edu!ai-lab!fruit-and-fibre!bson From: bson@fruit-and-fibre.ai.mit.edu (Jan Brittenson) Newsgroups: comp.sys.handhelds Subject: Re: HP48 Vectors to Array? Keywords: HP-48SX Message-ID: <13845@life.ai.mit.edu> Date: 9 Mar 91 06:59:16 GMT References: <1991Mar8.211004.27380@NCoast.ORG> Sender: news@ai.mit.edu Distribution: comp.sys.handhelds Organization: nil Lines: 27 In a posting of [8 Mar 91 21:10:04 GMT] ppetto@NCoast.ORG (Peter Petto) writes: >An HP-48SX question ... I would like to combine two vectors >into an array as follows > > [ 2 4 6 8 ] plus [ 2 9 27 81 ] > > to get > > [[ 2 4 6 8 ] > [ 3 9 27 81 ]] How about: << SWAP ARRY-> LIST-> DROP DUP 2 + ROLL ARRY-> LIST-> DROP DUP 2 + ROLL + 2 SWAP OVER / OVER ->LIST ->ARRY >> Assuming the sum of the vector sizes is even. -- Jan Brittenson bson@ai.mit.edu Read my lisp: no new classes!