From mboxrd@z Thu Jan 1 00:00:00 1970 X-Spam-Checker-Version: SpamAssassin 3.4.4 (2020-01-24) on polar.synack.me X-Spam-Level: X-Spam-Status: No, score=-1.3 required=5.0 tests=BAYES_00,INVALID_MSGID autolearn=no autolearn_force=no version=3.4.4 X-Google-Language: ENGLISH,ASCII-7-bit X-Google-Thread: 103376,803df5f3f60558d5 X-Google-Attributes: gid103376,public From: fjh@mundook.cs.mu.OZ.AU (Fergus Henderson) Subject: Re: Uninitialized "out" parameters Date: 1996/07/24 Message-ID: <4t5aik$fdh@mulga.cs.mu.OZ.AU>#1/1 X-Deja-AN: 169939798 references: <4smh9i$gp5@krusty.irvine.com> <4ssn9r$p6e@mulga.cs.mu.OZ.AU> <4ste71$hg8@felix.seas.gwu.edu> <4svba5$j2i@mulga.cs.mu.OZ.AU> <4t3o3s$kt9@felix.seas.gwu.edu> organization: Comp Sci, University of Melbourne newsgroups: comp.lang.ada Date: 1996-07-24T00:00:00+00:00 List-Id: mfeldman@seas.gwu.edu (Michael Feldman) writes: >I think the essence of the discussion is that in a language >(like Ada) that does not compel initialization, it is undecidable >whether a given variable has a well-defined (put there by the program) >value when it is used. Yes, but remember that if you're willing to accept approximate solutions, you can solve undecidable problems. >>[...] I _think_ that >>Java does not require initialization at the point of declaration, >>but instead requires that a variable be initialized along all the >>execution paths leading to a possible use of a that variable; >>that would mean that if a variable wasn't used, there would be >>no requirement to initialize it. > >And if it _was_ used? How does the JBC interpreter know whether it's >been initialized? Possibly in the interpreter, there's a "this space >is uninitialized" flag. I believe that it is done by static checking, not by run-time checking. (I think the static checking is done twice, once by the Java compiler, and then again by the byte-code verifier in the JBC interpreter when it first loads the JBC code.) I don't know how Java handles arrays. But I'm sure there are lots of Java experts in comp.lang.java.* that would be happy to answer such questions. -- Fergus Henderson | "I have always known that the pursuit WWW: | of excellence is a lethal habit" PGP: finger fjh@128.250.37.3 | -- the last words of T. S. Garp.