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!news.eternal-september.org!mx02.eternal-september.org!.POSTED!not-for-mail From: Simon Wright Newsgroups: comp.lang.ada Subject: Re: GNAT.Serial_Communication and Streams Date: Tue, 24 Nov 2015 10:28:20 +0000 Organization: A noiseless patient Spider Message-ID: References: Mime-Version: 1.0 Content-Type: text/plain Injection-Info: mx02.eternal-september.org; posting-host="fa1ef3748c46c80a9a627d7896b0bfd1"; logging-data="24783"; mail-complaints-to="abuse@eternal-september.org"; posting-account="U2FsdGVkX191bM1RymNOxhUYUdr0D38Fd3YhybiIeQc=" User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/24.5 (darwin) Cancel-Lock: sha1:CMdXO9yFsKV5ujHs9nfoLnZb0nQ= sha1:EoHpUGma8e/rkXeiBomnNUJXNSo= Xref: news.eternal-september.org comp.lang.ada:28518 Date: 2015-11-24T10:28:20+00:00 List-Id: "Dmitry A. Kazakov" writes: > I don't see anything wrong with the original code. Stream attributes > not to be trusted in general. An explicit conversion is clearer and > cleaner, IMO. GNAT used to write strings to streams character-by-character, which is seriously non-optimal (practically; if an exception occurs, who cares on which character it happened?!) But if you can't trust your compiler to write a string to a stream, what can you trust it to do? I wholly agree with "trust, but verify", though!