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

Re: :accessor slot option

> I agree that adding a :writer slot-option is a good idea.  This would
> make some of my users happier.  This makes the CLOS specification slightly
> larger, but it's probably worth it.  It certainly doesn't make CLOS more
> -conceptually- complex.

>     I agree that in cases where you want both a reader and a writer its
>     probably too verbose, so we probably need to keep the :accessor option,
>     but what if we renamed it, maybe to :reader-writer or perhaps
>     :accessors.

> The name :accessors is definitely out; mixed singular and plural option
> names always lead to trouble.  I don't think :accessor is too bad a name
> to imply a function that works for both reading and w> r> iting.  If I was
> teaching CLOS to someone, I think I would teach them :accessor first,
> as the one that you usually use, and then later say "actually :accessor
> can be broken down into its two component parts, :reader and :writer,
> in case you have your special reasons to want to get at them separately."

For what it's worth, I prefer just having a :reader and :writer option, and
if people want both they can specify both. Sort of like file protections
on some OS's.

> The name :default-initargs can be justified on the basis that it can
> default more than one "initarg", but it might be worth rethinking this
> name to avoid plurality and to avoid the jargon word "initarg," which
> has been demoted to a less prominent place in the CLOS specification
> than it had originally.  :default-initialization was the best name I
> could come up with, maybe someone else can do better.