A reference type Marc Nieper-Wißkirchen (18 Aug 2022 21:45 UTC)
Re: A reference type John Cowan (19 Aug 2022 01:36 UTC)
Re: A reference type Lassi Kortela (19 Aug 2022 10:03 UTC)
Re: A reference type Marc Nieper-Wißkirchen (19 Aug 2022 10:11 UTC)
Re: A reference type Lassi Kortela (19 Aug 2022 10:25 UTC)
Places in Scheme Marc Nieper-Wißkirchen (19 Aug 2022 10:42 UTC)
Re: Places in Scheme Marc Nieper-Wißkirchen (19 Aug 2022 11:36 UTC)
Re: Places in Scheme Per Bothner (19 Aug 2022 16:33 UTC)
Re: Places in Scheme Marc Nieper-Wißkirchen (19 Aug 2022 17:58 UTC)
Re: Places in Scheme Panicz Maciej Godek (25 Aug 2022 15:20 UTC)
Re: Places in Scheme Ray Dillinger (26 Aug 2022 02:29 UTC)
Re: A reference type Marc Nieper-Wißkirchen (19 Aug 2022 10:54 UTC)
Re: A reference type Marc Nieper-Wißkirchen (19 Aug 2022 11:44 UTC)
Re: A reference type Peter Bex (19 Aug 2022 12:02 UTC)
Re: A reference type Marc Nieper-Wißkirchen (19 Aug 2022 12:26 UTC)
Big words Lassi Kortela (19 Aug 2022 16:29 UTC)
Re: Big words Marc Nieper-Wißkirchen (19 Aug 2022 18:07 UTC)
Re: Big words Lassi Kortela (19 Aug 2022 20:06 UTC)
Re: Big words Marc Nieper-Wißkirchen (19 Aug 2022 20:31 UTC)
Re: Big words blake@xxxxxx (19 Aug 2022 22:06 UTC)
Re: Big words blake@xxxxxx (19 Aug 2022 22:08 UTC)
Re: Big words Arthur A. Gleckler (19 Aug 2022 18:09 UTC)
Re: Big words John Cowan (19 Aug 2022 18:39 UTC)

A reference type Marc Nieper-Wißkirchen 18 Aug 2022 21:45 UTC

I wonder whether someone would like to write a SRFI describing a
reference type. With SRFI 111/SRFI 195 we have box types, but we don't
have a box-like type that reuses an existing location.

A reference-type-SRFI could contain the following procedures:

* (reference? OBJ)  returns #t is OBJ is a reference
* (mutable-reference? OBJ) returns #t if OBJ is a reference and the
referenced value can be mutated
* (make-reference GETTER) returns a reference where GETTER is called
when the value is asked for
* (make-mutable-reference GETTER SETTER) - returns a mutable reference
with specified getter and setter
* (reference-get REF) - calls the getter of REF and returns its values
* (mutable-reference-set! REF OBJ ...) - invokes the setter of REF on
the values VAL ...

Maybe, the name mutable-reference should be changed into settable-reference.

Maybe, references without setters are not important enough so all
references should be mutable/settable.

Thanks,

Marc