home *** CD-ROM | disk | FTP | other *** search
/ NetNews Usenet Archive 1992 #26 / NN_1992_26.iso / spool / comp / lang / scheme / 2534 < prev    next >
Encoding:
Internet Message Format  |  1992-11-05  |  1.6 KB

  1. Path: sparky!uunet!pipex!unipalm!uknet!mcsun!news.funet.fi!news.cs.tut.fi!tut!pk
  2. From: pk@cs.tut.fi (Kellom{ki Pertti)
  3. Newsgroups: comp.lang.scheme
  4. Subject: Re: Code is not portable across case folding methods
  5. Message-ID: <PK.92Nov5142038@talitiainen.cs.tut.fi>
  6. Date: 5 Nov 92 14:20:38 GMT
  7. References: <3432@mitech.com>
  8. Organization: Tampere Univ. of Technology, Finland.
  9. Lines: 30
  10. NNTP-Posting-Host: talitiainen.cs.tut.fi
  11. In-reply-to: gjc@mitech.com's message of 4 Nov 92 18:19:55 GMT
  12.  
  13. In article <3432@mitech.com> gjc@mitech.com (George J. Carrette) writes:
  14.    I hate to say it guys, but this is already enough
  15.    freedom to blow away code portability, as long
  16.    as a program can call READ at runtime.
  17.  
  18. I have run into this, but in a different way: I have a Scheme reader
  19. that reads Scheme expressions, and returns a data structure that is
  20. basically the s-expression with information about where in the source
  21. file the expression was. The reader uses string->symbol to make a
  22. symbol out of the string it has read, but for example in sci I get
  23.  
  24.   (string->symbol "define") => \d\e\f\i\n\e
  25.  
  26. So, I must prepare for different preferred cases with a kludge (IMHO):
  27.  
  28. ;;;
  29. ;;; Are symbols converted to upper case, lower case or not converted?
  30. ;;; 
  31.  
  32. (define *psd-preferred-case*
  33.   (cond ((string=? (symbol->string 'Foo) "foo")
  34.      'lowercase)
  35.     ((string=? (symbol->string 'Foo) "FOO")
  36.      'uppercase)
  37.     (else 'original-case)))
  38.  
  39. --
  40. Pertti Kellom\"aki (TeX format)  #       These opinions are mine, 
  41.   Tampere Univ. of TeXnology     #              ALL MINE !
  42.       Software Systems Lab       #  (but go ahead and use them, if you like)
  43.