Places in Scheme Marc Nieper-Wißkirchen 19 Aug 2022 10:42 UTC

Am Fr., 19. Aug. 2022 um 12:25 Uhr schrieb Lassi Kortela <xxxxxx@lassi.io>:
>
> > See the message at
> > https://srfi-email.schemers.org/srfi-17/msg/2778561/  and the following
> > discussion for why there are good arguments against a SRFI-17-style
> > addition to Scheme.  I definitely subscribe to these arguments. Per,
> > the author of SRFI 17, does not. But we already had such a discussion
> > and continuing it should happen somewhere else.
>
> There are two distinct questions here:
>
> 1) Should set! be able to set things other than variables?
>
> 2) Should references/places be first-class or implied?
>
> By my reading, your argument is that Scheme is cleaner (from a
> functional programming standpoint?) if references/places are first class.

A locative is a first-class object.

A place would be, like a variable, not first-class.

"set!" in Scheme is syntax and does not mutate its argument (which is
some syntax) but the location which the syntactic argument references.

"set-car!" (and friends) are procedures taking a first-class
(evaluated) argument and mutating it.

It's not about that all entities should be first-class. Variables
aren't, for example.

As I don't want to repeat all arguments, let me cite one I find
compelling: https://srfi-email.schemers.org/srfi-17/msg/2778611/.