Version française
Home     About     Download     Resources     Contact us    
Browse thread
[Caml-list] let or val in objects
[ Home ] [ Index: by date | by threads ]
[ Search: ]

[ Message by date: previous | next ] [ Message in thread: previous | next ] [ Thread: previous | next ]
Date: -- (:)
From: Richard Nyberg <rnyberg@i...>
Subject: [Caml-list] let or val in objects
Hello, I'm a bit confused regarding let bindings and nonmutable vals in
objects. Are there any difference between the classes a and b? or are they
equivalent?

Like this:

class a fd =
  let is = in_channel_of_descr fd in
  object
  .
  .
  Use is somewhere
  .
  .
  end;;

class b fd =
  object
    val is = in_channel_of_descr fd
    .
    .
    Use is somewhere
    .
    .
    end;;

TIA!
	-Richard
-------------------
To unsubscribe, mail caml-list-request@inria.fr Archives: http://caml.inria.fr
Bug reports: http://caml.inria.fr/bin/caml-bugs FAQ: http://caml.inria.fr/FAQ/
Beginner's list: http://groups.yahoo.com/group/ocaml_beginners