[m-dev.] for review: improvements for record syntax
Simon Taylor
stayl at cs.mu.OZ.AU
Tue Dec 12 12:21:37 AEDT 2000
Ralph Becket wrote:
> >From schachte at cs.mu.OZ.AU on 10/12/2000 22:50:29
> > Simon Taylor wrote:
> > > How about:
> > > X = Map ^ entry(Key)
> > > and Map ^ entry(Key) := Y
> >
> > `entry' is not bad, and I agree it's better than `value'. How about
> > `item'? It sounds like about the same meaning to me as `elem', but
> > it's not an abbreviation. And it's a letter shorter than `entry'
> > and `value'. I'd mark my (preference-based) ballot:
>
> My original thinking was that, since maps are partial functions, a
> good name would be `image', as in `Map ^ image(Key)'.
>
> This didn't go down too well, so my next thought was that maps define
> relationships between keys and values, hence `Map ^ value(Key)'.
>
> `elem[ent]', `entry' and `item' all fail to suggest the functional
> nature of maps to me, although I could probably live with `item' if
> I had to.
>
> One possibility is to stick with the status quo and have
>
> Map ^ lookup(Key)
> Map ^ set(Key) := Value
The last time you suggested this, Peter Schachte wrote:
> I wouldn't write "Map ^ lookup(Key)", as that doesn't really make
> sense. You're not fetching lookup(Key) of Map. I think "Map ^
> element(Key)" or maybe "Map ^ elt(Key)" makes more sense and reads
> better.
`lookup' and `set' also won't work because of the argument ordering issue.
There doesn't semm to be any real consensus, so I'm just going to pick
one. `elem' doesn't seem to be totally offensive to anyone, so I'll
stick with that.
Simon.
--------------------------------------------------------------------------
mercury-developers mailing list
Post messages to: mercury-developers at cs.mu.oz.au
Administrative Queries: owner-mercury-developers at cs.mu.oz.au
Subscriptions: mercury-developers-request at cs.mu.oz.au
--------------------------------------------------------------------------
More information about the developers
mailing list