Re: reference initialization

From: Max Skaller (maxs@in.ot.com.au)
Date: Mon May 15 2000 - 08:58:02 MET DST

  • Next message: Jacques Garrigue: "Re: Typechecking of recursive variants"

    Hongwei Xi wrote:

    > Certainly, we can replace ? with 0. But what is really achieved?
    > I would say it is simply an illusion that a program is made safer
    > by initializing each array upon its allocation.

    What's happening here is this: ocaml is basically a _functional_
    programming language. In such a language there is no such thing
    as a variable, _everything_ is a constant. In this view,
    the notion that there can be an uninitialised variable
    is absurd, since there are no variables!

    This is not the case for procedural programming, IHMO.
    But the framework of ocaml is functional first, with
    adaptions for procedural programming. In particular,
    because of the way the underlying run-time system works,
    uninitialised pointers would cause the garbage collector to core dump.
    (and almost all ocaml values are represented by pointers).

    -- 
    John (Max) Skaller at OTT [Open Telecommications Ltd]
    mailto:maxs@in.ot.com.au      -- at work
    mailto:skaller@maxtal.com.au  -- at home
    



    This archive was generated by hypermail 2b29 : Mon May 15 2000 - 22:12:45 MET DST