From c@@rd|@g@bor @end|ng |rom gm@||@com  Tue Jun  8 11:59:11 2021
From: c@@rd|@g@bor @end|ng |rom gm@||@com (=?UTF-8?B?R8OhYm9yIENzw6FyZGk=?=)
Date: Tue, 8 Jun 2021 11:59:11 +0200
Subject: [Rd] Non-mutable ALTREP objects
Message-ID: <CABtg=K=Wru6wLn8J-BcZXYs0XiTj2yhXp-_6SV0XDpO20g8kEg@mail.gmail.com>

Dear all,

I have another ALTREP question. In the
https://github.com/ALTREP-examples/Rpkg-simplemmap example, it is
possible to mmap a file read-write with wrtOK = TRUE.

This is a pretty cool use case, one can change the mapped vector (in
C), and the change is synchronized with the file, and also other
processes that map the same file.

On the other hand, I wonder if it violates some contract, because it
means that an R object might change without any code touching it, if
the mapped file is updated from another R session or through another
variable.

Does this violate the pass by value semantics?

Can this cause issues in the interpreter or the byte code compiler? Or
is there some guarantee that evaluating these objects will always call
their ALTREP methods?

FWIW these objects are marked as non-mutable. Does that change anything?

Thank you,
Gabor



[Rd] Non-mutable ALTREP objects
=?UTF-8?B?R8OhYm9yIENzw6FyZGk=?=