Am Di., 7. März 2023 um 11:29 Uhr schrieb John Cowan <[email protected]>:
>
>
>
> On Tue, Mar 7, 2023 at 1:52 AM Marc Nieper-Wißkirchen <[email protected]> 
> wrote:
>
>> This tells me that generators should have their names end with "!".
>
>
> We don't normally use "!" when there is no opposition between functional and 
> non-functional versions.  Thus we don't for example write `read!` or 
> `newline!`, since there is nothing you can do with a port that doesn't 
> involve mutating it.

For ports, this is probably attributable to history.  See the naming
of arguments to, say, make-custom-textual-input-port in R6RS.  They
don't have to carry historical baggage and end in "!" if they
conceptually mutate locations.

R6RS and R7RS both speak of modification of locations when they
explain the "!" convention.

It is easy to make mistakes with generators when the order of
invocation matters, and the "!" would at least warn the programmer.

Reply via email to