READ and WROTE events

There is something called an AWAIT handler, which is essentially a callback on a PORT! to tell you about events that have happened.

I don't want to get too deep into the R3-Alpha port model, but something has always bugged me about the naming of the events you get back when a particular asynchronous READ or WRITE has happened. That's because the events are named READ and WROTE.

With WRITE and WROTE there is fortunately a spelling difference for the present and past tenses. But unfortunately READ ("reed") and READ ("red") are spelled the same for present and past.

Right now, having a tense change is not strictly necessary...as you don't get a READ-BEGIN and WRITE-BEGIN event. The only events you hear about with reading and writing are after-the-fact. (It's the port "actor" that receives the initiating requests as READ and WRITE).

So calling the events READ and WRITE would seemingly be fine, and the author of the await handler can just accept that it's after. Saying "wrote" seems cute but the inconsistent appearance makes one wonder if there's a twisted variant of READ that you should be looking for as well. I think it causes more problems than it solves, because in software we are always pronouncing READ as "reed" in our heads.

Annoyingly, I believe WRITE and WROTE are different event types.

There is the ON-* convention, though that's usually used by handler names:

switch event/type [
    on-read [
        do something
    ]
    on-write [
        do something else
    ]
]

Keeping somewhat compatible with GUI event names would be good as a rule even if a GUI is not on the horizon.

Some other thoughts would be:

did-read did-write did-click did-lookup did-open did-resize

; Shakespearian
read'd write'd click'd
read-d write-d click-d
read-ed write-ed click-ed

; something about to happen
will-read will-write will-click (currently 'down)
1 Like

@Mark-hi / @MarkEye suggested the pairings read/gotten and write/written.

I have mixed feelings here. One part of me thinks that going down this kind of creative path is part of what makes the whole project tick - to try and do deep thought and be clever with language. Another part wonders if this is just being weird for weirdness sake.

How about sent - received ?

1 Like

That seems pretty good for networking, at least! I guess the question is the more general issue of whether "transmission" terminology feels right when you're talking about I/O to other devices--for instance, a terminal.

Worth considering...