home *** CD-ROM | disk | FTP | other *** search
/ NetNews Usenet Archive 1992 #27 / NN_1992_27.iso / spool / comp / lang / function / 1372 < prev    next >
Encoding:
Internet Message Format  |  1992-11-15  |  991 b 

  1. Path: sparky!uunet!zaphod.mps.ohio-state.edu!pacific.mps.ohio-state.edu!linac!att!att!allegra!alice!ark
  2. From: ark@alice.att.com (Andrew Koenig)
  3. Newsgroups: comp.lang.functional
  4. Subject: Re: ml questions
  5. Message-ID: <24205@alice.att.com>
  6. Date: 16 Nov 92 05:59:29 GMT
  7. Article-I.D.: alice.24205
  8. References: <BxrLL9.A11@csn.org>
  9. Reply-To: ark@alice.UUCP ()
  10. Organization: AT&T Bell Laboratories, Murray Hill NJ
  11. Lines: 18
  12.  
  13. In article <BxrLL9.A11@csn.org> sullivan@teal.csn.org (Steve Sullivan) writes:
  14.  
  15. > 1. The sml I'm using, from princeton.edu, includes Harper's notes.
  16. > His notes document the "system" and "cd" commands.
  17. > Yet sml apparently doesn't recognize them.  How can I get them working?
  18.  
  19. They're there, but buried in structures.  Try System.system
  20. and System.Directory.cd
  21.  
  22. > 2.  How can I get a function to remember state?
  23.  
  24. A simple example -- perhaps too simple:
  25.  
  26.     val seed = ref 1;
  27.     fun rand() = (seed := (xx * !seed) mod yy; !seed);
  28. -- 
  29.                 --Andrew Koenig
  30.                   ark@europa.att.com
  31.