Binary transput comments please

chris hermansen clhermansen@gmail.com
Wed Jan 7 18:38:39 GMT 2026


Sorry a bit more in relation to the below...

On Wed, Jan 7, 2026 at 8:39 AM chris hermansen <clhermansen@gmail.com>
wrote:

> Reading Lindsey's comments in AB42.4.4 I find myself a bit confused.  In
> §7 Binary transput he writes:
>
> If the book has random access, then the only way a user can find the
> location of his data, for subsequent use of "set", is for him to enquire
> about the "page number", "line number" and "char number" before he outputs
> it.  The procedures "space", "newline" and "newpage" may on occasions be
> useful for aligning data in convenient positions, but the fact that they
> work at all for binary transput is probably more due to the fact that they
> exist, than that they are useful.  This is probably why they are not
> available for use with "put bin", "get bin", etc.
>
> I'm struggling to understand how "space" etc could work for binary
> transput but not be available for use with "put bin" etc.
>
> Does anyone have any thoughts  about  that?
>

McGettrick discusses binary transput in §9.5 of Algol 68 a first and second
course.  On page 313 he states:

The procedures used to transfer information to the standard file referred
> to by "standback" are "writebin" for output and "readbin" for input.  Note
> that this file can be used for both output and input.  These procedures ...
> have as their parameters a single item or list of items similar in all
> respects [to "print" and "read"] but one to the parameter of a "read" or
> "print" statement is that procedures cannot appear as parameters.  In
> particular "space", "newline", "newpage", "backspace" etc cannot now be
> used.

One consequence of the use of binary transput is that the terminator string
> associated with a file is not used to end input of a dynamic number of
> items.  If this is attempted, e.g. by reading into a flexible array, the
> effect is to take the current size of the array and to read in that number
> of elements.  However it may still be sensible to have the terminator
> associated with a file, for many files which accept binary information can
> under the appropriate circumstances also accept character transput.
> With binary transput the event routines are still meaningful and will be
> called at the appropriate time.  Thus when the end of a line is reached the
> line end event routine is called, similar for page end, etc.


So line length and page length are known for binary files... huh.  And yet
the terminator string is not used to mark the end of a flex row.  So
writing out a large amount of binary data would span multiple rows and
potentially multiple pages and on line end and possibly on page end would
be called several times during a writebin or a readbin.

This makes me think the same must be true of character transput - writing a
string value with 256 characters associated would span several lines of a
file with 80 characters per line.  But does not the end of line terminate
reading for a string?


> And one other puzzle - should we continue to think of Book as having a
> character row at its heart, given the need to support binary and character
> moods through the same mode?  Might it not be better to think of Book as
> treating with bytes and then either Channel or more probably File dealing
> with character <-> byte conversions?
>
> Thanks in advance!
>
>
> --
> Chris Hermansen · clhermansen "at" gmail "dot" com
>
> C'est ma façon de parler.
>


-- 
Chris Hermansen · clhermansen "at" gmail "dot" com

C'est ma façon de parler.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <https://gcc.gnu.org/pipermail/algol68/attachments/20260107/363ccd35/attachment.htm>


More information about the Algol68 mailing list