[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: Goops: Setting Immutible Classes?
From: |
Thompson, David |
Subject: |
Re: Goops: Setting Immutible Classes? |
Date: |
Fri, 6 Oct 2017 08:55:53 -0400 |
On Fri, Oct 6, 2017 at 2:00 AM, Christopher Howard
<address@hidden> wrote:
> Hi, is the a way I could use goops such that I the classes are non-
> mutating, but have setters that simply return a new instance of the
> class (instead of modifying the original)?
I'm not too familiar with the meta-object protocol, but this sounds
like a case where you could make a new metaclass that supports
immutable slot setters. See Section 8.11 in the manual.
- Dave