home *** CD-ROM | disk | FTP | other *** search
/ NetNews Usenet Archive 1992 #27 / NN_1992_27.iso / spool / comp / sys / hp48 / 5821 < prev    next >
Encoding:
Text File  |  1992-11-18  |  1.6 KB  |  47 lines

  1. Newsgroups: comp.sys.hp48
  2. Path: sparky!uunet!charon.amdahl.com!pacbell.com!sgiblab!darwin.sura.net!paladin.american.edu!news.univie.ac.at!hp4at!mcsun!news.funet.fi!ajk.tele.fi!funic!nntp.hut.fi!nntp.hut.fi!mheiskan
  3. From: mheiskan@hut.fi (Mika Heiskanen)
  4. Subject: Re: LISP in system RPL
  5. In-Reply-To: brianw@iat.holonet.net's message of Fri, 13 Nov 1992 22:44:43 GMT
  6. Message-ID: <MHEISKAN.92Nov18214543@lk-hp-1.hut.fi>
  7. Sender: usenet@nntp.hut.fi (Usenet pseudouser id)
  8. Nntp-Posting-Host: lk-hp-1.hut.fi
  9. Reply-To: mheiskan@vipunen.hut.fi
  10. Organization: Helsinki University of Technology, Finland
  11. References: <BxoF6K.43I@iat.holonet.net>
  12. Date: 18 Nov 92 19:45:42 GMT
  13. Lines: 32
  14.  
  15.  
  16. In article <BxoF6K.43I@iat.holonet.net> brianw@iat.holonet.net (Brian Walsh) writes:
  17.  
  18. >LISP rewritten in system RPL
  19. [...]
  20. >@ Example: { 4 5 6 }  << SQ >>  LISP  -->  { 16 25 36 }
  21. >@ Note: The process may be a program or a list.
  22.  
  23. >Well here is a system RPL version:
  24. >:: SWAP DUPLENCOMP                  @ get the size of the list
  25. >ROT { LAM '{n' LAM '{p' } BIND      @ save the list size and process
  26. >INNERCOMP reversym                  @ unpack the list
  27. >#1+_ONE_DO                          @ initialize loop
  28. >INDEX@ ROLL                         @ rearrange the stack
  29. >LAM '{p' xEVAL                      @ evaluate the process (prgm or list)
  30. >LOOP                                @ continue the loop
  31. >LAM '{n' {}N                        @ pack the results list
  32. >ABND                                @ abandon temp vars
  33. >;
  34.  
  35. Slightly shorter and faster:
  36.  
  37. ::
  38.   ' :: SWAP#1+ TRUE ;
  39.   2Ob>Seco 1LAMBIND
  40.   ZEROSWAP
  41.   :: GOTO PTR 58CF8 ;    @ The first instruction is symcomp :(
  42.   ABND {}N
  43. ;
  44.  
  45. --
  46. --> mheiskan@vipunen.hut.fi
  47.