[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: setter problem
- To: firstname.lastname@example.org (Tom Boutell)
- Subject: Re: setter problem
- From: email@example.com
- Date: Mon, 26 Oct 92 15:35:43 PST
- Cc: firstname.lastname@example.org
- In-reply-to: Your message of Mon, 26 Oct 92 17:45:39 -0500. <9210262245.AA28217@isis.cshl.org>
> Can you elaborate on why, exactly, exporting a setter function is a problem?
Modules have two purposes: The first is to prevent namespace pollution.
The second is to guarantee that clients only use the advertised
interfaces to libraries so that the libraries can be changed without
breaking client code.
Coming from the C++ world, I feel weird without the ability to make
methods private at the class level, let alone the module level.
I understand that getter and setter are really two different things.
I just don't like the price Dylan is making me pay. I would think
the right thing to do is dispatch 'set!' the same way all the methods
are dispatched and use whatever mechanism it uses to only export
the appropriate methods. This would make things simpler in terms
of syntax because 'set!' would look like any other method. This
also wouldn't prevent Dylan from automatically creating the set! for
you when you created the slot.
Is there a reason why 'set!' isn't treated like a regular method?
Does it have to do with the fact that normally set! is a special
case because it doesn't evaluate the variable being set?