[Oberon] Streams.

Charles Perkins chuck at kuracali.com
Thu Apr 22 21:34:35 CEST 2021


I was just wishing for streams in Project Oberon so this is timely for me.

I observe that the AOS/A2/Bluebottle Oberon code appears self contained
(relying only on SYSTEM) and well-factored but it does use A2 OBJECT
definitions to implement the stream functionality.

I wonder how much trouble it would be to convert those OBJECTS with
PROCEDURES into RECORDS containing PROCEDURE variables.

Best Regards,
Chuck

On Thu, Apr 22, 2021 at 8:36 AM <peter at easthope.ca> wrote:

> Hi,
>
> Background
> Studying Oberon.Mail.Mod in ETH Oberon and use of Streams therein.
>
> I wondered about the purpose and necessity of the Streams module.
> Didn't find an explanation in Oberon.  The comment in A2 is helpful.
>
> MODULE Streams;   (** AUTHOR "pjm/be"; PURPOSE "I/O buffering and
> formatted writing and reading"; *)
>
> In Oberon.Mail.Mod
>   ...
>   PROCEDURE AddMsgHead(pos: SIGNED32);
>   ...
>   S := Streams.OpenFileReader(msgsF, pos);
>
> That opens the messages file, msgsF. Appears that the file is not
> closed before "END AddMsgHead".
>
> Is that good practice?  Shouldn't msgsF be closed by the end of the
> procedure?
>
> Opening the msgsF at each reading of the head of a message seems
> inefficient. Why not open the file when the module is loaded?  Then
> set the rider when necessary.
>
> Ref. https://svn.inf.ethz.ch/svn/lecturers/a2/trunk/source/
> userid  infsvnh.anonymous
> password  anonymous
>
> TIA,                          ... P.
>
>
>
> --
> VoIP: +1 604 670 0140            Bcc: peter at easthope. ca
>
> --
> Oberon at lists.inf.ethz.ch mailing list for ETH Oberon and related systems
> https://lists.inf.ethz.ch/mailman/listinfo/oberon
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.inf.ethz.ch/pipermail/oberon/attachments/20210422/95952729/attachment.html>


More information about the Oberon mailing list