RE: Named Integers

From: CFB Software <"CFB>
Date: Mon, 29 Nov 2004 15:49:01 +1030

----boundary-LibPST-iamunique-318726364_-_-
Content-type: text/plain

> of the problem in practice. Named integers solve a common
> problem with a minimum implementation cost.
>

That depends on their *complete* definition. The fact that they are a
named type means there are additional considerations compared to the
used of CONSTs that have not been mentioned. There are a number of
questions that need to be addressed. These include but are not limited
to:

1. What are the compatibility rules of named integers with other ordinal
types?

VAR
  c: Colour;

Is c := 1 acceptable?

2. What are the compatibility rules of a variable of one type of named
integers with another? For example, Given:

TYPE
  Colour = (green, orange, yellow);
  Fruit = (fApple, fOrange, fBanana);

VAR
  c: Colour;
  fruit: Fruit;
...
...

does

  fruit := orange;

result in an error?

3. Can named integers be used wherever integers can be used. Fore
example, does the INC function accept a named integer as a parameter? If
yes and Colour is a named integer type:

TYPE
  Colour = (red, yellow, blue);

VAR
  c: Colour;

What is the result of:

  c := blue;
  c := INC(c);

etc. etc.

These are just a few that I thought of, off the top of my head.

Before responding to each issue, I recommend that you go through the
actual exercise of modifying the Language Report thoroughly to
accomodate the proposed feature of Named Integers and then reconsider
whether the implementation cost would be minimal. I haven't tried it
myself, but I suspect that the corresponding effort would not be
significantly less than actually implementing an 'enumerated type'
feature.

--
Chris Burrows
CFB Software
http://www.cfbsoftware.com/gpcp
 
  
--------------------------------------------
To unsubscribe from this mailing list, send a message containing the word "unsubscribe" to:
   blackbox-request{([at]})nowhere.xyTo get a list of valid e-mail commands and instructions on their usage, send a message containing the word "help" to the above address.
Send any problem reports or questions related to this email list to the list owner at
   owner-blackbox{([at]})nowhere.xyCurrent posting policy:
a) To post you should use the same address by which you are subscribed to the mailing list. That way, the list server will recognize you as subscriber and forward your posting immediately, without creating any overhead.
b) If, for some reason, you cannot post from the address, by which you are subscribed, your message will be moderated to avoid spam. Please understand that moderation will often cause some delay, in particular over weekends or holydays.
----boundary-LibPST-iamunique-318726364_-_-
Content-type: application/rtf
Content-transfer-encoding: base64
Content-Disposition: attachment; filename="rtf-body.r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