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!.POSTED!not-for-mail From: Simon Wright Newsgroups: comp.lang.ada Subject: Re: Ada x Datagram Sockets Date: Sun, 10 Feb 2019 17:54:19 +0000 Organization: A noiseless patient Spider Message-ID: References: <47f17695-f9a5-4024-b2da-3f13209dc4fd@googlegroups.com> <818f5ff4-f18d-42b8-950d-9b597c012aa4@googlegroups.com> <62406dfb-54c9-4db3-b461-0ad72d4a782c@googlegroups.com> Mime-Version: 1.0 Content-Type: text/plain Injection-Info: reader02.eternal-september.org; posting-host="22bfe39bbd4ccdb1e7240d5098a44885"; logging-data="23204"; mail-complaints-to="abuse@eternal-september.org"; posting-account="U2FsdGVkX1/SiDzDUC5TcetfgyZVWZqlGSQ17xGGsXA=" User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/26.1 (darwin) Cancel-Lock: sha1:aaRL9KOsXXwRaeJdEiib7Oj4h8I= sha1:8XdJzx+30kiNTg8+gUZG+3q1RbE= Xref: reader01.eternal-september.org comp.lang.ada:55482 Date: 2019-02-10T17:54:19+00:00 List-Id: "Randy Brukardt" writes: > "Simon Wright" wrote in message > news:lyef8iy9dj.fsf@pushface.org... >> "Randy Brukardt" writes: >> >>> Note that Ada 2020 will have a package FIFO_Streams >> >> Names are in short supply - but - is there an implication there that >> streams in general need not be FIFO? (I can just about see that you >> might have some form of FIFO-within-priority ordering, though that >> does seem to be a bit of a perversion of the underlying idea) > > We tried a lot of names and FIFO was the winner. I'm not sure it is > very descriptive of what the package actually does. I called it Memory_Streams, e.g. https://github.com/simonjwright/coldframe/blob/master/lib/coldframe-memory_streams.ads The main use was to allow messages for UDP streams to be prepared simply, as discussed above, so the typical usage was declare a Memory_Stream instance of the appropriate size begin fill the Memory_Stream instance write its contents to the UDP stream[1] end A further benefit of using streams was that we were communicating between machines of different endianness, and GNAT contains an optional stream implementation that will transparently convert to/from network byte order. [1] not sure that FIFO_Streams offers this without copying the contents out?