Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 9244667
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 18, 20262026-06-18T09:05:32+00:00 2026-06-18T09:05:32+00:00

What does the object(self: something) means in Ocaml, inheritance? class tcp_messaging my_address my_cookie (drop_it:

  • 0

What does the “object(self: something)” means in Ocaml, inheritance?

class tcp_messaging my_address my_cookie (drop_it: drop_function) =
....
object(self : # messaging )
  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-18T09:05:34+00:00Added an answer on June 18, 2026 at 9:05 am

    The sharp sign in front of a class name denotes a class type which contains at least the type of the class, so it is more or less an interface denotation.

    Ocaml doesn’t have a special keyword to reference an object in its implementation (like the keyword this in C++ for instance). Instead, it provides a flexible syntax to define the name which will be used to reference the object instance (in this case the name self is used). It appears that this naming is actually the one used generally (it’s kind of a practice), so you will see it very often.

    So basically, that syntax let you bind the object to a name, and add a constraint on that name, so that the implementation must implement at least that type. Without the #, the class implementation would need to be exactly of that type.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

Why does the following: class A(object): def __init__(self, var=[]): self._var = var print 'var
class Foo(object): def tick(self): print(something) class Bar(object): def __init__(self): self.foo = Foo() def tick(self):
Initialising the Foo object does run the method func(), but the value of self.a
Reading the CherryPy tutorial I run into this class HelloWorld(object): def index(self): return Hello
First the code: class myClass(object): def __cmp__(self, other): return cmp(type(self), type(other)) or cmp(self.__something, other.__something)
I know what double underscore means for Python class attributes/methods, but does it mean
For example, suppose I have the code: class Foo(object): def bar(self, x): '''blah blah
In Ruby (1.8.X) Why does Object both inherit off Kernel and include it? Wouldn't
When you serialized an object does it follow pointers. Let say I have a
I am creating a flash object that does some heavy image lifting. What I

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.