[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: initial impressions/questions

This page is part of the web mail archives of SRFI 39 from before July 7th, 2015. The new archives for SRFI 39 contain all messages, not just those from before July 7th, 2015.



> At Sun, 22 Dec 2002 22:27:45 -0500, Marc Feeley wrote:
> > > I find this line of reasoning so compelling that I now advocate the
> > > elimination of `make-mutable-parameter'.
> > 
> > You mean: parameters should be mutable according to the specified
> > semantics and "make-parameter" should create mutable parameter
> > objects, consequently "make-mutable-parameter" can be removed.
> 
> No, I meant simply that `make-mutable-parameter' should be removed,
> with `make-parameter' left alone.
> 
> So there would be no mutable parameters, because programmers can easily
> get them through mutable objects that are stored as parameter values.

But with that line of reasoning we should also eliminate mutable
lexical variables, because we can always bind them to a mutable
object.  This is beginning to sound a lot like ML's approach ("ref"
cells).

So for consistency with Scheme's current semantics, parameter objects
must be mutable.  If we were redesigning Scheme from scratch I would
be tempted to make a distinction between read-only and mutable
lexical variables, and dynamic variables.  There could be a form
to define each kind, i.e.

   (define variable value)                    ; variable is read-only
   (define-mutable variable value)            ; variable is mutable
   (make-parameter value [converter])         ; parameter is read-only
   (make-mutable-parameter value [converter]) ; parameter is mutable

Anyway, this is getting a bit far from SRFI 39.

Marc