home *** CD-ROM | disk | FTP | other *** search
/ NetNews Usenet Archive 1992 #20 / NN_1992_20.iso / spool / comp / sys / hp48 / 4502 < prev    next >
Encoding:
Internet Message Format  |  1992-09-08  |  2.2 KB

  1. Path: sparky!uunet!van-bc!rsoft!agate!usenet.ins.cwru.edu!gatech!bloom-beacon!eru.mt.luth.se!lunic!sunic!aun.uninett.no!nuug!ifi.uio.no!larsg
  2. From: larsg@ifi.uio.no (Lars Andreas Gundersen)
  3. Newsgroups: comp.sys.hp48
  4. Subject: Problems with sys-rpl word BIND, help wanted
  5. Message-ID: <1992Sep6.150602.24876@ifi.uio.no>
  6. Date: 6 Sep 92 15:06:02 GMT
  7. Organization: Dept. of Informatics, University of Oslo, Norway
  8. Lines: 51
  9. Nntp-Posting-Host: maud.ifi.uio.no
  10. Originator: larsg@maud.ifi.uio.no
  11.  
  12.  
  13. So I thought I'd learn sys-rpl to get more speed in my programs.  The
  14. first thing I tried was rewriting a small program into sys-rpl.  I
  15. just couldn't get it to work.  After some testing and trying I still
  16. couldn't make any sense of it, but I figured it might be someting with
  17. the BINDing of local variables.  I therefore wrote a little
  18. test-program:
  19.  
  20. ::
  21.  CK1NOLASTWD
  22.  CK&DISPATCH1 ZERO
  23.  ::
  24.   DEPTH NULL{}
  25.   {
  26.    ' LAM comps
  27.    ' LAM depth
  28.    ' LAM glbls
  29.   }
  30.   BIND
  31.   LAM comps
  32.   LAM depth
  33.   LAM glbls
  34.   ABND
  35.  ;
  36. ;
  37.  
  38. which I thought should follow this stack-diagram:
  39.  
  40.                 |3:              |         |3:         obj|
  41.                 |2:              | ------> |2:        <1d>|
  42.                 |1:           obj|         |1:          {}|
  43.                 ------------------         ----------------
  44.  
  45. Instead the program just swallows the obj and leaves the stack empty!
  46. Why??????  This isn't even the error(?) I had expected from the
  47. original program, which seemed to bind the object in level 1 and 3 to
  48. the two LAMnames in the LAM list, and just pop the level 2 object!?  I
  49. also thought that, if I left out the ABND, I should be able to recall
  50. the local variables after the program had terminated.  But I can't.
  51. Please someone tell me what's going on.  Thanks a lot!
  52.  
  53. Lars A. Gundersen
  54.  
  55. PS: I tried to debug it after taking away the argument checking and
  56. dispatching, but when I pressed SST to execute BIND, a lot of
  57. externals were put on the stack, and the command DEPTH returned 209698 !
  58.  
  59. PPS: The word CK<n>&DISPATCH1 should just be CK&DISPATCH1, right?
  60. There seemes to be quite a few errors in the manual, like the
  61. stack-diagram for DEPTH, which caused me a lot of frustration before I
  62. found out it was wrong.
  63.