Title: Theory / Unimportant / CS / Programming / oCaml / Manual{ / 03 Objects
Tags: récupéré seen_description declaration FromInstruction computer_to_instruction hasNotNewEffectReturnsMeaning mid1516974248815
On every note of this deck, unless a note says otherwise:
Page: https://caml.inria.fr/pub/docs/manual-ocaml/objectexamples.html

Question: The evaluation of the body of a class takes place
Answer: at object creation time
Page: https://caml.inria.fr/pub/docs/manual-ocaml/objectexamples.html
Chapter: 3
Section: 1

Instruction: o#foo
Page: https://caml.inria.fr/pub/docs/manual-ocaml/objectexamples.html
Effect: call method/value foo of object o
Language: oCaml
Chapter: 3
Section: 1
Variables: o an object

Instruction: new c foo_1 ... foo_n
Page: https://caml.inria.fr/pub/docs/manual-ocaml/objectexamples.html
Effect: Create an object of type c, with parameter foo_1 ... foo_n
Language: ocaml
Chapter: 3
Section: 1
Variables: c a class

Instruction: class bar plop1 ... plop_n=...inobject
   foo
end
Meaning: Define a class, named bar, with parameters plop_i, whose objects are defined by foo
Language: oCaml
Chapter: 3
Section: 2

Instruction: object
   foo
end
Page: https://caml.inria.fr/pub/docs/manual-ocaml/objectexamples.html
Effect: Define an object with values foo
Language: ocaml
Chapter: 3
Section: 2

Instruction: val foo = bar
Language: Ocaml
Chapter: 3
Section: 2
Context: object
Identifier: foo
Initialization: bar
Mutable: no

Variable: self
Meaning: the reference to the current object
Page: https://caml.inria.fr/pub/docs/manual-ocaml/objectexamples.html
Context: object
Language: oCaml
Section: 2
Chapter: 3

Instruction: initializer foo
Page: https://caml.inria.fr/pub/docs/manual-ocaml/objectexamples.html
Effect: Execute foo when the object is created
Language: oCaml
Context: object
Chapter: 3
Section: 4

Instruction: val mutable foo = bar
Language: ocaml
Chapter: 3
Section: 2
Context: object
Identifier: foo
Initialization: bar
Mutable: yes

Instruction: method virtual foo : bar
Meaning: it is a member that must be implemented in objects of the current class
Language: oCaml
Chapter: 3
Section: 5
Context: object
Identifier: virtual
Typ: bar
Initialization: not implemented

Instruction: class virtual foo plop_1 ... plop_n: bar = ...
  object
    clic
  end;;
Meaning: Introduce a virtual class, with parameters plop_i. of objects of type clic
Language: oCaml
Chapter: 3
Section: 5
Context: object