[gambit-list] Character encoding and the repl

Marc Feeley feeley at iro.umontreal.ca
Sun May 31 10:21:39 EDT 2015


The functionnality is in the Gambit runtime system to configure the printer to escape characters based on a user preference (max-unescaped-char in the readtable) and also based on the output port character encoding.  Your proposed -:E127 command-line runtime options would add another way to customize the printer based on user preference, which shouldn’t be too hard to add but would still require user intervention.

So the real issue is what should the default be.  You favour “safe by default” (i.e. external representation of Scheme chars, strings, symbols is always in pure ASCII regardless of the output port), and I can appreciate its value.  But I can also appreciate the value of seeing literal non-ASCII characters in code without the escapes, for example:

  > (define (f x) (string-append "déjà " x))       
  > (println (f "vu"))
  déjà vu
  > (pp f)
  (lambda (x) (string-append "déjà " x))

instead of

  (lambda (x) (string-append "d\351j\340 " x))

It makes editing and debugging code more pleasant for programs manipulating text other than english.

So I’d like to hear what other people think the default should be.

Marc


> On May 31, 2015, at 7:14 AM, Adam <adam.mlmb at gmail.com> wrote:
> 
> I would primarily suggest that a command line option would be added that configures the escaping e.g. -:E  , -:E127 (or maybe -:T127 for terminal and -:F127 for files).
> 
> Secondarily I would suggest reverting lib/_io.scm:13119 back to (##integer->char 127) i.e. escape all >127 again, as at least I find this to be really more a "safe by default" behavior.
> 
> 
> Anyone else has any thoughts on this topic?
> 

-------------- next part --------------
A non-text attachment was scrubbed...
Name: smime.p7s
Type: application/pkcs7-signature
Size: 4839 bytes
Desc: not available
URL: <http://mailman.iro.umontreal.ca/pipermail/gambit-list/attachments/20150531/5bcfec17/attachment.bin>


More information about the Gambit-list mailing list