[Date Prev][Date Next][Thread Prev][Thread Next]
[Date Index]
[Thread Index]
- Subject: Re: lua 3.0a tag methods
- From: Mark Ian Barlow <Mark@...>
- Date: Thu, 01 May 1997 14:30:24 GMT
In message <9704301908.AA22520@exu.inf.puc-rio.br> Roberto wrote:
>
> I will try a quick explanation. I hope that will be enough for a start.
<snip>
> This is the hardest part. The general idea: internal methods (or tag
> methods, or just fallbacks :-) is mainly the old concept of fallbacks,
> with one big, and some small differences:
>
> + instead of being globally defined, each tag can have its own set of methods.
> - like userdata, tables can have different tags.
> - to use tag methods, tags must be explicitly created with "newtag".
> - tables now also have tag methods for gettable and settable.
<snip>
> Other details:
>
> - fallback 'arith' has been splited in many tag methods: 'add', 'sub',
> 'mul', etc. The same for 'order'.
>
> - since userdata are immutable, you cannot use "settag" for them. Instead,
> they must be created with their final tag.
>
> - old tags (user defined, without using newtag) can still be used, but
> you cannot associate a tag method to them.
<snip>
This looks like a very powerful enhancement. It seems a shame (IMHO) to use
such a small word as 'tag' to describe it; tags as described seem to confer
membership of a sort of "meta class" or "exception interface" (interface in
the java sense). Despite their relative simplicity as seen from the user's
point of view, this is not a trivial concept!
Objects with the same tag, it seems, may share common exception handling,
inheritance mechanisms and a host of other possible behaviours. There is
some confusion with userdata tags, which merely implement (optional) user
controlled type checking. Perhaps we need to distinguish better between
the two?
Words like 'class', 'interface' and 'type' are already loaded down with
meanings from other languages, none of which quite fits what we have here,
but there are plenty of others left which express the concept of membership
of some larger group, A quick trawl through Roget's thesaurus yielded the
following (selected on no particular basis):
species phylum family genus caste category taxon(?) ilk(!) ...
I think I like 'species' best, it conveys the idea of something evolved and
adapted to cope with a particular (ecological) niche...
Ok, so this has all been a bit of a quibble over nomenclature but I think
Lua's authors really have something quite new here; is it species-oriented
programming?
-- Mark Ian Barlow Non-Linear Control Consultants Ltd.
-----------------------------------------------------------------
Mark@nlcc.demon.co.uk Voice / Fax: +44 (0)1207 562 154