From mboxrd@z Thu Jan 1 00:00:00 1970 X-Spam-Checker-Version: SpamAssassin 3.4.4 (2020-01-24) on polar.synack.me X-Spam-Level: X-Spam-Status: No, score=-1.9 required=5.0 tests=BAYES_00 autolearn=unavailable autolearn_force=no version=3.4.4 Path: eternal-september.org!reader01.eternal-september.org!reader02.eternal-september.org!.POSTED!not-for-mail From: "J-P. Rosen" Newsgroups: comp.lang.ada Subject: Re: [ANN] List_Image v0.2.0 Date: Fri, 2 Feb 2018 06:25:27 +0100 Organization: Adalog Message-ID: References: <575826a1-c983-49aa-95e2-54048f6b7b5b@googlegroups.com> <3b72aae1-7ff4-48a9-a154-f17cd6784334@googlegroups.com> <7f5fec97-6ae6-4833-87df-77aac5a8e4ff@googlegroups.com> Mime-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit Injection-Date: Fri, 2 Feb 2018 05:25:25 -0000 (UTC) Injection-Info: reader02.eternal-september.org; posting-host="46f50d1ac502ff4942d14b6db844da79"; logging-data="28379"; mail-complaints-to="abuse@eternal-september.org"; posting-account="U2FsdGVkX1/0s7t4dMmbvVJxovUxfZdm" User-Agent: Mozilla/5.0 (Windows NT 10.0; WOW64; rv:52.0) Gecko/20100101 Thunderbird/52.5.2 In-Reply-To: Content-Language: fr Cancel-Lock: sha1:AyK/ulVkRTbWOIuA0JZZTXaUP30= Xref: reader02.eternal-september.org comp.lang.ada:50272 Date: 2018-02-02T06:25:27+01:00 List-Id: Le 01/02/2018 à 21:26, Dennis Lee Bieber a écrit : > And how will this support, say, a file created under Linux, which is > being processed under Windows? One either has to be able to specify the EOL > convention for each file, convert the EOL convention before using the file, > or have the language attempt to determine the EOL convention at run-time > and make the suitable adjustments. In Python, a file opened for "text" > mode, running on Windows, has in text converted to during > output -- on Linux, there is no real difference between text and binary, > is not expanded during output. And if one does not know the > convention, there is "universal newline" mode, which attempts to guess the > convention based upon what is found within the first few blocks of the > file. Note that at this point, it's no more a language issue. The problem would be exactly the same in C or whatever. When you say Python does the right thing, you mean the Python implementation you tried, right? AFAIK there is no such thing as a Python standard. And if you think of particular implementations, Gnat does the same thing: it accepts pretty much any possible line terminator. -- J-P. Rosen Adalog 2 rue du Docteur Lombard, 92441 Issy-les-Moulineaux CEDEX Tel: +33 1 45 29 21 52, Fax: +33 1 45 29 25 00 http://www.adalog.fr