* local type within class
@ 1997-11-07 11:17 Benoit Pasquereau
1997-11-12 10:05 ` Xavier Leroy
0 siblings, 1 reply; 2+ messages in thread
From: Benoit Pasquereau @ 1997-11-07 11:17 UTC (permalink / raw)
To: caml-list
Hi,
I would like to define "types" that are in the namescope of classes, is
it possibles in ocaml ? (just like local types in C++)
I begin in ocaml and I have just made tiny programs with caml-light.
I don't master ocaml concepts very well, so perhaps this question is
silly !
Benoit Pasquereau.
^ permalink raw reply [flat|nested] 2+ messages in thread
* Re: local type within class
1997-11-07 11:17 local type within class Benoit Pasquereau
@ 1997-11-12 10:05 ` Xavier Leroy
0 siblings, 0 replies; 2+ messages in thread
From: Xavier Leroy @ 1997-11-12 10:05 UTC (permalink / raw)
To: Benoit Pasquereau; +Cc: caml-list
> I would like to define "types" that are in the namescope of classes, is
> it possibles in ocaml ? (just like local types in C++)
Namespace control in Caml is performed by the module system. Your
type belongs to a module (either the current compilation unit or some
sub-structure). To hide this type, just add an interface to this module
that does not specify this type.
Objective Caml classes are only intended as a mechanism to group sets
of methods, attach them to objects, and perform inheritance. Unlike
in C++ or Java, classes in Objective Caml do not double as a
general-purpose namespace control structure.
- Xavier Leroy
^ permalink raw reply [flat|nested] 2+ messages in thread
end of thread, other threads:[~1997-11-12 14:02 UTC | newest]
Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
1997-11-07 11:17 local type within class Benoit Pasquereau
1997-11-12 10:05 ` Xavier Leroy
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox