home *** CD-ROM | disk | FTP | other *** search
/ NetNews Usenet Archive 1992 #18 / NN_1992_18.iso / spool / comp / lang / scheme / 2051 < prev    next >
Encoding:
Internet Message Format  |  1992-08-19  |  1.0 KB

  1. Path: sparky!uunet!snorkelwacker.mit.edu!ai-lab!zurich.ai.mit.edu!jinx
  2. From: jinx@zurich.ai.mit.edu (Guillermo J. Rozas)
  3. Newsgroups: comp.lang.scheme
  4. Subject: Re: Initializing vector elements
  5. Message-ID: <JINX.92Aug19091513@chamarti.ai.mit.edu>
  6. Date: 19 Aug 92 13:15:13 GMT
  7. References: <PK.92Aug19100516@talitiainen.cs.tut.fi>
  8.     <MFX.92Aug19102656@lenin.cs.tu-berlin.de>
  9. Sender: news@ai.mit.edu
  10. Reply-To: jinx@zurich.ai.mit.edu
  11. Distribution: comp
  12. Organization: M.I.T. Artificial Intelligence Lab.
  13. Lines: 15
  14. In-reply-to: mfx@cs.tu-berlin.de's message of 19 Aug 92 08:27:30 GMT
  15.  
  16. In article <MFX.92Aug19102656@lenin.cs.tu-berlin.de> mfx@cs.tu-berlin.de (lala) writes:
  17.  
  18. |   You are nearly right -- IMHO, the Right Way is to give the init
  19. |   procedure the index of the element to create:
  20. |
  21. |    (define m (make-vector 10 (lambda (i) (make-vector 10 0))))
  22. |
  23. |   like, in,
  24. |
  25. |      (make-vector 10 identity) => #(0,1,2,3,4,5,6,7,8,9)
  26. |
  27.  
  28. This procedure exists in certain dialects.  In MIT Scheme it is called
  29. MAKE-INITIALIZED-VECTOR.
  30.  
  31.