home *** CD-ROM | disk | FTP | other *** search
/ NetNews Usenet Archive 1992 #30 / NN_1992_30.iso / spool / comp / lang / function / 1474 < prev    next >
Encoding:
Text File  |  1992-12-18  |  1.6 KB  |  37 lines

  1. Organization: Junior, Math/Computer Science, Carnegie Mellon, Pittsburgh, PA
  2. Path: sparky!uunet!zaphod.mps.ohio-state.edu!cis.ohio-state.edu!news.sei.cmu.edu!fs7.ece.cmu.edu!crabapple.srv.cs.cmu.edu!andrew.cmu.edu!ea08+
  3. Newsgroups: comp.lang.functional
  4. Message-ID: <0fACPi200VQw41LfpV@andrew.cmu.edu>
  5. Date: Thu, 17 Dec 1992 15:45:34 -0500 
  6. From: "Eric A. Anderson" <eanders+@CMU.EDU>
  7. Subject: Re: Values escaping their type definition
  8. In-Reply-To: <BzDIL1.B4I@cs.uiuc.edu>
  9. References: <BzDIL1.B4I@cs.uiuc.edu>
  10. Lines: 25
  11.  
  12. morrison@cs.uiuc.edu (Vance Morrison) writes:
  13. > The oddity is that a value can escape the scope in which its type
  14. > definition was made.   Thus
  15. >         let 
  16. >            datatype aType = constA | constB of int;
  17. >         in
  18. >            constA
  19. >         end;
  20. [ Gives ?.aType as a type.]
  21. From what I recall, this isn't a really big problem because you can't
  22. do anything with those values.  This occurs in a similar and possible
  23. more obnoxious way with exceptions, I think you can look that up in
  24. the SML manual, I know it's discussed somewhere.
  25. This problem can also occur with recursive types and stuff like that.
  26. It doesn't break the typechecking of the system, and I don't think it
  27. causes any substantial semantical problems since you can't operate on
  28. the values anymore.
  29.           -Eric 
  30. *********************************************************
  31. "Overhead, without any fuss, the stars were going out."
  32.            -The Nine Billion Names of God
  33. "Yes, you're very smart.  Shut up."
  34.            -In "The Princess Bride"
  35. *********************************************************
  36.