home *** CD-ROM | disk | FTP | other *** search
/ NetNews Usenet Archive 1992 #27 / NN_1992_27.iso / spool / comp / lang / scheme / 2609 < prev    next >
Encoding:
Internet Message Format  |  1992-11-18  |  1.3 KB

  1. Path: sparky!uunet!cs.utexas.edu!zaphod.mps.ohio-state.edu!caen!umeecs!umn.edu!csus.edu!ucdavis!toadflax!beard
  2. From: beard@toadflax.cs.ucdavis.edu (Patrick C. Beard)
  3. Newsgroups: comp.lang.scheme
  4. Subject: Re: case sensitivity
  5. Message-ID: <19398@ucdavis.ucdavis.edu>
  6. Date: 19 Nov 92 07:22:12 GMT
  7. References: <1992Nov6.062357.8865@Informatik.TU-Muenchen.DE> <9211122110.AA06534@corn-pops>
  8. Sender: usenet@ucdavis.ucdavis.edu
  9. Organization: Department of Computer Science, University of California, Davis
  10. Lines: 40
  11.  
  12. In article <9211122110.AA06534@corn-pops> Alan@lcs.mit.EDU (Alan Bawden) writes:
  13.  
  14. >  (string->symbol "foo;comment")
  15. >
  16. >and
  17. >
  18. >  (string->symbol "foo")
  19. >
  20. >are different.
  21. >
  22. >`string->symbol' isn't the reader (the thing that constructs Scheme objects
  23. >given their printed representations).  The thing you are looking for might
  24. >perhaps be called `string->object', but standard scheme doesn't have it.
  25. >Perhaps it should.
  26. >
  27. >                - Alan
  28.  
  29. Gambit Scheme 1.9 has "string ports." These CAN be used to do exactly
  30. what you are saying. An example:
  31.  
  32. Gambit (v1.9)
  33.  
  34. : (define ip (open-input-string "(a b c) 'XyZ"))
  35. ip
  36.  
  37. : (read ip)
  38. (a b c)
  39.  
  40. : (read ip)
  41. 'xyz
  42.  
  43. : (read ip)
  44. #[eof]
  45.  
  46. This does exactly what you want.
  47.  
  48.  
  49. // Patrick C. Beard
  50. // Department of Computer Science, U. C. Davis
  51. // pcbeard@ucdavis.edu
  52.