INSERT - faster insertion of object into a list, by Joe Horn. --> S/SX/G/GX The INSERT program on Goodies Disk #8 is fast, but it's in User RPL. Here's the System RPL equivalent. It's 3.5 times faster! WARNING: It does NO OBJECT TYPE CHECKING and will crash if used with improper or insufficient input. It is intended for use only within programs when the stack contents are in a known state. You can easily use Jazz to add type checking if you need it. INPUT: 3: List 2: Desired Position 1: Object OUTPUT: 1: List with Object at Desired Position EXAMPLE: 3: { a b c d e } 2: 4 1: 888 INSERT --> { a b c 888 d e } Source Code: :: ROT INNERCOMP #1+DUP #1+ROLL OVERDUP #3+ ROLL COERCE #- #2+UNROLL {}N ; It inserts -1 into { 1 2 3 ... 998 999 1000 } at position 888 in less than .8 seconds on a GX. -jkh-