home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
OS/2 Shareware BBS: 10 Tools
/
10-Tools.zip
/
sa104os2.zip
/
SATHR104.ZIP
/
SATHER
/
LIBRARY
/
ABSTRACT.SA
next >
Wrap
Text File
|
1994-10-25
|
3KB
|
73 lines
-- Copyright (C) International Computer Science Institute, 1994. COPYRIGHT --
-- NOTICE: This code is provided "AS IS" WITHOUT ANY WARRANTY and is subject --
-- to the terms of the SATHER LIBRARY GENERAL PUBLIC LICENSE contained in --
-- the file "Doc/License" of the Sather distribution. The license is also --
-- available from ICSI, 1947 Center St., Suite 600, Berkeley CA 94704, USA. --
--------> Please email comments to "sather-bugs@icsi.berkeley.edu". <----------
-- abstract.sa: Abstractions indicating the presence of features.
-------------------------------------------------------------------
-- $IS_EQ{T}: Subtypes define "is_eq(T):BOOL".
-- $IS_LT{T}: Subtypes define "is_lt(T):BOOL".
-- $HASH: Subtypes define "hash:INT".
-- $NIL{T}: Subtypes define "nil:T".
-------------------------------------------------------------------
type $IS_EQ{T} is
-- Subtypes of this define "is_eq(T):BOOL". Typically used in
-- typecases to use instead of "=". Examples: INT < $IS_EQ{INT},
-- STR < $IS_EQ{STR}.
is_eq(e:T):BOOL; -- True if self is equal arg for
-- this element type.
end;
-------------------------------------------------------------------
type $IS_LT{T} is
-- Subtypes of this define "is_lt(T):BOOL". Typically used in
-- typecases. Examples: INT < $IS_LT{INT}, STR < $IS_EQ{STR}.
is_lt(e:T):BOOL; -- True if self is less than arg for
-- this element type.
end;
-------------------------------------------------------------------
type $HASH is
-- Subtypes of this define "hash:INT". Typically used in
-- typecases. Example: STR < $HASH.
hash:INT; -- A hash value for self.
-- Elements which are "is_eq", if defined, should return the
-- same hash value.
end;
-------------------------------------------------------------------
type $NIL{T} is
-- Subtypes of this define "nil:T". Typically used in typecases.
-- Example: INT < $NIL{INT}.
nil:T; -- A special value to be used in
-- sets to represent the absence of an element.
end;
-------------------------------------------------------------------
type $REHASH is
-- Subtypes of this define "rehash". Any class whose objects need
-- to perform special operations when they are moved of copied
-- should be a subtype. The rehash routine is called on such
-- objects if the system changes their location (for instance,
-- during garbage collection).
rehash; -- Make whatever changes are needed
-- after an object is copied or moved.
end;
-------------------------------------------------------------------
type $STR is
-- Subtypes of this define "str:STR". This should be a reasonable
-- string representation of an object.
str:STR; -- String form of object.
end;
-------------------------------------------------------------------