typing of a class

From: David Chemouil (David.Chemouil@enseeiht.fr)
Date: Tue Mar 07 2000 - 14:12:54 MET

  • Next message: Markus Mottl: "additions to standard library?"

    Hi,

    I've been using the OO features of Caml these past days, and soon
    observed a behavior of the typing system that I don't understand. Here
    is a simplified version of my problem:

    # class a (arg : a -> b) = object(self)
        val ob = arg self
      end
      and b = object
      end;;

    The instance variable self
    cannot be accessed from the definition of another instance variable

    I don't understand why it is forbidden for an object to pass itself to
    another one (which is possible in Java or Eiffel for example). Could
    someone explain me? Or is there a paper talking about this?

    thanks,

    dc

    -- 
    David Chemouil [mailto:chemouil@enseeiht.fr] [mobile: 06 84 16 26 65]
    

    Laboratoire d'informatique et de mathématiques appliquées (IRIT-INPT)



    This archive was generated by hypermail 2b29 : Wed Mar 08 2000 - 19:28:03 MET