guile-user
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: guile can't find a chinese named file


From: David Kastrup
Subject: Re: guile can't find a chinese named file
Date: Mon, 27 Feb 2017 13:09:45 +0100
User-agent: Gnus/5.13 (Gnus v5.13) Emacs/26.0.50 (gnu/linux)

Andy Wingo <address@hidden> writes:

> On Mon 27 Feb 2017 10:10, David Kastrup <address@hidden> writes:
>
>>> String ports have nothing to do with the discussion AFAIU.  (Ports in
>>> Guile are sequences of bytes also.  They may be accessed using
>>> textual interfaces as well.
>>
>> They can _only_ be accessed using textual interfaces.  They are
>> character-in/character-out.
>
> You misunderstand what Guile ports are.

The topic was "string ports".  String ports and soft ports operate on
characters and strings in Guile's encoding which makes a separate
reencoding pass both error-prone as well as inefficient.  In particular
since one use of string ports is reading sexps which involves frequent
peek/unget operations for which Guile reencodes characters only to
decode them right again on the next read.

> I seriously invite you to read the fine manual, specifically the first
> four subsections of this node:
>
>   
> https://www.gnu.org/software/guile/docs/master/guile.html/Input-and-Output.html

The number of errors I reported with regard to Guile's string and port
handling (and which ultimately got fixed) as well as the fact that I did
all of the low-level work for migrating probably the largest existing
Guile-based application from Guile-1.8 to Guile-2.0 makes it somewhat
unlikely that my thoughts are merely the outcome of incompetency.

Where in

(with-output-to-string
  (format #t "~s\n" (make-list 42)))

do you see an encoding inherent?  From the Scheme side of things, it is
characters and strings which are involved here exclusively.  Reencoding
into an external coding system does not make sense here.  The situation
is similar for soft ports.

-- 
David Kastrup




reply via email to

[Prev in Thread] Current Thread [Next in Thread]