Path: utzoo!utgpu!news-server.csri.toronto.edu!rutgers!mcnc!uvaarpa!vger.nsu.edu!g_harrison From: g_harrison@vger.nsu.edu Newsgroups: comp.lang.pascal Subject: Enumeration Inverse- was Request : Help with E Types Message-ID: <357.27648291@vger.nsu.edu> Date: 11 Dec 90 10:54:09 GMT References: <3983@uniol.UUCP> <1990Dec10.180345.31492@wpi.WPI.EDU> Lines: 35 In article <1990Dec10.180345.31492@wpi.WPI.EDU>, kamal@wpi.WPI.EDU (Kamal Z Zamli) writes: > In article <3983@uniol.UUCP> Arne.Gehlhaar@arbi.informatik.uni-oldenburg.de (Arne Gehlhaar) writes: I am familiar with several versions of Pascal extensions and believe that those with enumeration IO facilities are providing important functionality. I have a different "complaint." When working with CHAR type we have CHR as the inverse of ORD. With general enumerated types we don't. For example in Ada there is type FUZZY = (YES, NO, MAYBE); F : FUZZY := NO; FUZZY'POS(F) is 1 FUZZY'VAL(1) is NO FUZZY'POS(FUZZY'VAL(2)) is 2 FUZZY'VAL(FUZZY'POS(MAYBE)) is MAYBE We can certainly find the Nth (N = 0...) element in an enumerated type in Pascal by searching for it, but are there some tricks (Machine-Dependent or otherwise) to provide an inverse to ORD that do not involve searching? George.... ------------------------------------------------------*------o Happy--- -- George C. Harrison ------------------------------ * * ----o_o___ New--- ----- Professor of Computer Science -------------- * * * ----\ o /-Year-- ----- Norfolk State University, ----------------- *Merry* ----\ /-------- -------- Norfolk, Virginia 23504 --------------- * * * * * ----|--------- ----- INTERNET: g_harrison@vger.nsu.edu ------ *Christmas* --_|_-------- ----------These are MY views.... you may share them..*** -----------------