Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

2 typos in section "using coercions" manual-ocaml #3568

Closed
vicuna opened this issue Mar 30, 2005 · 1 comment
Closed

2 typos in section "using coercions" manual-ocaml #3568

vicuna opened this issue Mar 30, 2005 · 1 comment
Labels

Comments

@vicuna
Copy link

vicuna commented Mar 30, 2005

Original bug ID: 3568
Reporter: administrator
Status: closed
Resolution: fixed
Priority: normal
Severity: minor
Category: ~DO NOT USE (was: OCaml general)
Monitored by: marc

Bug description

Full_Name: Marc Herbert
Version: 3.08.2
OS: linux
Submission from: lns-vlq-37-lyo-82-253-101-87.adsl.proxad.net (82.253.101.87)

http://caml.inria.fr/pub/docs/manual-ocaml/manual005.html#ss:using-coercions

Reference manual, section 3.12 "using coercions"

  • "Indeed, narrowing coercions would be unsafe, and could only be combined with
    a type case, possibly raising a runtime error. However, there is no such
    operation available in the language."

type case -> type cast ?

  • #class c0 = object method m = {< >} method n = 0 end;;
    class c0 : object ('a) method m : 'a method n : int end

The object type c is an abbreviation for <m : 'a; n : int> as 'a.

type c -> type c0 ?

@vicuna
Copy link
Author

vicuna commented Dec 2, 2005

Comment author: @garrigue

J'ai aussi change l'explication de pourquoi il n'y a pas de downcast en caml.

Indeed, narrowing coercions without runtime checks would be unsafe.
Runtime type checks might raise exceptions, and they would require
the presence of type information at runtime, which is not the case in
the Objective Caml system.
For these reasons, there is no such operation available in the language.

@vicuna vicuna closed this as completed Dec 2, 2005
@vicuna vicuna added the bug label Mar 19, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

1 participant