* RE: [Ada-Comment] Extensible Enumerated Types [not found] <006c01c096af$a722e8e0$0304a8c0@bigboy.rrsoftware.com> @ 2001-02-14 21:34 ` Robert C. Leif, Ph.D. 0 siblings, 0 replies; 4+ messages in thread From: Robert C. Leif, Ph.D. @ 2001-02-14 21:34 UTC (permalink / raw) To: Randy Brukardt, Comp. Lang. Ada From: Bob Leif To:Randy Brukardt et al. Randy, many thanks for solving the mystery. Since this discussion was originally on Comp.Lang.Ada and others may have been searching for this text, I have taken the liberty of posting it. --------------------------------------------------------------- SNIP I went and looking in a dusty carton in the far corner of the basement of our office, and looked at all of the old mapping documents. The proposal disappeared between Mapping 2.0 (May 1991) and Mapping 3.0 (June 1991). These versions probably were internal use only (my copy of Mapping 2.0 was faxed me from AETECH), so I doubt Dr. Leif could find it anywhere. So, here is the complete proposal (so far as I can find) from Mapping 2.0: 3.5.1 Enumeration Types An enumeration type may be extended as part of a type derivation by specifying additional enumeration literals. The enumeration literals for the type include those corresponding to the parent and the new enumeration literals. For each enumeration literal of the parent, there is a corresponding literal for the new type (with the corresponding position and ordering). The position number of the first enumeration literal in the extension part is one more than the position number of the last enumeration literal of the parent type. Examples: type Boolean_with_Unknown is new Boolean with (Unknown); -- Boolean_with_Unknown has three enumeration literals, -- False, True, and Unknown with position numbers 0, 1, and 2. type Rainbow is (Red, Orange, Yellow, Green, Blue, Indigo, Violet); type Full_Color is new Rainbow with (Brown, Black, White); -- Full_Color is an enumeration type with the literals: -- Red, Orange, Yellow, Green, Blue, -- Indigo, Violet, Brown, Black, White SNIP Anyway, enjoy. :-) Randy Brukardt. ^ permalink raw reply [flat|nested] 4+ messages in thread
[parent not found: <002301c0960d$23ecb2f0$01a2a8c0@carpaccio>]
* RE: [Ada-Comment] Extensible Enumerated Types [not found] <002301c0960d$23ecb2f0$01a2a8c0@carpaccio> @ 2001-02-14 2:55 ` Robert C. Leif, Ph.D. 2001-02-14 12:49 ` Marc A. Criley 0 siblings, 1 reply; 4+ messages in thread From: Robert C. Leif, Ph.D. @ 2001-02-14 2:55 UTC (permalink / raw) To: Pascal Leroy; +Cc: Ada-Comment List, Comp. Lang. Ada From: Bob Leif To: Pascal Leroy et al. I have taken the liberty of cross-posting my reply to Comp.Lang.Ada, which is where the previous discussion occurred. You wrote, "I encourage you to write a detailed proposal on how this would be integrated with the rest of the language, and how it could be implemented." I did not see a requirement that in order to propose an extension to Ada one must be an expert in Ada compilers. In fact in some cases, it may be that such expertise could even be detrimental. As I have repeatedly stated, there are both technology driven and market driven aspects to product development. In my own field of Analytical Cytology (Biomedical Engineering), I would never limit customer or marketing suggestions to only those that the individual who made the proposal actually knew how to do the implementation. In fact one major reason for selecting one of the 3 proposed implementations is: How easy would it be to teach in a first year computer science course? I might note that my suggestion came from the problem of implementing a software package. -----Original Message----- From: Pascal Leroy [mailto:pleroy@rational.com] Sent: Tuesday, February 13, 2001 2:34 PM To: rleif@rleif.com Cc: Ada-Comment List Subject: Re: [Ada-Comment] Extensible Enumerated Types > Topic: Extensible Enumerated Types > > type Prefix_Type is (None, Mr, Ms, Miss, Mrs, Dr, Prof, Rev, Other); > > (1) > supertype Army_Prefix_Type is (Prefix_Type, Private, Corporal, Sergeant, > Lieutenant, Captain, Major, Colonel, General); > > (2) > type Army_Prefix_Type is new Prefix_Type with (Private, Corporal, Sergeant, > Lieutenant, Captain, Major, Colonel, General); > > (3) > type Army_Prefix_Type is (Prefix_Type�range & ((Private, Corporal, Sergeant, > Lieutenant, Captain, Major, Colonel, General)); Extensible enumeration types are certainly an interesting idea. In fact at some point during the 9X process they were part of the Mapping Document, and got trimmed. I think Tuck mentioned them again during the last ARG meeting. But if you feel that this feature should be added to the language, I encourage you to write a detailed proposal on how this would be integrated with the rest of the language, and how it could be implemented. Coming up with syntax is very easy (I have no doubt that the "right" syntax is #2, btw) but that's only about 1% of the work. I think that the ARG would be much more interested in looking at this idea if there were a real proposal on the table, rather than a one-line example of the syntax. If we had a real proposal, it would also be possible to evaluate the implementation complexity and balance that with the potential benefits. If you are interested in writing such a proposal, just send it to Ada-Comment and it will be given due consideration. Pascal ^ permalink raw reply [flat|nested] 4+ messages in thread
* Re: [Ada-Comment] Extensible Enumerated Types 2001-02-14 2:55 ` Robert C. Leif, Ph.D. @ 2001-02-14 12:49 ` Marc A. Criley 2001-02-15 10:13 ` Mario Amado Alves 0 siblings, 1 reply; 4+ messages in thread From: Marc A. Criley @ 2001-02-14 12:49 UTC (permalink / raw) "Robert C. Leif, Ph.D." wrote: > > From: Bob Leif > To: Pascal Leroy et al. > I have taken the liberty of cross-posting my reply to Comp.Lang.Ada, which > is where the previous discussion occurred. You wrote, "I encourage you to > write a detailed proposal on how this would be integrated with the rest of > the language, and how it could be implemented." > > I did not see a requirement that in order to propose an extension to Ada one > must be an expert in Ada compilers. In fact in some cases, it may be that > such expertise could even be detrimental. As I have repeatedly stated, there > are both technology driven and market driven aspects to product development. > In my own field of Analytical Cytology (Biomedical Engineering), I would > never limit customer or marketing suggestions to only those that the > individual who made the proposal actually knew how to do the implementation. > In fact one major reason for selecting one of the 3 proposed implementations > is: How easy would it be to teach in a first year computer science course? I > might note that my suggestion came from the problem of implementing a > software package. Bob, Relax. Adding extensible enumerated types to Ada would be a non-trivial addition to the language. What Pascal is requesting (and I don't think it's out-of-line) is a starting point for discussion. If a proposal for a language modification made to the ARG is accompanied by an analysis of how the feature would behave in a variety of circumstances, and how it might impact related features, it gives everyone a headstart on conceptualizing and evaluation. As neither your nor I are language lawyers, we certainly are not expected to provide a comprehensive, end-to-end proposal regarding the addition. By having spent some time evaluating what the impact of the new feature would be, along with the concept of how it should act, the ARG can start looking at the various aspects of the feature that have been initially covered in the proposal, rather than having to uncover each such aspect themselves. Marc A. Criley Senior Staff Engineer Quadrus Corporation www.quadruscorp.com > > -----Original Message----- > From: Pascal Leroy [mailto:pleroy@rational.com] > Sent: Tuesday, February 13, 2001 2:34 PM > To: rleif@rleif.com > Cc: Ada-Comment List > Subject: Re: [Ada-Comment] Extensible Enumerated Types > > > Topic: Extensible Enumerated Types > > > > type Prefix_Type is (None, Mr, Ms, Miss, Mrs, Dr, Prof, Rev, Other); > > > > (1) > > supertype Army_Prefix_Type is (Prefix_Type, Private, Corporal, Sergeant, > > Lieutenant, Captain, Major, Colonel, General); > > > > (2) > > type Army_Prefix_Type is new Prefix_Type with (Private, Corporal, > Sergeant, > > Lieutenant, Captain, Major, Colonel, General); > > > > (3) > > type Army_Prefix_Type is (Prefix_Type?range & ((Private, Corporal, > Sergeant, > > Lieutenant, Captain, Major, Colonel, General)); > > Extensible enumeration types are certainly an interesting idea. In fact at > some point during the 9X process they were part of the Mapping Document, and > got trimmed. I think Tuck mentioned them again during the last ARG meeting. > > But if you feel that this feature should be added to the language, I > encourage you to write a detailed proposal on how this would be integrated > with the rest of the language, and how it could be implemented. Coming up > with syntax is very easy (I have no doubt that the "right" syntax is #2, > btw) but that's only about 1% of the work. I think that the ARG would be > much more interested in looking at this idea if there were a real proposal > on the table, rather than a one-line example of the syntax. > > If we had a real proposal, it would also be possible to evaluate the > implementation complexity and balance that with the potential benefits. > > If you are interested in writing such a proposal, just send it to > Ada-Comment and it will be given due consideration. > > Pascal ^ permalink raw reply [flat|nested] 4+ messages in thread
* Re: [Ada-Comment] Extensible Enumerated Types 2001-02-14 12:49 ` Marc A. Criley @ 2001-02-15 10:13 ` Mario Amado Alves 0 siblings, 0 replies; 4+ messages in thread From: Mario Amado Alves @ 2001-02-15 10:13 UTC (permalink / raw) To: comp.lang.ada A provisional implementation is to make type T is {A, B, C}; type Extended_T is new T with {X, Y, Z}; merely syntactic sugar for type T is {A, B, C} type Extended_T is {A, B, C, X, Y, Z}; Of course there is no proper derivation here. Nevertheless it seems like a useful construct. I often miss it. | |,| | | |RuaFranciscoTaborda24RcD 2815-249CharnecaCaparica 351+939354005 |M|A|R|I|O| |A|M|A|D|O|DepartmentoDeInformaticaFCT/UNL 2825-114 Caparica 351+212958536 |A|L|V|E|S| fax 212948541 | | | | | | maa@di.fct.unl.pt FCT 212948300 ^ permalink raw reply [flat|nested] 4+ messages in thread
end of thread, other threads:[~2001-02-15 10:13 UTC | newest] Thread overview: 4+ messages (download: mbox.gz / follow: Atom feed) -- links below jump to the message on this page -- [not found] <006c01c096af$a722e8e0$0304a8c0@bigboy.rrsoftware.com> 2001-02-14 21:34 ` [Ada-Comment] Extensible Enumerated Types Robert C. Leif, Ph.D. [not found] <002301c0960d$23ecb2f0$01a2a8c0@carpaccio> 2001-02-14 2:55 ` Robert C. Leif, Ph.D. 2001-02-14 12:49 ` Marc A. Criley 2001-02-15 10:13 ` Mario Amado Alves
This is a public inbox, see mirroring instructions for how to clone and mirror all data and code used for this inbox