[e-lang] get/put for Slots
Kevin Reid
kpreid at mac.com
Wed Aug 30 20:51:05 CDT 2006
On Aug 30, 2006, at 1:24, Dean Tribble wrote:
> On 8/17/06, Kevin Reid <kpreid at mac.com> wrote:
>> What if the getValue and setValue messages for Slots were renamed
>> to 'get' and 'put'? This would match collection access
>> conventions, in that a slot would be a zero-dimensional
>> collection. Also, it would allow access in the style of the 'unary-
>> star' syntax, while not being additional syntax.
>
> I'm not sure that it is useful to tempt people into cleverly
> oveloading slots with lists, etc. :-)
That particular case doesn't occur because lists are one-dimensional.
In general, I claim that a slot /is/ semantically a collection, and
should resemble one. Unnecessarily different protocols cause
unnecessary glue code.
> Do you have a pattern of usage in mind?
Only "whatever usage unary-star was invented for".
The original motivation for the idea was property-access designs that
might inherently involve slots; in which case the messages of Slots
shouldn't resemble an infinite regress.
> My preference would be to have a protocol that highlighted when a
> slot was being accessed via methods since that's a likely source of
> inobvious aliasing.
I would prefer to say that "&" is the highlighting; you can't have
'inobvious aliasing' without it.
--
Kevin Reid <http://homepage.mac.com/kpreid/>
More information about the e-lang
mailing list