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

  1. Path: sparky!uunet!olivea!mintaka.lcs.mit.edu!zurich.ai.mit.edu!jaffer
  2. From: jaffer@zurich.ai.mit.edu (Aubrey Jaffer)
  3. Newsgroups: comp.lang.scheme
  4. Subject: Re: random rant on random files
  5. Message-ID: <JAFFER.92Aug20105511@camelot.ai.mit.edu>
  6. Date: 20 Aug 92 15:55:11 GMT
  7. References: <9208130624.1.11214@cup.portal.com> <1992Aug17.100735.7594@physiol.su.OZ.AU>
  8. Sender: news@mintaka.lcs.mit.edu
  9. Organization: M.I.T. Artificial Intelligence Lab.
  10. Lines: 29
  11. In-Reply-To: john@physiol.su.OZ.AU's message of 17 Aug 92 10:07:35 GMT
  12.  
  13. In article <1992Aug17.100735.7594@physiol.su.OZ.AU> john@physiol.su.OZ.AU (John Mackin) writes:
  14.  
  15.    In article <9208130624.1.11214@cup.portal.com>,
  16.        vanMeule@cup.portal.COM writes:
  17.  
  18.    > I feel a little upset at Scheme for lack of direct support in 
  19.    > most Schemes for random files.
  20.  
  21.    Without in any way endorsing the original poster's desire to make
  22.    Scheme into the new COBOL :):), I too was surprised and disappointed
  23.    that R4RS Scheme doesn't have a seek function to apply to ports.  I
  24.    have an application where I need to read a (large) file line-wise
  25.    backwards, and the only Scheme I can code it in at the moment is
  26.    Scheme->C where I have access to libc.
  27.  
  28. scm4a10 offers:
  29.  
  30.   (file-position <port>)                procedure
  31.  
  32. Returns the current position of the character in <port> which will
  33. next be read or written.  If <port> is not open to a file the result
  34. is unspecified.
  35.  
  36.   (file-set-position <port> <integer>)            procedure
  37.  
  38. Sets the current position in <port> which will next be read or
  39. written.  If <port> is not open to a file the action of
  40. file-set-position is unspecified.  The result of file-set-position is
  41. unspecified.
  42.