caml-list - the Caml user's mailing list
 help / color / mirror / Atom feed
* [Caml-list] if the initializer of a base class can be inherited to subclass?
@ 2015-12-22 15:28 沈胜宇
  2015-12-22 18:50 ` Martin Jambon
  0 siblings, 1 reply; 2+ messages in thread
From: 沈胜宇 @ 2015-12-22 15:28 UTC (permalink / raw)
  To: caml-list

[-- Attachment #1: Type: text/plain, Size: 107 bytes --]

if the initializer of a base class can be inherited to subclass?

It seems it dont. But I think it should


[-- Attachment #2: Type: text/html, Size: 119 bytes --]

^ permalink raw reply	[flat|nested] 2+ messages in thread

* Re: [Caml-list] if the initializer of a base class can be inherited to subclass?
  2015-12-22 15:28 [Caml-list] if the initializer of a base class can be inherited to subclass? 沈胜宇
@ 2015-12-22 18:50 ` Martin Jambon
  0 siblings, 0 replies; 2+ messages in thread
From: Martin Jambon @ 2015-12-22 18:50 UTC (permalink / raw)
  To: 沈胜宇, caml-list

On 12/22/2015 07:28 AM, 沈胜宇 wrote:
> if the initializer of a base class can be inherited to subclass?
>
> It seems it dont. But I think it should

It works for me:

# class a = object initializer print_endline "Hello" end;;
class a : object  end
# class b = object inherit a end;;
class b : object  end
# new a;;
Hello
- : a = <obj>
# new b;;
Hello
- : b = <obj>
#

^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2015-12-22 18:51 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2015-12-22 15:28 [Caml-list] if the initializer of a base class can be inherited to subclass? 沈胜宇
2015-12-22 18:50 ` Martin Jambon

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).