home *** CD-ROM | disk | FTP | other *** search
/ NetNews Usenet Archive 1992 #31 / NN_1992_31.iso / spool / comp / lang / apl / 1257 < prev    next >
Encoding:
Text File  |  1992-12-22  |  1.3 KB  |  44 lines

  1. Newsgroups: comp.lang.apl
  2. Path: sparky!uunet!spool.mu.edu!umn.edu!csus.edu!sfsuvax1.sfsu.edu!emclean
  3. From: emclean@sfsuvax1.sfsu.edu (Emmett McLean)
  4. Subject: Can the interation index be accessed in u^: n ?
  5. Message-ID: <1992Dec22.110411.19261@csus.edu>
  6. Sender: news@csus.edu
  7. Organization: San Francisco State University
  8. Distribution: NA
  9. Date: Tue, 22 Dec 1992 11:04:11 GMT
  10. Lines: 32
  11.  
  12. NB. 
  13. NB.    I find that in for statments it is often useful to have
  14. NB.    access to the interation index, but I haven't found
  15. NB.    how to access it. So have cooked up the following 
  16. NB.    example to illustrate my point.  One third of the
  17. NB.    time the verb h returns y. appended with half of the
  18. NB.    tail of y. ,  one third of the time y. with double of the 
  19. NB.    tail of y. appended, and one third of the time it returns
  20. NB.    y. with 1000 times the interation index appended. 
  21. NB.    Unfortunately, and not suprisingly, my attempt below
  22. NB.    yeilds a value error since $.  is only implicitly assigned
  23. NB.    to i. ns . I can easily imagine that one can not access the 
  24. NB.    interation index but perhaps someone else has some ideas,
  25. NB.    like on how to assign and access $. ?
  26.  
  27. Thanks,
  28.  
  29. Emmett emclean@sfsuvax1.sfsu.edu
  30.  
  31.    v =.''&$@:(1&?)@(3"_)
  32.    s =. , -:@{:
  33.    t =. , +:@{:
  34.    r =. , (1000&*)@#@$.
  35.    h =.  s`t`r@.v
  36.    h 2
  37. 2 1
  38.    h 2
  39. 2 4
  40.    h 2
  41. 2 4
  42.    h^:10 (2)
  43. value error
  44.