home *** CD-ROM | disk | FTP | other *** search
/ NetNews Usenet Archive 1992 #27 / NN_1992_27.iso / spool / comp / sys / hp48 / 5914 < prev    next >
Encoding:
Internet Message Format  |  1992-11-24  |  1.5 KB

  1. Path: sparky!uunet!zaphod.mps.ohio-state.edu!sdd.hp.com!elroy.jpl.nasa.gov!nntp-server.caltech.edu!nntp-server.caltech.edu!tim
  2. From: tim@nijinsky.ipac.caltech.edu (Tim Conrow)
  3. Newsgroups: comp.sys.hp48
  4. Subject: Re: Inserting an object in a list
  5. Date: 23 Nov 92 14:31:01
  6. Organization: California Institute of Technology
  7. Lines: 30
  8. Message-ID: <TIM.92Nov23143101@nijinsky.ipac.caltech.edu>
  9. References: <TIM.92Nov18161944@nijinsky.ipac.caltech.edu> <MHEISKAN.92Nov201113
  10.     <2b0f36c6.2217.2comp.sys.hp48.1@hpcvbbs.cv.hp.com>
  11. NNTP-Posting-Host: nijinsky.ipac.caltech.edu
  12. In-reply-to: akcs.joehorn@hpcvbbs.cv.hp.com's message of Sun, 22 Nov 1992 07:40:02 GMT
  13.  
  14. Mika Heiskanen and Joe Horn have both conbtributed code and comments
  15. (either in email or on the net) to this discussion and after thinking
  16. them over and playing around some more, the following is what I came
  17. up with. Comments welcome. I've included extra code for making it
  18. reasonably safe. I call it LINS (ListINSert).
  19.  
  20. Disclaimer: I can't break it, but you might be able to. If you do,
  21. don't blame me.
  22.  
  23. %%HP: T(3)A(D)F(.);
  24. @ LINS;  {} %i obj --> {}'
  25. @ Insert obj into list {} AFTER element %i. 
  26. @ %i<= 0 inserts at head of the list,
  27. @ %i > SIZE of {} appends to the end of the list.
  28. @ "{1 2 3 5 6 7} 3 4 LINS" requires ~ .016 sec.s as best as I can measure it.
  29. @ 52.5 Bytes, Checksum = #411h
  30. "::
  31.  CK3&Dispatch
  32.  # 510
  33.  ::
  34.   ROT INNERDUP #2+ROLL OVER #3+ ROLL COERCE 3PICKSWAP OVER #MIN
  35.   #- #2+UNROLL #1+ {}N
  36.  ;
  37. ;"
  38.  
  39. Thanks for the help, y'all!
  40.  
  41. -- Tim
  42.  
  43. PS. I used Detlef Mueller's RPL library. Thanks Detlef!
  44.