Re: Renaming map->dict, class->type?

"Richard A. O'Keefe" <[email protected]>
Newsgroups gmane.comp.ai.prolog.swi
Message-ID <[email protected]>
On 26/11/2013, at 11:14 PM, Jan Wielemaker wrote:
>>>>> 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.

Did anyone else in this list ever use Pop-2?
It had association tables as user values before any Lisp dialect known
to me did.  And it called them "properties".

Did anyone else in this list have anything to do with IBM PROLOG?
IBM Prolog had association tables as a Prolog data structure years
and years ago.  And it called them "items".

If these things are not going to look like LIFE's psi-terms (which
would be a pity), then it would be graceful to acknowledge IBM
PROLOG's prior art.  (Mind you, "item" is a pretty silly name...)
IBM offered
	is_item(+Term)
	item_add(+Item, +Key, +Value)
		-- a backtrackable in-place update;
		-- if memory serves me, fails if Item has Key
	item_create(?Item, +[+Key1,Val1, ..., +Keyn,Valn])
		-- {Key1:Val1, ..., Keyn:Valn}
		-- The keys must be atoms.
	item_create(?Item, +[Key1,Val1, ..., Keyn,Valn], +Name)
		-- Name{Key1:Val1, ..., Keyn:Valn}
		-- The Name here is called a 'group name'.
		-- The Name must be an atom.
	item_delete(+Item, +Key)
		-- a backtrackable in-place update
	item_list(+Item, ?List)
		-- inverse of item_create/2
	item_put(+Item, +Key, Value)
		-- a backtrackable in-place update;
		-- alters an existing maplet
	item_update(+Item, +Key, Value)
		-- I could never tell this from item_put/3
	item_update(+Item, +Name)
		-- a backtrackable update of the group name
	item_value(+Item, +Key, ?Value)
		-- Queries Item(Key).
	item_value(+Item, ?Name)
		-- Unifies Name with the group name of Item.

>>>> 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.

I would have chosen 'label' myself; 'tag' is pretty good though.
I've used Haskell too much to be happy with 'kind', which Haskell
has taught me to think of as the type of a type, so to speak.
(Thus Int has kind * and -> has kind * -> * -> * .)

>>> Maybe right.  At this moment, `type' isn't a very important concept
>>> in Prolog,

"Type" is an exceedingly important concept in Prolog.
We have a lot of built-in type test predicates and they get used a lot.

And *design* with algebraic data types -- the reason why "a" and "a()"
are not distinguished -- is an important part of skilled Prolog
programming.
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.