Re: Renaming map->dict, class->type?
Jan Wielemaker <[email protected]>
| Newsgroups | gmane.comp.ai.prolog.swi |
|---|---|
| Message-ID | <[email protected]> |
On 11/26/2013 01:13 AM, Jeff Schultz wrote: > On 26/11/2013 06:41, Jan Wielemaker wrote: >> On 11/25/2013 08:32 PM, Paulo Moura wrote: >>> On 25/11/2013, at 19:43, Jan Wielemaker <[email protected]> wrote: >>>> Just wondering, should we rename `map' into `dict'? The problem is >>>> that we also have the `map' concept as in maplist/N, map_assoc/2,3, >>>> etc. This will change the documentation as well as rename the map_* >>>> predicates. > > Good point. "Map" shouldn't be overloaded. "Dict" will be familiar to > many scripting language programmers. It does have strong imperative > associations, though, which I think will encourage its overuse when > better data structures are available. "Object" or maybe even "frame" > might be better. Thanks. I wonder where your `strong imperative associations' comes from. I don't have these. "Object" has far too many associations to me and the current `thingy' proposal satisfies few of them. With my involvement in knowledge representation (should not be an exception in LP), "frame" also comes with lots of memories and associations that do not match our `thingy'. These things are sometimes also called `associative arrays'. As the name is used in predicate names, I'm not in favour of that either. Still tempted for "dict", unless may people have the same association Jeff has. >>>> The second issue with maps that currently, in x{a:1}, 'x' is >>>> called the `class'. That might be a too much object oriented term. >>>> Would `type' be better? This term only appears in the >>>> documentation. > >>> But words are overloaded :( I would prefer "type" over "class" for >>> the same reason you state above. Maybe "kind"? > > But it's nothing like a "type!" Why would we say x{a:1} and x{b:c} have > the same type? Isn't it just a "tag?" We now have "tag", "kind" and "sort". "Sort" may associate with sorted logics, which would be wrong. I think both "tag" and "kind" are acceptable. We don't have to be quick here as the name is only part of internal naming and documentation. Cheers --- Jan >> Maybe right. At this moment, `type' isn't a very important concept >> in Prolog, but surely we would like to keep the option open to >> change that. I'm not against "kind", especially if there is a >> precedent. Does anyone know that? > > I'm used to kinds as "types of types." Much prefer "tag." > > > Jeff Schultz > _______________________________________________ > SWI-Prolog mailing list > [email protected] > https://lists.iai.uni-bonn.de/mailman/listinfo.cgi/swi-prolog